:root {
  --bg: #0d0d0d;
  --surface: #1a1a1a;
  --surface-2: #242424;
  --surface-3: #2a2a2a;
  --border: #2a2a2a;
  --border-strong: #3a3a3a;
  --text: #f0f0f0;
  --text-secondary: #9a9a9a;
  --text-muted: #585858;
  --accent: #c8102e;
  --accent-dark: #9b0b22;
  --accent-light: #e84060;
  --accent-tint: rgba(200, 16, 46, 0.14);
  --success: #22c55e;
  --success-tint: rgba(34, 197, 94, 0.14);
  --warning: #f59e0b;
  --warning-tint: rgba(245, 158, 11, 0.14);
  --radius: 8px;
  --font-display: 'Bebas Neue', 'Impact', sans-serif;
  --font-body: 'Inter', 'Helvetica Neue', sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 400; margin: 0; letter-spacing: 0.5px; text-transform: uppercase; }

.topbar {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.brand i { color: var(--accent); font-size: 22px; }

.badge-proto {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--accent-tint);
  color: var(--accent);
  padding: 3px 7px;
  border-radius: 5px;
}

.main-nav {
  display: flex;
  gap: 4px;
  flex: 1;
  flex-wrap: wrap;
}

.main-nav button {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 7px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.12s, color 0.12s;
}

.main-nav button:hover { background: var(--surface-2); color: var(--text); }
.main-nav button.active { background: var(--accent); color: #fff; }
.main-nav button i { font-size: 15px; }

.role-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.role-switch label { font-size: 11px; color: var(--text-muted); }

.role-switch select {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  padding: 7px 10px;
  font-family: var(--font-body);
  font-size: 12.5px;
  cursor: pointer;
}

.app-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 24px 80px;
  min-height: 60vh;
}

.page-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}

.page-head h1 { font-size: 24px; }
.page-head p { color: var(--text-secondary); font-size: 13px; margin: 4px 0 0; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
}

.card + .card { margin-top: 14px; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px,1fr)); gap: 14px; }

.stat-box {
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.stat-box .label { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.stat-box .value { font-size: 20px; font-weight: 400; font-family: var(--font-display); letter-spacing: 0.3px; }

.avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--accent-tint); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 15px; flex-shrink: 0;
}
.avatar.sm { width: 34px; height: 34px; font-size: 12px; }

.pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 20px;
  white-space: nowrap;
}
.pill-accent { background: var(--accent-tint); color: var(--accent); }
.pill-success { background: var(--success-tint); color: var(--success); }
.pill-warning { background: var(--warning-tint); color: var(--warning); }
.pill-muted { background: var(--surface-2); color: var(--text-secondary); }

/* These were scoped to `button.btn`, so a link styled as a button (<a class="btn">)
   got none of it and fell back to blue underlined browser default. Navigation that
   changes the URL wants to be a real link, so the selector covers both elements. */
.btn {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 13px;
  padding: 9px 15px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  transition: background 0.12s, transform 0.05s;
  /* anchors need these to sit like a button; on <button> they're harmless */
  display: inline-block;
  text-decoration: none;
  text-align: center;
  line-height: 1.35;
}
.btn:hover { background: var(--surface-3); text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-success { background: var(--success); border-color: var(--success); color: #06231a; }
.btn-danger-text { background: transparent; border: none; color: #e8817a; }
.btn-sm { padding: 6px 11px; font-size: 12px; }
/* a link can't be :disabled, but a busy form still greys its button out */
.btn[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }
button:disabled { opacity: 0.45; cursor: not-allowed; }

/* Every text-entry field, not just the three types this used to list — email, tel
   and password were falling through to the browser's own styling, which is why a
   signup form looked like three different forms stacked on top of each other. */
input[type=text], input[type=date], input[type=email], input[type=tel],
input[type=password], input[type=number], input[type=search], select, textarea {
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  padding: 9px 11px;
  width: 100%;
}
textarea { resize: vertical; min-height: 90px; }
input::placeholder, textarea::placeholder { color: var(--text-muted); }

/* ---------- LOCKED PREVIEW (the visitor's view of a signed-in screen) ----------
   The real screen renders underneath, out of focus and inert, so a stranger can
   see the shape of what they'd get without being able to read or touch it. */
.locked-wrap { position: relative; min-height: 520px; }

.locked-content {
  filter: blur(6px) saturate(0.55);
  opacity: 0.45;
  pointer-events: none;
  user-select: none;
  max-height: 620px;
  overflow: hidden;
  /* fade the bottom out so it reads as a peek, not a cropped page */
  -webkit-mask-image: linear-gradient(to bottom, #000 45%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 45%, transparent 100%);
}

.locked-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 70px;
}

.locked-card {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  padding: 26px 24px;
  width: 100%;
  max-width: 340px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}

/* Locked tabs stay legible but obviously gated. */
.main-nav .nav-locked { opacity: 0.62; }
.main-nav .nav-locked:hover { opacity: 1; }
.nav-lock-icon { font-size: 12px; margin-left: 6px; opacity: 0.8; }

/* ============================================================
   PHONES
   ============================================================
   Promoters and fighters open this on a phone, standing in a gym, not at a desk.
   Two rules drive everything below: nothing may scroll sideways, and anything you
   tap is at least 44px tall.

   The top bar is the hard part. On a laptop it's one row of brand + tabs +
   identity; at this width that's three things fighting for 375px. It becomes two
   stacked rows, and the tabs scroll horizontally rather than wrapping onto three
   lines and pushing the page down. */
@media (max-width: 760px) {
  .topbar-inner {
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 14px;
  }
  .brand { font-size: 20px; flex: 1 1 auto; }

  .main-nav {
    order: 3;
    flex: 1 0 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 2px;
    padding-bottom: 2px;
  }
  .main-nav::-webkit-scrollbar { display: none; }
  .main-nav button {
    white-space: nowrap;
    padding: 10px 12px;
    flex-shrink: 0;
  }

  .role-switch { flex: 0 1 auto; min-width: 0; }
  .role-switch label { display: none; }        /* "Viewing as" is redundant next to the dropdown */
  .role-switch select { max-width: 170px; font-size: 12px; }
  .signed-in-as .who-name { max-width: 130px; }

  .app-main { padding: 16px 14px 24px; }

  /* The hero is set for a wide screen; at 375px it needs to stop shouting. */
  .app-main h1 { font-size: 26px !important; line-height: 1.15; }
  .app-main h2 { font-size: 17px !important; }

  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; gap: 10px; }
  .card { padding: 16px 14px; border-radius: 12px; }

  /* Rows are label-on-top rather than squeezed side by side. */
  .list-row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .list-row .row { width: 100%; }
  .row-between { flex-direction: column; align-items: flex-start; gap: 10px; }

  .filters-row { flex-direction: column; align-items: stretch; gap: 8px; }
  .filters-row select, .filters-row input { width: 100%; max-width: none; }

  /* Anything inline-sized by a style attribute goes full width instead. */
  .card input[type=text], .card input[type=email],
  .card input[type=tel], .card input[type=number] {
    min-width: 0;
    width: 100% !important;
    flex: 1 1 100% !important;
  }

  /* Comfortably tappable, per Apple and Google's own guidance. */
  .btn { padding: 11px 15px; min-height: 44px; }
  .btn-sm { padding: 9px 12px; min-height: 38px; }

  /* Wide content scrolls inside itself rather than pushing the page sideways. */
  table { display: block; overflow-x: auto; white-space: nowrap; }

  .locked-overlay { padding-top: 40px; }
  .locked-card { padding: 24px 20px; }

  .sync-note { max-width: none; }
  .site-footer { margin-top: 24px; padding: 20px 14px 26px; }
}

/* Small phones — an iPhone SE is 320px. */
@media (max-width: 380px) {
  .app-main h1 { font-size: 23px !important; }
  .role-switch select { max-width: 130px; }
}

/* ---------- SIGN IN / CREATE ACCOUNT ----------
   One uniform look for every field on these screens: same height, same font,
   same width, white text. Spacing lives here rather than on each input so the
   fields can't drift apart as forms change. */
.auth-form input[type=text],
.auth-form input[type=email],
.auth-form input[type=tel],
.auth-form input[type=password] {
  color: #ffffff;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.2;
  height: 46px;
  padding: 0 14px;
  width: 100%;
  display: block;
  margin: 0 0 10px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  box-sizing: border-box;
}
.auth-form input:last-child { margin-bottom: 0; }
.auth-form input::placeholder { color: var(--text-secondary); }
.auth-form input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface-3);
}
/* Chrome paints its own colours over autofilled fields; this keeps them matching. */
.auth-form input:-webkit-autofill,
.auth-form input:-webkit-autofill:hover,
.auth-form input:-webkit-autofill:focus {
  -webkit-text-fill-color: #ffffff;
  -webkit-box-shadow: 0 0 0 1000px var(--surface-2) inset;
  caret-color: #ffffff;
}
/* File pickers can't be fully restyled, but they can at least stop being black
   text on a dark background. */
.auth-form input[type=file] {
  color: #ffffff;
  font-family: var(--font-body);
  font-size: 13px;
  width: 100%;
}
.auth-form input[type=file]::file-selector-button {
  background: var(--surface-3);
  color: #ffffff;
  font-family: var(--font-body);
  font-size: 12.5px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 7px 12px;
  margin-right: 10px;
  cursor: pointer;
}
.auth-form input[type=file]::file-selector-button:hover { border-color: var(--accent); }

.site-footer {
  display: flex;
  justify-content: center;
  gap: 18px;
  padding: 28px 16px 34px;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: 40px;
  flex-wrap: wrap;
}
.site-footer a { color: var(--text-secondary); }

/* Only shown on a failed save, so it's allowed to be loud. */
.sync-note {
  position: fixed;
  left: 16px;
  bottom: 16px;
  right: 16px;
  max-width: 420px;
  z-index: 60;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--surface-2);
  border: 1px solid var(--warning);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text);
}
.sync-note i { color: var(--warning); font-size: 17px; flex-shrink: 0; }

/* Who you actually are, in the slot the demo's "Viewing as" switcher uses when
   signed out. Deliberately quiet — a statement of fact, not a control. */
.signed-in-as {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.signed-in-as .who-role {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--accent-tint);
  color: var(--accent);
  padding: 3px 7px;
  border-radius: 5px;
}
.signed-in-as .who-name {
  font-size: 13px;
  color: var(--text);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- SIGN IN WITH GOOGLE ----------
   White on a dark page, on purpose. Google's button is one of the few things a
   stranger recognises instantly, and a dark-charcoal version of it reads as a
   knock-off. This is the one place the site's palette gives way. */
.btn-oauth {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 46px;
  padding: 0 14px;
  background: #ffffff;
  border: 1px solid #dadce0;
  color: #1f1f1f;
  font-size: 14px;
  font-weight: 600;
}
.btn-oauth:hover { background: #f1f3f4; }

/* "or" with a rule through it — the two ways in are alternatives, not a sequence */
.auth-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
  color: var(--text-muted);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.auth-or::before, .auth-or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ---------- FIGHTER OR PROMOTER (after a Google sign-in) ---------- */
.setup-roles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.setup-role {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 14px;
  height: auto;
  text-align: left;
}
.setup-role i { font-size: 20px; color: var(--text-secondary); }
.setup-role-title { font-size: 14px; font-weight: 600; }
.setup-role-blurb { font-size: 11.5px; color: var(--text-secondary); font-weight: 400; }
.setup-role.on { border-color: var(--accent); background: var(--accent-tint); }
.setup-role.on i { color: var(--accent); }

.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.list-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 0; border-top: 1px solid var(--border);
  gap: 12px; flex-wrap: wrap;
}
.list-row:first-child { border-top: none; }

.chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  font-size: 11.5px; padding: 5px 11px; border-radius: 20px;
  background: var(--surface-2); color: var(--text-secondary);
  border: 1px solid transparent; cursor: pointer; user-select: none;
}
.chip.selected { background: var(--accent-tint); color: var(--accent); border-color: var(--accent); }

.two-pane { display: flex; min-height: 380px; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); }
.thread-list { width: 220px; flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--border); overflow-y: auto; }
.thread-item { padding: 13px 16px; border-bottom: 1px solid var(--border); cursor: pointer; }
.thread-item:hover { background: var(--surface-2); }
.thread-item.active { background: var(--surface-2); border-left: 2px solid var(--accent); }
.thread-item .name { font-size: 13px; font-weight: 500; }
.thread-item .preview { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }

.thread-pane { flex: 1; display: flex; flex-direction: column; background: var(--surface); padding: 16px; }
.bubble { max-width: 75%; border-radius: 12px; padding: 9px 13px; font-size: 13px; margin-bottom: 10px; }
.bubble.in { align-self: flex-start; background: var(--surface-2); }
.bubble.out { align-self: flex-end; background: var(--accent); color: #fff; }
.bubble-wrap { display: flex; flex-direction: column; flex: 1; overflow-y: auto; }

.offer-card {
  align-self: flex-start; max-width: 85%; background: var(--surface-2);
  border: 1px solid var(--border-strong); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px;
}
.offer-card .tag { font-size: 10.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; }
.offer-card .terms { font-size: 13px; font-weight: 600; margin: 4px 0 10px; }

.composer { display: flex; gap: 8px; margin-top: 12px; }
.composer input { flex: 1; }

.event-fight-row {
  display: flex; align-items: center; gap: 12px; background: var(--surface-2);
  border-radius: var(--radius); padding: 11px 14px; margin-bottom: 8px;
}
.event-fight-row .vs { color: var(--text-muted); font-size: 12px; }
.event-fight-row select { flex: 1; }

.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--surface-3); border: 1px solid var(--border-strong);
  color: var(--text); padding: 11px 18px; border-radius: 9px; font-size: 13px;
  opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s;
  display: flex; align-items: center; gap: 8px; z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast i { color: var(--success); }

.empty-note { color: var(--text-muted); font-size: 12.5px; padding: 6px 0; }

.filters-row { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.filters-row select, .filters-row input { width: auto; min-width: 140px; }

.section-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px; }

.placeholder-block { text-align: center; padding: 60px 20px; color: var(--text-secondary); }
.placeholder-block i { font-size: 30px; color: var(--text-muted); }
.placeholder-block h3 { margin: 14px 0 6px; font-size: 16px; color: var(--text); }

.muted-cell { color: var(--text-muted); font-size: 11.5px; }
.expiry-ok { font-size: 10.5px; color: var(--text-muted); margin-top: 4px; }
.expiry-bad { font-size: 10.5px; color: var(--warning); font-weight: 600; margin-top: 4px; }

/* medicals dashboard: data table */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.data th {
  text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--text-muted); font-weight: 700; padding: 8px 12px 10px; white-space: nowrap;
}
table.data td { padding: 11px 12px; border-top: 1px solid var(--border); white-space: nowrap; vertical-align: middle; }
table.data tr.clickable { cursor: pointer; }
table.data tr.clickable:hover td { background: var(--surface-2); }

/* fighter dashboard: readiness status cards */
.status-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: 12px;
  padding: 16px 18px;
}
.status-card.sc-ok { border-left-color: var(--success); }
.status-card.sc-warn { border-left-color: var(--warning); }
.status-card.sc-bad { border-left-color: var(--accent); }

/* fighter dashboard: portable PromoCombat ID card */
.id-card {
  background: var(--accent);
  border-radius: 14px;
  padding: 18px 20px;
  color: #fff;
}
.id-card-top {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px;
  color: rgba(255,255,255,0.8);
}
.id-card-top i { font-size: 18px; color: #fff; }
.id-card-num {
  font-family: var(--font-display);
  font-size: 26px; letter-spacing: 1.5px; margin-top: 8px;
}

