/* ═══════════════════════════════════════════════════════════════
   PBL STATS — shared.css
   Premium dark design system inspired by MLB.com / NBA.com
   All pages link this file. Page-specific styles stay inline.
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  --bg:         #0a0a0f;
  --surface:    #111318;
  --card:       #16191f;
  --card-hover: #1a1d26;
  --border:     #1f2333;
  --border-sub: #161926;

  --accent:     #3b82f6;
  --accent-dim: #1d3d6e;
  --green:      #22c55e;
  --green-dim:  #14321f;
  --red:        #ef4444;
  --red-dim:    #3a1414;
  --gold:       #f59e0b;
  --gold-dim:   #3a2800;

  --text:       #f1f5f9;
  --text-sub:   #94a3b8;
  --muted:      #475569;
  --muted-dim:  #2a3040;

  --radius-sm:  6px;
  --radius:     10px;
  --radius-lg:  14px;

  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --header-h: 64px;
  --max-w: min(96vw, 1900px);
  --side-pad: 24px;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  width: 100%;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  position: relative;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { cursor: pointer; font-family: var(--font); }
input, textarea, select { font-family: var(--font); }

/* ── Mobile Nav Toggle (hidden on desktop) ─────────────────── */
.mobile-nav-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 38px;
  height: 38px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-left: auto;
  margin-right: 8px;
  flex-shrink: 0;
}
.mobile-nav-btn span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}
.mobile-nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  top: var(--header-h);
  background: rgba(0,0,0,0.55);
  z-index: 240;
}
body.mobile-nav-open .mobile-nav-backdrop { display: block; }
body.mobile-nav-open { overflow: hidden; }
body.mobile-nav-open .mobile-nav-btn span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
body.mobile-nav-open .mobile-nav-btn span:nth-child(2) { opacity: 0; }
body.mobile-nav-open .mobile-nav-btn span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ── Site Header ────────────────────────────────────────────── */
.site-header {
  background: #080810;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--header-h);
}
.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--side-pad);
  display: flex;
  align-items: center;
  gap: 0;
  height: 100%;
}
.header-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin-right: 20px;
}
.header-logo img { height: 38px; }

/* ── Nav Links ──────────────────────────────────────────────── */
.header-nav {
  display: flex;
  align-items: stretch;
  gap: 0;
  height: 100%;
}
.nav-link {
  display: flex;
  align-items: center;
  color: var(--text-sub);
  font-size: 13px;
  font-weight: 600;
  padding: 0 12px;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  border-top: 3px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  letter-spacing: 0.01em;
}
.nav-link:hover { color: var(--text); }
.nav-link.active {
  color: #fff;
  border-bottom-color: var(--accent);
}

/* ── Header Search ──────────────────────────────────────────── */
.header-search-wrap {
  position: relative;
  margin-left: auto;
  flex-shrink: 0;
}
.header-search-wrap input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text);
  padding: 7px 16px 7px 34px;
  font-size: 13px;
  width: 180px;
  outline: none;
  transition: border-color 0.15s, width 0.2s;
}
.header-search-wrap input:focus {
  border-color: var(--accent);
  width: 230px;
}
.header-search-wrap input::placeholder { color: var(--muted); }
.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 12px;
  pointer-events: none;
}
.search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 280px;
  max-height: 340px;
  overflow-y: auto;
  z-index: 300;
  display: none;
  box-shadow: 0 12px 40px rgba(0,0,0,0.7);
}
.search-result {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-sub);
  text-decoration: none;
  color: var(--text);
  transition: background 0.1s;
}
.search-result:last-child { border-bottom: none; }
.search-result:hover { background: var(--card-hover); }
.search-result-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface);
  flex-shrink: 0;
}
.search-result-name { font-size: 13px; font-weight: 700; color: var(--text); }
.search-result-team { font-size: 11px; color: var(--muted); margin-top: 1px; }
.search-no-results {
  padding: 16px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

/* ── Auth Nav ───────────────────────────────────────────────── */
#nav-auth {
  display: flex;
  align-items: center;
  margin-left: 12px;
  flex-shrink: 0;
}
.nav-login-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.15s;
  letter-spacing: 0.01em;
}
.nav-login-btn:hover { opacity: 0.88; }
.nav-user {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  position: relative;
  user-select: none;
}
.nav-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--surface);
  object-fit: cover;
  border: 2px solid var(--border);
  flex-shrink: 0;
}
.nav-username {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-caret {
  font-size: 9px;
  color: var(--muted);
  margin-left: 2px;
}
.nav-user-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  min-width: 176px;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0,0,0,0.8);
  display: none;
  z-index: 500;
}
.nav-user.open .nav-user-menu { display: block; }
.nav-user-menu a,
.nav-user-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 11px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  border-bottom: 1px solid var(--border-sub);
  transition: background 0.1s;
  letter-spacing: 0.01em;
}
.nav-user-menu a:last-child,
.nav-user-menu button:last-child { border-bottom: none; }
.nav-user-menu a:hover,
.nav-user-menu button:hover { background: var(--card-hover); }
.nav-user-menu .sign-out { color: var(--red); }
.nav-user-menu .admin-link { color: var(--gold); }
.nav-user-menu .coach-link { color: var(--green); }
.nav-menu-divider { border: none; border-top: 1px solid var(--border); margin: 0; }
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: var(--red);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  border-radius: 8px;
  margin-left: 6px;
}

/* ── Theme Toggle ───────────────────────────────────────────── */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  padding: 6px 9px;
  font-size: 14px;
  margin-left: 8px;
  transition: border-color 0.15s, color 0.15s;
  flex-shrink: 0;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--text); }

/* ── Score Ticker ───────────────────────────────────────────── */
.score-ticker-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: stretch;
}
.ticker-arrow-btn {
  background: var(--surface);
  border: none;
  border-right: 1px solid var(--border);
  color: var(--muted);
  font-size: 22px;
  padding: 0 16px;
  cursor: pointer;
  transition: color 0.12s, background 0.12s;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  line-height: 1;
}
.ticker-arrow-btn:last-child { border-right: none; border-left: 1px solid var(--border); }
.ticker-arrow-btn:hover { color: var(--text); background: var(--card); }
.ticker-scroll {
  display: flex;
  align-items: stretch;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
}
.ticker-scroll::-webkit-scrollbar { display: none; }
.ticker-date-label {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 16px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  background: var(--bg);
  min-width: 56px;
  text-align: center;
}
.ticker-date-label span {
  font-size: 10px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.ticker-date-label span:first-child {
  font-size: 15px;
  color: var(--text-sub);
  font-weight: 900;
  letter-spacing: 0;
  text-transform: none;
  margin-bottom: 1px;
}
.ticker-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 6px 16px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  cursor: default;
  transition: background 0.1s;
  min-width: 148px;
}
.ticker-card:hover { background: var(--card); }
.ticker-card.clickable { cursor: pointer; }
.ticker-card.live-card { background: #06130a; }
.ticker-card.live-card:hover { background: #0a1d10; }
.tc-status {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 4px;
  text-transform: uppercase;
}
.tc-final    { color: var(--muted); }
.tc-live     { color: var(--green); }
.tc-live::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: live-pulse 1.4s infinite;
  flex-shrink: 0;
  display: inline-block;
}
.tc-upcoming { color: var(--accent); }
.tc-team { display: flex; align-items: center; gap: 7px; padding: 2px 0; }
.tc-logo {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
}
.tc-logo img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.tc-abbr { font-size: 12px; font-weight: 700; color: var(--text-sub); flex: 1; }
.tc-score { font-size: 13px; font-weight: 800; color: var(--text); min-width: 20px; text-align: right; }
.tc-score.winner { color: #fff; }
.ticker-empty { color: var(--muted); font-size: 12px; padding: 0 20px; display: flex; align-items: center; }

/* ── Page Hero (shared across most pages) ───────────────────── */
.page-hero {
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
  padding: 32px 0 0;
}
.page-hero-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--side-pad);
}
.page-hero-eyebrow {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 8px;
}
.page-hero-title {
  font-size: 34px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.5px;
  line-height: 1.1;
  margin-bottom: 24px;
}
.page-hero-sub {
  font-size: 14px;
  color: var(--text-sub);
  margin-bottom: 20px;
}

/* ── Hero Tab Bar ───────────────────────────────────────────── */
.hero-tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.hero-tab-bar::-webkit-scrollbar { display: none; }
.hero-tab {
  padding: 13px 20px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.hero-tab:hover { color: var(--text-sub); }
.hero-tab.active { color: #fff; border-bottom-color: var(--accent); }

/* ── Section Labels ─────────────────────────────────────────── */
.section-label {
  font-size: 10px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 14px;
}
.section-label-lg {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 16px;
  letter-spacing: -0.2px;
}

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.card-header {
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 10px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-body { padding: 16px 18px; }

/* ── Data Tables ────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  white-space: nowrap;
}
.data-table thead tr { background: #0e1016; }
.data-table thead th {
  padding: 10px 14px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid var(--border);
  text-align: center;
  cursor: pointer;
  user-select: none;
  transition: color 0.15s, background 0.15s;
}
.data-table thead th:first-child { text-align: left; }
.data-table thead th:hover { color: var(--text-sub); }
.data-table thead th.sorted {
  color: var(--accent);
  background: #0f1626;
}
.data-table thead th .sort-arrow { margin-left: 4px; font-size: 9px; opacity: 0.7; }
.data-table tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-sub);
  color: var(--text-sub);
  text-align: center;
  background: var(--card);
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:nth-child(even) td { background: #111418; }
.data-table tbody tr:hover td { background: var(--card-hover); }
.data-table tbody td:first-child { text-align: left; }
.data-table .highlight { color: #fff; font-weight: 700; }
.data-table .rank-num {
  font-size: 11px;
  color: var(--muted);
  width: 22px;
  text-align: right;
  display: inline-block;
  flex-shrink: 0;
}
/* top-3 rank pip */
.data-table tbody tr:nth-child(1) td:first-child .rank-num { color: var(--gold); }
.data-table tbody tr:nth-child(2) td:first-child .rank-num { color: var(--text-sub); }
.data-table tbody tr:nth-child(3) td:first-child .rank-num { color: #c9874a; }

/* ── Player cell inside a table ─────────────────────────────── */
.player-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.player-avatar-sm {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface);
  flex-shrink: 0;
}
.player-link {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s;
}
.player-link:hover { color: var(--accent); }

/* ── Team cell inside a table ───────────────────────────────── */
.team-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}
.team-logo-xs {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
}
.team-logo-xs img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.team-logo-sm {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}
.team-logo-sm img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.team-abbr { font-size: 12px; font-weight: 700; color: var(--text-sub); }

/* ── Stat Pills / Badges ────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge-blue   { background: var(--accent-dim); color: var(--accent); }
.badge-green  { background: var(--green-dim);  color: var(--green); }
.badge-red    { background: var(--red-dim);    color: var(--red); }
.badge-gold   { background: var(--gold-dim);   color: var(--gold); }
.badge-gray   { background: var(--muted-dim);  color: var(--text-sub); }

.streak-w { color: var(--green); font-weight: 800; }
.streak-l { color: var(--red);   font-weight: 800; }
.rd-pos   { color: var(--green); }
.rd-neg   { color: var(--red); }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s, background 0.15s;
  letter-spacing: 0.01em;
  white-space: nowrap;
  font-family: var(--font);
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary  { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { opacity: 0.88; }
.btn-ghost {
  background: transparent;
  color: var(--text-sub);
  border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) { border-color: var(--accent); color: var(--text); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover:not(:disabled) { opacity: 0.88; }
.btn-green { background: var(--green); color: #000; }
.btn-green:hover:not(:disabled) { opacity: 0.88; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 13px 28px; font-size: 15px; }
.btn-full { width: 100%; }

/* ── Form Elements ──────────────────────────────────────────── */
.form-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 10px 14px;
  font-size: 13px;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.15s;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus { border-color: var(--accent); }
.form-input::placeholder,
.form-textarea::placeholder { color: var(--muted); }
.form-textarea { resize: vertical; }
.form-select { cursor: pointer; }

/* ── Alerts / Messages ──────────────────────────────────────── */
.alert {
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}
.alert-error   { background: var(--red-dim);   border: 1px solid #7a1f1f; color: #fca5a5; }
.alert-success { background: var(--green-dim); border: 1px solid #155e34; color: #86efac; }
.alert-info    { background: var(--accent-dim); border: 1px solid #1e4080; color: #93c5fd; }

/* ── Loading / Spinner ──────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 28px;
  height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
.spinner-sm { width: 16px; height: 16px; border-width: 2px; }
.loading-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px;
  color: var(--muted);
  gap: 14px;
  font-size: 13px;
}
.no-data {
  color: var(--muted);
  font-style: italic;
  text-align: center;
  padding: 32px;
  font-size: 13px;
}

/* ── Animations ─────────────────────────────────────────────── */
@keyframes spin         { to { transform: rotate(360deg); } }
@keyframes live-pulse   { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
@keyframes fade-in      { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.fade-in { animation: fade-in 0.3s ease both; }

/* ── Light mode (optional, existing toggle support) ─────────── */
body.light {
  --bg:       #f8fafc;
  --surface:  #f1f5f9;
  --card:     #fff;
  --card-hover: #f8fafc;
  --border:   #e2e8f0;
  --border-sub: #f1f5f9;
  --text:     #0f172a;
  --text-sub: #475569;
  --muted:    #94a3b8;
  --muted-dim: #e2e8f0;
}
body.light .site-header { background: #fff; border-color: #e2e8f0; }
body.light .score-ticker-bar { background: #f8fafc; border-color: #e2e8f0; }
body.light .ticker-date-label { background: #f1f5f9; }
body.light .data-table thead tr { background: #f8fafc; }
body.light .data-table tbody td { background: #fff; }
body.light .data-table tbody tr:nth-child(even) td { background: #f8fafc; }
body.light .search-dropdown { background: #fff; }
body.light .nav-user-menu { background: #fff; }

/* ── Signup Banner ──────────────────────────────────────────── */
.signup-banner {
  background: linear-gradient(90deg, #0a2a12, #061a0a);
  border-bottom: 1px solid #1a4a2044;
  padding: 10px var(--side-pad);
  display: none;
  overflow: hidden;
}
.signup-banner-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.signup-banner-text { font-size: 13px; font-weight: 700; color: var(--green); min-width: 0; flex: 1 1 auto; }
.signup-banner-text span { color: #fff; margin-right: 6px; }
.signup-banner-btn {
  background: var(--green);
  border: none;
  border-radius: var(--radius-sm);
  color: #000;
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  font-family: var(--font);
  flex-shrink: 0;
}
.signup-banner-btn:hover { opacity: 0.88; }
.signup-banner-close {
  background: none;
  border: none;
  color: #22c55e55;
  cursor: pointer;
  font-size: 18px;
  padding: 0 4px;
  flex-shrink: 0;
  line-height: 1;
}
.signup-banner-close:hover { color: var(--green); }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  :root { --side-pad: 16px; }
}

@media (max-width: 768px) {
  :root { --header-h: 56px; }

  /* Prevent any stray wide element from creating horizontal scroll */
  html, body { max-width: 100%; overflow-x: hidden; }

  .header-inner { height: var(--header-h); padding: 0 12px; gap: 0; }
  .header-logo img { height: 30px; }

  /* Hamburger appears, inline nav disappears */
  .mobile-nav-btn { display: flex; }

  .header-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    bottom: 0;
    width: 82%;
    max-width: 320px;
    height: auto;
    background: var(--bg);
    border-top: 1px solid var(--border);
    border-right: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 0 24px;
    overflow-y: auto;
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 0.25s ease, visibility 0s linear 0.25s;
    z-index: 250;
  }
  body.mobile-nav-open .header-nav {
    transform: translateX(0);
    visibility: visible;
    transition: transform 0.25s ease, visibility 0s linear 0s;
  }
  .nav-link {
    height: auto;
    padding: 15px 20px;
    font-size: 15px;
    font-weight: 700;
    border-bottom: 1px solid var(--border-sub);
    border-top: none;
    justify-content: flex-start;
  }
  .nav-link.active { border-bottom-color: var(--border-sub); background: var(--surface); }

  /* Search collapses out of the header row on mobile */
  .header-search-wrap { display: none; }

  #nav-auth { margin-left: 8px; }
  .nav-username { max-width: 70px; }

  .page-hero { padding: 20px 0 0; }
  .page-hero-title { font-size: 24px; margin-bottom: 16px; }
  .page-hero-sub { font-size: 13px; }
  .page-wrap { padding-left: 12px; padding-right: 12px; }

  .data-table { font-size: 12px; }
  .data-table thead th,
  .data-table tbody td { padding: 8px 8px; }

  /* Generic safety net: any table that overflows its column becomes
     horizontally scrollable instead of squishing or breaking layout */
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }

  /* Signup banner: prevent text+button+close from forcing page width */
  .signup-banner { padding: 8px 12px; }
  .signup-banner-inner { gap: 8px 12px; }
  .signup-banner-text {
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-basis: 100%;
  }
  .signup-banner-btn { padding: 6px 12px; font-size: 11px; }

  .search-dropdown { width: 240px; right: -40px; }
}

@media (max-width: 480px) {
  .header-logo img { height: 26px; }
  .page-hero-title { font-size: 20px; }
  .nav-username { display: none; }
  .nav-caret { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}