@charset "utf-8";
@import url('https://fonts.googleapis.com/css2?family=Anton&family=Bungee&family=Permanent+Marker&family=Inter:wght@400;500;600;700;800;900&display=swap');

/* Brand tokens pulled from thesandbox.agency */
:root {
  --black: #000000;
  --black-2: #0a0a0a;
  --black-3: #141414;
  --white: #ffffff;
  --bone: #f5ecd9;
  --cream: #f7f1e3;
  --sand: #d4a87a;
  --sand-soft: #e8caa1;
  --sand-dark: #b88a5a;
  --ink: #1a1410;
  --muted: #8a8278;
  --muted-2: #a89f8a;
  --line-dark: rgba(255,255,255,.13);
  --font-display: 'Anton', Impact, 'Arial Black', sans-serif;
  --font-stamp: 'Bungee', 'Anton', Impact, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Generic text/surface roles used throughout JS-generated content
     (tables, charts, illustration) — kept separate from the brand tokens
     above so the light theme can flip them independently. */
  --text-1: #e7ecf3;
  --text-2: #cbd5e0;
  --text-3: #a0aec0;
  --text-4: #718096;
  --grid-line: #2d3748;
  --chart-stroke: #1a1f2e;

  /* Fixed brand-dark zones (header, login, leaderboard card) stay this
     color in both themes, so logos/mascot art always sit on a dark plate
     and never lose contrast. */
  --brand-dark-1: #000000;
  --brand-dark-2: #0a0a0a;
  --brand-dark-3: #141414;

  /* Sidebar accent color — overridden per-user via JS to the color of
     their current Growth Score tier (see applyRankTheme in app.js).
     Defaults to the normal gold brand color for everyone else. */
  --rank-glow: var(--sand);
}

:root[data-theme="light"] {
  --black: #f7f3ea;
  --black-2: #ffffff;
  --black-3: #f0e9d8;
  --bone: #1f1a12;
  --cream: #2b2419;
  --muted: #9c9384;
  --muted-2: #5f5748;
  --line-dark: rgba(30,24,12,.14);

  --text-1: #201a11;
  --text-2: #3a3223;
  --text-3: #6b6152;
  --text-4: #8a8073;
  --grid-line: #e2d9c4;
  --chart-stroke: #ffffff;
}

/* The Dashboard tab is a fixed dark "hero" page regardless of theme — a
   deliberate design choice, not an oversight. It hosts the gamified
   leaderboard, glowing thermometer, and neon accents that are the app's
   visual centerpiece and are built to read best on dark. Every other tab
   still fully respects the light/dark toggle above. Re-asserting the
   dark-mode values here (an ID selector) outweighs the light-theme
   attribute selector's specificity regardless of source order. */
#tab-dashboard {
  background: var(--black);
  min-height: 100vh;
  --black: #000000;
  --black-2: #0a0a0a;
  --black-3: #141414;
  --bone: #f5ecd9;
  --cream: #f7f1e3;
  --muted: #8a8278;
  --muted-2: #a89f8a;
  --line-dark: rgba(255,255,255,.13);
  --text-1: #e7ecf3;
  --text-2: #cbd5e0;
  --text-3: #a0aec0;
  --text-4: #718096;
  --grid-line: #2d3748;
  --chart-stroke: #1a1f2e;
}

/* The topbar + line-switch bar sit above every tab, including the always-
   dark Dashboard tab above. In light mode they'd otherwise stay light,
   creating a mismatched light strip above the fixed-dark Dashboard body.
   :has() flips them to the same fixed-dark palette only while the
   Dashboard tab is the active one — every other tab still gets the normal
   theme-flippable topbar. */
.main-area:has(> #tab-dashboard.active) > .topbar,
.main-area:has(> #tab-dashboard.active) > .line-switch-bar {
  background: var(--brand-dark-2);
  border-bottom-color: rgba(255,255,255,.08);
  --black: #000000;
  --black-2: #0a0a0a;
  --black-3: #141414;
  --muted: #8a8278;
  --muted-2: #a89f8a;
  --line-dark: rgba(255,255,255,.13);
  --text-1: #e7ecf3;
  --text-2: #cbd5e0;
  --text-3: #a0aec0;
  --text-4: #718096;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-body); background: var(--black); color: var(--cream); min-height: 100vh; }

/* ---------- login screen ---------- */
/* Login screen is a fixed brand-dark zone regardless of theme — the
   wordmark logo needs a dark backdrop to stay legible, so nothing here
   uses the flippable theme variables. */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: radial-gradient(circle at 50% 0%, var(--brand-dark-3), var(--brand-dark-1) 60%); }
.login-card { width: 100%; max-width: 380px; background: linear-gradient(160deg, var(--brand-dark-3), var(--brand-dark-2)); border: 1px solid rgba(212,168,122,.2); border-radius: 18px; padding: 32px; box-shadow: 0 24px 60px rgba(0,0,0,.55), 0 0 60px -20px rgba(212,168,122,.25); }
.login-brand { text-align: center; margin-bottom: 24px; }
.login-wordmark { height: 76px; width: auto; display: block; margin: 0 auto; }
.login-brand p { font-size: .8rem; color: #8a8278; margin-top: 8px; }
.login-card .form-group { margin-bottom: 14px; }
.login-card label { display: block; font-size: .72rem; color: #8a8278; margin-bottom: 5px; text-transform: uppercase; letter-spacing: .5px; }
.login-card input { width: 100%; background: #000000; border: 1px solid rgba(255,255,255,.13); border-radius: 8px; color: #f7f1e3; padding: 10px 12px; font-size: .9rem; outline: none; }
.login-card input:focus { border-color: var(--sand); }
.login-btn { width: 100%; background: linear-gradient(135deg, var(--sand-soft), var(--sand)); color: var(--ink); border: 2px solid var(--sand); border-radius: 999px; padding: 12px; font-size: .85rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; cursor: pointer; margin-top: 6px; box-shadow: 0 10px 26px -10px rgba(212,168,122,.6); transition: transform .15s ease, box-shadow .15s ease; }
.login-btn:hover { transform: translateY(-1px); border-color: var(--sand-soft); box-shadow: 0 12px 30px -8px rgba(212,168,122,.75); }
.login-error { background: rgba(252,129,129,.1); border: 1px solid rgba(252,129,129,.3); color: #fc8181; font-size: .8rem; padding: 8px 12px; border-radius: 8px; margin-bottom: 14px; display: none; }
.login-error.show { display: block; }
.login-toggle { text-align: center; margin-top: 16px; font-size: .8rem; color: #8a8278; }
.login-toggle a { color: var(--sand); cursor: pointer; text-decoration: none; }

/* ---------- app shell: sidebar + main ---------- */
.app-shell { display: flex; align-items: stretch; min-height: 100vh; }

/* Sidebar is a fixed brand-dark zone regardless of theme, same reasoning
   as the old header — it carries the wordmark and needs a dark backdrop
   to stay legible in both themes. */
.sidebar { width: 240px; flex-shrink: 0; background: linear-gradient(180deg, var(--brand-dark-2), var(--brand-dark-1)); border-right: 1px solid rgba(255,255,255,.08); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; transition: width .2s ease; z-index: 100; }
.sidebar-top { display: flex; align-items: center; justify-content: space-between; padding: 20px 16px 14px; flex-shrink: 0; }
.sidebar-logo { height: 40px; width: auto; }
.sidebar-collapse-btn { background: var(--brand-dark-3); border: 1px solid rgba(255,255,255,.14); color: #a89f8a; width: 26px; height: 26px; border-radius: 50%; cursor: pointer; font-size: .9rem; line-height: 1; flex-shrink: 0; transition: transform .2s ease, color .15s ease; }
.sidebar-collapse-btn:hover { color: #f5ecd9; }

.sidebar-nav { flex: 1; padding: 6px 12px; overflow-y: auto; overflow-x: hidden; }
.sidebar-group-label { padding: 16px 12px 6px; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: #6b6152; cursor: pointer; display: flex; align-items: center; justify-content: space-between; user-select: none; }
.sidebar-group-label:hover { color: #a89f8a; }
.sidebar-group-arrow { font-size: .6rem; transition: transform .15s ease; color: #6b6152; }
.sidebar-group.collapsed .sidebar-group-arrow { transform: rotate(-90deg); }
.sidebar-group.collapsed .sidebar-sub-nav { display: none; }

.tab-btn { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 10px; border: none; background: none; color: #a89f8a; font-size: .85rem; font-weight: 600; cursor: pointer; text-align: left; margin-bottom: 2px; white-space: nowrap; overflow: hidden; transition: background .15s ease, color .15s ease, box-shadow .15s ease; position: relative; }
.tab-btn:hover { background: rgba(255,255,255,.06); color: #f5ecd9; }
.tab-btn.active { background: linear-gradient(135deg, color-mix(in srgb, var(--rank-glow) 20%, transparent), color-mix(in srgb, var(--rank-glow) 8%, transparent)); color: var(--rank-glow); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rank-glow) 30%, transparent); }
.tab-btn.active::before { content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 3px; height: 60%; border-radius: 0 4px 4px 0; background: var(--rank-glow); box-shadow: 0 0 10px color-mix(in srgb, var(--rank-glow) 80%, transparent); }
.tab-btn-icon { font-size: 1rem; flex-shrink: 0; width: 20px; text-align: center; }
.tab-btn-label { overflow: hidden; text-overflow: ellipsis; }

.sidebar-bottom { padding: 12px; border-top: 1px solid rgba(255,255,255,.08); display: flex; flex-direction: column; gap: 2px; flex-shrink: 0; }
.sidebar-btn { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; border-radius: 9px; border: none; background: none; color: #8a8278; font-size: .82rem; font-weight: 600; cursor: pointer; text-align: left; }
.sidebar-btn:hover { background: rgba(255,255,255,.06); color: #f5ecd9; }
.sidebar-btn-icon { font-size: .95rem; width: 20px; text-align: center; flex-shrink: 0; }

/* collapsed (icon-only) desktop state */
.sidebar.collapsed { width: 72px; }
.sidebar.collapsed .sidebar-logo { display: none; }
.sidebar.collapsed .sidebar-top { justify-content: center; }
.sidebar.collapsed .sidebar-collapse-btn { transform: rotate(180deg); }
.sidebar.collapsed .tab-btn-label, .sidebar.collapsed .sidebar-btn-label, .sidebar.collapsed .sidebar-group-label span, .sidebar.collapsed .sidebar-group-arrow { display: none; }
.sidebar.collapsed .tab-btn, .sidebar.collapsed .sidebar-btn { justify-content: center; padding: 10px 0; }
.sidebar.collapsed .sidebar-group-label { justify-content: center; padding: 12px 0; }
.sidebar.collapsed .sidebar-sub-nav { display: block !important; }

.main-area { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar { display: flex; align-items: center; gap: 14px; padding: 16px 26px; background: var(--black-2); border-bottom: 1px solid var(--line-dark); }
.topbar-title { font-family: var(--font-display); font-weight: 400; font-size: 1.15rem; letter-spacing: .3px; color: var(--text-1); flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.who { font-size: .8rem; color: var(--text-3); text-align: right; }
.who .role-badge { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 20px; font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.role-badge.admin { background: rgba(159,122,234,.18); color: #b794f4; }
.role-badge.agent { background: rgba(212,168,122,.18); color: var(--sand-soft); }
.btn-sm { border: none; border-radius: 999px; padding: 8px 16px; font-size: .8rem; font-weight: 600; cursor: pointer; background: var(--black-3); color: var(--muted-2); }
.btn-sm:hover { opacity: .85; }
.mobile-menu-btn { display: none; background: var(--black-3); border: 1px solid var(--line-dark); color: var(--text-2); width: 36px; height: 36px; border-radius: 8px; font-size: 1.05rem; cursor: pointer; flex-shrink: 0; align-items: center; justify-content: center; }

.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 99; }
.sidebar-overlay.show { display: block; }

@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; height: 100vh; transform: translateX(-100%); transition: transform .25s ease; width: 260px; }
  .sidebar.mobile-open { transform: translateX(0); }
  .mobile-menu-btn { display: flex; }
  .sidebar-collapse-btn { display: none; }
}

.line-switch-bar { background: var(--black-2); border-bottom: 1px solid var(--line-dark); padding: 10px 28px; display: flex; justify-content: center; }
.line-switch { display: inline-flex; background: var(--black); border: 1px solid var(--line-dark); border-radius: 999px; padding: 4px; gap: 2px; }
.line-btn { border: none; background: none; color: var(--muted); font-weight: 700; font-size: 1.05rem; padding: 11px 30px; border-radius: 999px; cursor: pointer; transition: all .15s; }
.line-btn:hover { color: var(--muted-2); }
.line-btn.active { color: var(--ink); }
.line-btn[data-line="health"].active { color: #fff; }
.line-btn[data-line="life"].active { background: linear-gradient(135deg, var(--sand-soft), var(--sand)); }
.line-btn[data-line="health"].active { background: linear-gradient(135deg, #e53e3e, #c53030); }
.line-tag { font-family: var(--font-body); font-weight: 600; font-size: .68rem; padding: 2px 9px; border-radius: 20px; text-transform: uppercase; letter-spacing: .5px; margin-left: 8px; vertical-align: middle; }
.line-tag.life { background: rgba(212,168,122,.15); color: var(--sand-soft); }
.line-tag.health { background: rgba(229,62,62,.15); color: #fc8181; }
.gamify-hero-tag-wrap { text-align: center; margin: 4px 0 18px; }
.gamify-hero-tag-img { height: 68px; width: auto; filter: drop-shadow(0 0 16px rgba(46,139,255,.35)); transition: transform .25s ease, filter .25s ease; }
.gamify-hero-tag-img:hover { transform: scale(1.06); filter: drop-shadow(0 0 22px rgba(46,139,255,.55)); }
@media (max-width: 480px) { .gamify-hero-tag-img { height: 50px; } }

.team-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; cursor: pointer; display: block; border: 2px solid var(--line-dark); }
.team-avatar-fallback { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--sand); color: var(--ink); font-family: var(--font-display); font-weight: 400; font-size: .95rem; cursor: pointer; border: 2px solid var(--line-dark); }

.tab-content { display: none; }
.tab-content.active { display: block; }
.container { max-width: 1240px; margin: 0 auto; padding: 26px 22px 60px; }
@media (max-width: 480px) { .card { padding: 16px; } .section-divider h2 { min-width: 0; } }
.section-divider { flex-wrap: wrap; }
.section-divider hr { min-width: 12px; }
.goal-score-month { max-width: 100%; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 26px; }
.stat-card {
  --accent: var(--sand);
  background: linear-gradient(160deg, var(--black-3), var(--black-2) 65%);
  border: 1px solid var(--line-dark);
  border-radius: 16px;
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
  box-shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 12px 26px -18px rgba(0,0,0,.6);
}
.stat-card::after { content: ""; position: absolute; top: -40%; right: -30%; width: 60%; height: 90%; background: radial-gradient(circle, var(--accent), transparent 70%); opacity: .12; pointer-events: none; }
.stat-card:hover { transform: translateY(-5px); border-color: color-mix(in srgb, var(--accent) 55%, var(--line-dark)); box-shadow: 0 16px 34px -14px rgba(0,0,0,.55), 0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent); }
.stat-card.blue { --accent: var(--sand); }
.stat-card.green { --accent: #48bb78; }
.stat-card.purple { --accent: #9f7aea; }
.stat-card.orange { --accent: #ed8936; }
.stat-card.teal { --accent: #38b2ac; }
.stat-card.red { --accent: #fc8181; }
.stat-card.sand { --accent: var(--sand); }
.stat-icon { width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 1.05rem; margin-bottom: 14px; background: color-mix(in srgb, var(--accent) 18%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent); position: relative; z-index: 1; }
.stat-label { font-size: .73rem; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 9px; position: relative; z-index: 1; }
.stat-value { font-size: 1.85rem; font-weight: 700; color: var(--bone); position: relative; z-index: 1; }
.stat-sub { font-size: .73rem; color: var(--muted); margin-top: 5px; position: relative; z-index: 1; }

.charts-row { display: grid; gap: 14px; margin-bottom: 26px; align-items: start; }
.cr2 { grid-template-columns: 2fr 1fr; }
.cr1 { grid-template-columns: 1fr 1fr; }
@media (max-width: 800px) { .cr2, .cr1 { grid-template-columns: minmax(0, 1fr); } }
.charts-row > * { min-width: 0; }

.card { background: linear-gradient(160deg, var(--black-3), var(--black-2) 60%); border: 1px solid var(--line-dark); border-radius: 16px; padding: 22px; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; box-shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 12px 26px -20px rgba(0,0,0,.6); }
.card:hover { transform: translateY(-3px); border-color: rgba(212,168,122,.35); box-shadow: 0 16px 32px -16px rgba(0,0,0,.55); }
.card-title { font-size: .85rem; font-weight: 600; color: var(--muted-2); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); gap: 16px; margin-bottom: 16px; }
.form-grid > * { min-width: 0; }
/* On narrow screens a "span 2" field would force a hidden 2nd column and push the page sideways */
@media (max-width: 460px) { .form-grid > * { grid-column: auto !important; } }
.dual-client-wrap { display: flex; gap: 24px; align-items: flex-start; }
.dual-client-col { flex: 1; min-width: min(280px, 100%); }
.dual-client-col + .dual-client-col { border-left: 1px solid var(--line-dark); padding-left: 24px; }
@media (max-width: 760px) { .dual-client-wrap { flex-direction: column; align-items: stretch; } .dual-client-col { max-width: 100%; } .dual-client-col + .dual-client-col { border-left: none; padding-left: 0; border-top: 1px solid var(--line-dark); padding-top: 16px; } }
.form-group label { display: block; font-size: .74rem; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .5px; }
#tab-clients .form-group label { color: var(--text-1); }
.form-group input:not([type="checkbox"]):not([type="radio"]), .form-group select, .form-group textarea { width: 100%; background: var(--black); border: 1px solid var(--line-dark); border-radius: 8px; color: var(--cream); padding: 11px 13px; font-size: .92rem; outline: none; transition: border-color .15s ease; }
.form-group input[type="checkbox"], .form-group input[type="radio"] { width: 15px; height: 15px; flex-shrink: 0; accent-color: var(--sand); cursor: pointer; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--sand); }
.form-group select option { background: var(--black-2); }
.form-group textarea { font-family: var(--font-body); resize: vertical; min-height: 90px; line-height: 1.5; }

.btn-add { background: linear-gradient(135deg, var(--sand-soft), var(--sand)); color: var(--ink); border: none; border-radius: 999px; padding: 12px 26px; font-size: .84rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; cursor: pointer; box-shadow: 0 8px 20px -8px rgba(212,168,122,.55); transition: transform .15s ease, box-shadow .15s ease; }
.btn-add:hover { transform: translateY(-1px); box-shadow: 0 10px 24px -6px rgba(212,168,122,.7); }
.btn-green { background: linear-gradient(135deg, #48bb78, #38a169); color: #fff; border-radius: 999px; }
.btn-gray { background: var(--black-3); color: var(--muted-2); border-radius: 999px; }

.table-wrap { overflow-x: auto; margin-top: 6px; }
table { width: 100%; border-collapse: collapse; font-size: .86rem; }
thead tr { border-bottom: 1px solid var(--line-dark); }
tfoot tr { border-top: 2px solid var(--line-dark); background: var(--black-3); }
th { text-align: left; padding: 11px 14px; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: 1px; font-weight: 600; white-space: nowrap; }
td { padding: 12px 14px; border-bottom: 1px solid var(--line-dark); vertical-align: middle; transition: background .12s ease; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--black-3); }

.badge, .sb, .cs { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: .7rem; font-weight: 600; box-shadow: 0 0 0 1px rgba(255,255,255,.05) inset; }
.badge-term { background: #2b4a8a; color: #90b8f8; }
.badge-whole { background: #2d5a3d; color: #68d391; }
.badge-iul { background: #44337a; color: #b794f4; }
.badge-final { background: #744210; color: #f6ad55; }
.badge-ul { background: #285e61; color: #81e6d9; }
.badge-aca { background: #285e61; color: #81e6d9; }
.badge-privatemarket { background: #44337a; color: #b794f4; }
.badge-accidental { background: #2b4a8a; color: #90b8f8; }
.badge-shortterm { background: #744210; color: #f6ad55; }
.badge-dental { background: #2d5a3d; color: #68d391; }
.badge-critical { background: #742a2a; color: #fc8181; }
.s-prospect { background: #2b3a5a; color: #90b8f8; }
.s-submitted { background: #744210; color: #f6ad55; }
.s-issued { background: #2d5a3d; color: #68d391; }
.s-paid { background: #5a4a2d; color: #d4a87a; }
.s-declined { background: #5a2d2d; color: #fc8181; }

.val-green { color: #48bb78; font-weight: 600; }
.val-red { color: #fc8181; font-weight: 600; }
.val-blue { color: var(--sand); font-weight: 600; }
.val-orange { color: #ed8936; font-weight: 600; }

.delete-btn { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 1rem; padding: 2px 6px; border-radius: 4px; }
.delete-btn:hover { color: #fc8181; }
.edit-btn { background: none; border: none; color: var(--muted); cursor: pointer; font-size: .95rem; padding: 2px 6px; border-radius: 4px; }
.edit-btn:hover { color: var(--sand); }
.empty-state { text-align: center; padding: 36px; color: var(--muted); font-size: .88rem; }

.goal-item { margin-bottom: 16px; }
.goal-header { display: flex; justify-content: space-between; font-size: .8rem; margin-bottom: 6px; }
.goal-label { color: var(--muted-2); }
.goal-pct { color: var(--sand); font-weight: 600; }
.progress-bar { background: var(--black); border-radius: 4px; height: 8px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 4px; transition: width .5s; }
.f-blue { background: linear-gradient(90deg, var(--sand), var(--sand-soft)); }
.f-green { background: linear-gradient(90deg, #48bb78, #68d391); }
.f-purple { background: linear-gradient(90deg, #9f7aea, #b794f4); }
.f-orange { background: linear-gradient(90deg, #ed8936, #f6ad55); }
.f-sand { background: linear-gradient(90deg, var(--sand-dark), var(--sand-soft)); }
.f-red { background: linear-gradient(90deg, #e53e3e, #fc8181); }

.section-divider { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.section-divider h2 { font-size: 1.05rem; font-weight: 600; color: var(--cream); white-space: nowrap; }
.section-divider hr { flex: 1; border: none; border-top: 1px solid var(--line-dark); }

.split-info-bar { background: var(--black-2); border: 1px solid var(--line-dark); border-radius: 10px; padding: 12px 16px; margin-bottom: 20px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.split-info-bar label { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; display: block; margin-bottom: 3px; }
.split-info-bar input { background: var(--black); border: 1px solid var(--line-dark); border-radius: 6px; color: var(--cream); padding: 6px 10px; font-size: .82rem; width: 76px; outline: none; text-align: center; }
.split-note { font-size: .78rem; color: var(--muted); margin-left: auto; }
.split-note span { color: var(--sand); font-weight: 700; }

.summary-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }

.recruit-stage-summary { display: flex; gap: 10px; flex-wrap: wrap; }
.recruit-stage-pill { flex: 1; min-width: 110px; background: linear-gradient(160deg, var(--black-3), var(--black-2)); border: 1px solid var(--line-dark); border-radius: 12px; padding: 12px; text-align: center; transition: transform .2s ease, border-color .2s ease; }
.recruit-stage-pill:hover { transform: translateY(-3px); border-color: rgba(212,168,122,.5); }
.recruit-stage-pill .num { font-family: var(--font-display); font-size: 1.6rem; color: var(--sand); }
.recruit-stage-pill .lbl { font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-top: 2px; }
.rec-inline-input { width: 100%; min-width: 90px; background: transparent; border: 1px solid transparent; border-radius: 6px; padding: 5px 7px; color: var(--cream); font-size: .82rem; font-family: var(--font-body); transition: border-color .15s ease, background .15s ease; }
.rec-inline-input:hover { border-color: var(--line-dark); }
.rec-inline-input:focus { outline: none; border-color: var(--sand); background: var(--black-3); }
.recruit-stage-pill.hired .num { color: #48bb78; }
.recruit-stage-pill.declined .num { color: #fc8181; }
.stage-select { background: var(--black); border: 1px solid var(--line-dark); border-radius: 6px; color: var(--cream); padding: 5px 8px; font-size: .8rem; }
.summary-box { background: linear-gradient(160deg, var(--black-3), var(--black-2)); border: 1px solid var(--line-dark); border-radius: 14px; padding: 14px; }
.summary-box .lbl { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.summary-box .val { font-size: 1.3rem; font-weight: 700; }

.overdue-row td { background: rgba(252,129,129,.05) !important; }
.soon-row td { background: rgba(237,137,54,.05) !important; }


.field-note { font-size: .74rem; color: var(--muted); margin-bottom: 14px; text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }
.illus-summary { background: var(--black-2); border: 1px solid var(--line-dark); border-radius: 10px; padding: 12px 16px; margin-bottom: 12px; }
.illus-summary:empty { display: none; }
.illus-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; font-size: .88rem; color: var(--text-2); border-top: 1px solid var(--line-dark); }
.illus-row:first-child { border-top: none; }
.illus-row .val-green { color: #68d391; font-weight: 700; }
.illus-row .val-red { color: #fc8181; font-weight: 700; }
.illus-row .val-blue { color: #4f8ef7; font-weight: 700; }
.med-row { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.med-row .med-name-input { flex: 2; }
.med-row .med-duration-input { flex: 1; }
.med-row .med-remove-btn { flex-shrink: 0; background: var(--black-3); color: var(--muted-2); border: none; border-radius: 6px; width: 30px; height: 30px; cursor: pointer; font-size: .8rem; }
.med-row .med-remove-btn:hover { background: #5a2d2d; color: #fc8181; }
.med-add-btn { background: var(--black-3); color: var(--sand); border: 1px solid rgba(212,168,122,.35); border-radius: 999px; padding: 6px 14px; font-size: .78rem; font-weight: 700; cursor: pointer; margin-top: 4px; }
.med-add-btn:hover { background: rgba(212,168,122,.12); }

.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.7); backdrop-filter: blur(3px); z-index: 1000; align-items: center; justify-content: center; }
.modal-overlay.open { display: flex; }
.modal { background: linear-gradient(160deg, var(--black-3), var(--black-2) 60%); border: 1px solid var(--line-dark); border-radius: 18px; padding: 28px; width: 100%; max-width: 640px; margin: 20px; max-height: 90vh; overflow-y: auto; box-shadow: 0 30px 70px -20px rgba(0,0,0,.6); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-header h3 { font-size: 1.05rem; font-weight: 700; color: var(--bone); }
.modal-close { background: none; border: none; color: var(--muted); font-size: 1.3rem; cursor: pointer; padding: 4px; }
.modal-close:hover { color: #fc8181; }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.btn-save { background: linear-gradient(135deg, var(--sand-soft), var(--sand)); color: var(--ink); border: none; border-radius: 999px; padding: 11px 24px; font-size: .84rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; cursor: pointer; box-shadow: 0 8px 20px -8px rgba(212,168,122,.55); transition: transform .15s ease, box-shadow .15s ease; }
.btn-save:hover { transform: translateY(-1px); box-shadow: 0 10px 24px -6px rgba(212,168,122,.7); }
.btn-cancel { background: var(--black-3); color: var(--muted-2); border: none; border-radius: 999px; padding: 11px 20px; font-size: .84rem; font-weight: 700; cursor: pointer; }

#toast { position: fixed; bottom: 22px; right: 22px; background: var(--black-2); border: 1px solid var(--line-dark); color: var(--cream); padding: 10px 18px; border-radius: 8px; font-size: .85rem; opacity: 0; transform: translateY(10px); transition: all .25s; pointer-events: none; z-index: 2000; }
#toast.show { opacity: 1; transform: translateY(0); }

/* ---------- underwriting wizard ---------- */
.uw-disclaimer { background: rgba(212,168,122,.1); border: 1px solid rgba(212,168,122,.3); border-radius: 8px; padding: 10px 14px; font-size: .78rem; line-height: 1.5; color: var(--text-2); }
.uw-cards { display: flex; flex-direction: column; gap: 10px; }
.uw-card { background: var(--black-3); border: 1px solid var(--line-dark); border-radius: 10px; padding: 12px 14px; border-left: 4px solid var(--muted); }
.uw-card-qualify { border-left-color: #48bb78; }
.uw-card-graded { border-left-color: #ed8936; }
.uw-card-conditional { border-left-color: #4f8ef7; }
.uw-card-review { border-left-color: #a0aec0; }
.uw-card-decline { border-left-color: #fc8181; }
.uw-card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.uw-plan-name { font-weight: 700; font-size: .9rem; color: var(--text-1); }
.uw-plan-meta { font-size: .72rem; color: var(--text-4); margin-top: 4px; }
.uw-tier-badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; white-space: nowrap; }
.uw-qualify { background: rgba(72,187,120,.18); color: #68d391; }
.uw-graded { background: rgba(237,137,54,.18); color: #f6ad55; }
.uw-conditional { background: rgba(79,142,247,.18); color: #63b3ed; }
.uw-review { background: rgba(160,174,192,.18); color: var(--text-3); }
.uw-decline { background: rgba(252,129,129,.18); color: #fc8181; }
.uw-details { margin-top: 8px; display: flex; flex-direction: column; gap: 5px; }
.uw-details.uw-empty { font-size: .78rem; color: var(--text-4); font-style: italic; }
.uw-detail-row { font-size: .78rem; line-height: 1.4; padding: 5px 8px; border-radius: 6px; background: var(--black-2); display: flex; flex-direction: column; gap: 2px; }
.uw-detail-src { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--text-4); }
.uw-date-note { color: var(--text-4); font-size: .72rem; }

/* ---------- growth reinvestment program (leads tab) ---------- */
.reinvest-card { border: 1px solid rgba(212,168,122,.35); }
.reinvest-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.reinvest-week-nav { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 4px 0 16px; }
.reinvest-week-label { font-weight: 600; font-size: .85rem; color: var(--text-1); min-width: 190px; text-align: center; }
.reinvest-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; align-items: stretch; }
@media (max-width: 700px) { .reinvest-grid { grid-template-columns: 1fr; } }
.reinvest-checklist { display: flex; flex-direction: column; gap: 8px; justify-content: center; }
.reinvest-check-row { display: flex; align-items: center; gap: 8px; font-size: .82rem; padding: 7px 10px; border-radius: 8px; background: var(--black-3); color: var(--text-2); }
.reinvest-check-row.ok { color: var(--text-1); }
.reinvest-check-row.fail { color: #fc8181; }
.reinvest-check-icon { flex-shrink: 0; }
.reinvest-result { border-radius: 12px; padding: 18px; text-align: center; display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.reinvest-result.qualified { background: rgba(72,187,120,.12); border: 1px solid rgba(72,187,120,.4); }
.reinvest-result.not-qualified { background: rgba(252,129,129,.1); border: 1px solid rgba(252,129,129,.35); }
.reinvest-result-tier { font-family: var(--font-display); font-weight: 400; font-size: 2rem; color: var(--sand); line-height: 1.1; }
.reinvest-result-sub { font-size: .72rem; color: var(--text-4); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }
.reinvest-result-credit { font-family: var(--font-display); font-weight: 400; font-size: 1.5rem; color: #68d391; }
.reinvest-footer-row { display: flex; gap: 14px; flex-wrap: wrap; margin: 16px 0; }
.reinvest-mini-stat { flex: 1; min-width: 140px; background: linear-gradient(160deg, var(--black-3), var(--black-2)); border: 1px solid var(--line-dark); border-radius: 12px; padding: 10px 14px; display: flex; flex-direction: column; gap: 4px; }
.reinvest-mini-stat span { font-size: .68rem; color: var(--text-4); text-transform: uppercase; letter-spacing: .5px; }
.reinvest-mini-stat strong { font-size: 1.05rem; color: var(--text-1); }
.reinvest-issued-note { background: rgba(72,187,120,.12); border: 1px solid rgba(72,187,120,.35); color: #68d391; padding: 10px 14px; border-radius: 8px; font-size: .85rem; font-weight: 600; }
.reinvest-howitworks { margin-top: 16px; font-size: .82rem; color: var(--text-3); }
.reinvest-howitworks summary { cursor: pointer; font-weight: 600; color: var(--sand); padding: 6px 0; }
.reinvest-scale-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: .8rem; }
.reinvest-scale-table th, .reinvest-scale-table td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line-dark); }
.reinvest-scale-table th { color: var(--text-4); text-transform: uppercase; font-size: .68rem; letter-spacing: .5px; }

/* ---------- growth / agency operating system tab ---------- */
.aos-week-nav { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.aos-exec-card { border: 1px solid rgba(212,168,122,.35); }
.aos-exec-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 18px; }
@media (max-width: 700px) { .aos-exec-cols { grid-template-columns: 1fr; } }
.aos-subtitle { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--muted-2); margin-bottom: 10px; }
.aos-top-row, .aos-fire-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; background: var(--black-3); margin-bottom: 6px; font-size: .85rem; }
.aos-top-rank { font-family: var(--font-display); font-weight: 400; color: var(--sand); width: 20px; flex-shrink: 0; }
.aos-top-name { flex: 1; color: var(--text-1); font-weight: 600; }
.aos-top-amt { color: #68d391; font-weight: 700; }
.aos-fire { font-size: .8rem; }
.aos-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 800px) { .aos-grid-2 { grid-template-columns: 1fr; } }
.aos-agent-cell { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
tr.aos-row-good td { border-left: 3px solid #48bb78; }
tr.aos-row-partial td { border-left: 3px solid #ed8936; }
tr.aos-row-fail td { border-left: 3px solid #fc8181; opacity: .82; }

.gs-badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: .72rem; font-weight: 700; white-space: nowrap; }
.gs-elite { background: rgba(159,122,234,.2); color: #b794f4; }
.gs-gold { background: rgba(236,201,75,.2); color: #ecc94b; }
.gs-silver { background: rgba(160,174,192,.2); color: #cbd5e0; }
.gs-bronze { background: rgba(212,168,122,.2); color: var(--sand-soft); }
.gs-coaching { background: rgba(252,129,129,.18); color: #fc8181; }

.promo-row { margin-bottom: 16px; }
.promo-row:last-child { margin-bottom: 0; }
.promo-head { display: flex; justify-content: space-between; font-size: .85rem; margin-bottom: 6px; }
.promo-name { font-weight: 600; color: var(--text-1); }
.promo-pct { color: var(--sand); font-weight: 600; }
.promo-sub { font-size: .72rem; color: var(--text-4); margin-top: 5px; }

.scorecard-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 560px) { .scorecard-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- client write-up ---------- */
.wu-section { margin-bottom: 18px; }
.wu-name { font-family: var(--font-display); font-weight: 400; font-size: 1.1rem; color: var(--bone); margin-bottom: 8px; }
.wu-subhead { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; font-weight: 700; }
.wu-fact-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 14px; }
@media (max-width: 480px) { .wu-fact-grid { grid-template-columns: 1fr; } }
.wu-fact { display: flex; justify-content: space-between; gap: 8px; font-size: .83rem; padding: 6px 0; border-bottom: 1px solid var(--line-dark); }
.wu-fact span { color: var(--text-3); }
.wu-fact strong { color: var(--text-1); font-weight: 600; text-align: right; }
.wu-divider { height: 1px; background: var(--line-dark); margin: 18px 0; }

/* ---------- collapsible form sections ---------- */
.form-section { border: 1px solid var(--line-dark); border-radius: 10px; margin-bottom: 14px; background: var(--black-3); overflow: hidden; }
.form-section > summary { cursor: pointer; padding: 13px 16px; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--sand); list-style: none; display: flex; align-items: center; gap: 9px; user-select: none; }
.form-section > summary::-webkit-details-marker { display: none; }
.form-section > summary::before { content: '▸'; font-size: .68rem; transition: transform .15s ease; display: inline-block; color: var(--muted); }
.form-section[open] > summary::before { transform: rotate(90deg); }
.form-section > summary:hover { color: var(--sand-soft); }
.form-section-body { padding: 6px 16px 18px; }
.form-section-body .form-grid:first-child { margin-top: 4px; }

/* ---------- client write-up: "Save as PDF" via native print ---------- */
@media print {
  body.printing-writeup {
    --black: #ffffff; --black-2: #ffffff; --black-3: #f2f2f2;
    --text-1: #111111; --text-2: #222222; --text-3: #444444; --text-4: #666666;
    --muted: #555555; --muted-2: #333333; --line-dark: #ddd; --cream: #111111; --bone: #111111;
    background: #fff;
  }
  body.printing-writeup > *:not(#clientWriteUpModal) { display: none !important; }
  body.printing-writeup #clientWriteUpModal { position: static; display: block; background: none; inset: auto; }
  body.printing-writeup #clientWriteUpModal .modal { position: static; max-width: 100%; width: 100%; margin: 0; padding: 0; box-shadow: none; border: none; max-height: none; overflow: visible; background: #fff; }
  body.printing-writeup .modal-header, body.printing-writeup .modal-footer, body.printing-writeup .uw-disclaimer { display: none !important; }
  body.printing-writeup #clientWriteUpModalList { max-height: none !important; overflow: visible !important; }
}

.hidden { display: none !important; }
.loading-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: .9rem; }

/* ---------- gamified leaderboard ----------
   This whole card is a fixed brand-dark zone regardless of theme, same
   reasoning as the header/login screen — it carries the wordmark + mascot
   and is meant to read as a bold, consistent "hero" band either way. */
.gamify-card { background: radial-gradient(circle at 15% 0%, var(--brand-dark-3), var(--brand-dark-1) 55%); border: 1px solid rgba(46,139,255,.35); box-shadow: 0 0 30px rgba(46,139,255,.08); border-radius: 16px; padding: 26px 24px 22px; margin-bottom: 26px; }
.gamify-header { position: relative; display: flex; align-items: center; justify-content: flex-start; padding-top: 6px; margin-bottom: 4px; }
.gamify-wordmark { height: 78px; width: auto; }
.gamify-mascot { position: absolute; right: 2px; top: -20px; height: 175px; width: auto; z-index: 2; filter: drop-shadow(0 10px 22px rgba(46,139,255,.55)); pointer-events: none; }
@media (max-width: 560px) { .gamify-mascot { height: 110px; top: -8px; } }
.gamify-today { margin-bottom: 18px; }
.gamify-grid { display: flex; align-items: flex-start; gap: 16px; }
.gamify-grid .side-panel { flex: 1; min-width: 0; margin-bottom: 0; }
@media (max-width: 860px) { .gamify-grid { flex-direction: column; width: 100%; } }
.gamify-section-title { font-family: var(--font-display); font-weight: 400; letter-spacing: 1px; text-transform: uppercase; font-size: .95rem; color: #f5ecd9; margin-bottom: 12px; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.gamify-section-title .sub-date { font-family: var(--font-body); font-weight: 500; color: #a89f8a; font-size: .74rem; text-transform: none; letter-spacing: 0; }
.mini-toggle { display: flex; gap: 2px; background: var(--brand-dark-1); border-radius: 999px; padding: 2px; }
.mini-toggle-btn { font-family: var(--font-body); font-size: .6rem; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; padding: 3px 8px; border-radius: 999px; border: none; background: transparent; color: #8a8278; cursor: pointer; transition: all .15s ease; }
.mini-toggle-btn:hover { color: #f5ecd9; }
.mini-toggle-btn.active { background: var(--sand); color: var(--ink); }

.podium { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr) minmax(0,1fr); gap: 14px; margin-bottom: 12px; align-items: end; }
.podium-card { background: var(--brand-dark-2); border: 2px solid rgba(255,255,255,.13); border-radius: 16px; padding: 20px 10px 22px; text-align: center; min-width: 0; position: relative; transition: transform .2s ease, box-shadow .2s ease; }
.podium-card:hover { transform: scale(1.06); box-shadow: 0 12px 28px rgba(0,0,0,.5); }
.podium-card.gold:hover { transform: translateY(-8px) scale(1.06); }
.podium-card .medal { position: absolute; top: 12px; left: 12px; z-index: 2; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; line-height: 1; background: var(--brand-dark-1); border-radius: 50%; box-shadow: 0 2px 8px rgba(0,0,0,.5), 0 0 0 2px rgba(255,255,255,.15); }
.podium-card .p-name { font-family: var(--font-display); font-weight: 400; color: #f5ecd9; font-size: 1.3rem; text-transform: uppercase; letter-spacing: .4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.podium-card .p-amt { font-family: var(--font-display); font-weight: 400; color: var(--sand); font-size: 2.2rem; margin-top: 6px; letter-spacing: .5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 480px) {
  .podium-card .p-name { font-size: .95rem; }
  .podium-card .p-amt { font-size: 1.5rem; }
  .podium-card .medal { width: 26px; height: 26px; font-size: 1.05rem; top: 8px; left: 8px; }
  .podium-card { padding: 16px 6px 16px; }
  .podium-card .podium-avatar, .podium-card .podium-avatar-fallback { width: 84px !important; height: 84px !important; font-size: 33px !important; }
  .gamify-card { padding: 18px 14px; }
}
.podium-card .p-sub { font-size: .82rem; color: #8a8278; margin-top: 4px; text-transform: uppercase; letter-spacing: .5px; }
.podium-card.gold, .podium-card.silver, .podium-card.bronze { background: linear-gradient(180deg, rgba(72,187,120,.22), rgba(72,187,120,.06)); }
.podium-card.gold { border-color: #ecc94b; box-shadow: 0 0 26px rgba(236,201,75,.28); transform: translateY(-8px); order: 2; }
.podium-card.silver { border-color: #a89f8a; order: 1; }
.podium-card.bronze { border-color: var(--sand); order: 3; }
.podium-avatar { border-radius: 50%; object-fit: cover; display: block; margin: 8px auto 12px; border: 4px solid rgba(255,255,255,.25); }
.podium-avatar-fallback { border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 8px auto 12px; background: var(--sand); color: var(--ink); font-family: var(--font-display); font-weight: 400; border: 4px solid rgba(255,255,255,.25); }
.podium-card.empty { opacity: .45; }
.podium-card.empty .p-amt { color: #8a8278; }

.podium-rest { display: flex; flex-direction: column; gap: 7px; }
.podium-row { display: flex; align-items: center; gap: 12px; background: var(--brand-dark-2); border: 1px solid rgba(46,139,255,.35); border-radius: 10px; padding: 9px 14px; transition: transform .15s ease, border-color .15s ease; }
.podium-row:hover { transform: scale(1.02) translateX(2px); border-color: rgba(46,139,255,.7); }
.podium-row .rank-num { font-family: var(--font-display); font-weight: 400; color: #8a8278; width: 18px; text-align: center; flex-shrink: 0; }
.podium-row .p-name { flex: 1; font-weight: 600; color: #f7f1e3; font-size: .85rem; }
.podium-row .p-amt { color: var(--sand); font-weight: 700; font-size: .88rem; }

.side-panel { background: var(--brand-dark-2); border: 1px solid rgba(46,139,255,.4); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.side-panel:hover { transform: translateY(-3px); border-color: rgba(46,139,255,.7); box-shadow: 0 10px 24px rgba(46,139,255,.15); }
.week-row { display: flex; align-items: center; gap: 10px; background: var(--brand-dark-3); border: 1px solid rgba(46,139,255,.45); border-radius: 8px; padding: 8px 12px; margin-bottom: 7px; font-size: .82rem; transition: transform .15s ease, border-color .15s ease, background .15s ease; }
.week-row:hover { transform: scale(1.03); border-color: rgba(46,139,255,.8); background: rgba(46,139,255,.08); }
.week-row:last-child { margin-bottom: 0; }
.week-row .rank-num { font-family: var(--font-display); font-weight: 400; color: #4a9eff; width: 14px; flex-shrink: 0; }
.week-row .p-name { flex: 1; color: #f7f1e3; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.week-row .p-amt { color: #f7f1e3; font-weight: 700; flex-shrink: 0; }

.gamify-totals { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 20px; padding-top: 18px; border-top: 1px solid rgba(46,139,255,.3); text-align: center; }
.gamify-totals > div { transition: transform .2s ease; border-radius: 10px; padding: 6px; }
.gamify-totals > div:hover { transform: scale(1.1); }
@media (max-width: 560px) { .gamify-totals { grid-template-columns: repeat(2, 1fr); } }
.gamify-totals .gt-label { font-size: .68rem; color: #8a8278; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.gamify-totals .gt-value { font-family: var(--font-display); font-weight: 400; font-size: 1.5rem; color: var(--sand); letter-spacing: .5px; }
.gamify-totals .gt-sub { font-size: .7rem; color: #8a8278; margin-top: 2px; text-transform: uppercase; letter-spacing: .5px; }

.gamify-totals-top { margin-top: 0; margin-bottom: 22px; padding: 18px 10px 22px; border-top: none; border-bottom: 2px solid rgba(46,139,255,.35); background: radial-gradient(ellipse at top, rgba(46,139,255,.1), transparent 70%); border-radius: 14px 14px 0 0; }

/* ---------- monthly goal thermometer ---------- */
.thermo-card { display: flex; flex-direction: column; align-items: center; }
.thermo-outer { display: flex; align-items: flex-end; gap: 14px; }
.thermo-labels { height: 240px; margin-bottom: 60px; display: flex; flex-direction: column; justify-content: space-between; text-align: right; font-size: .68rem; color: var(--muted); font-weight: 600; }
.thermo-tube-wrap { position: relative; width: 60px; display: flex; flex-direction: column; align-items: center; }
.thermo-tube { position: relative; width: 34px; height: 240px; background: var(--black); border: 2px solid rgba(79,142,247,.4); border-radius: 17px 17px 4px 4px; overflow: hidden; }
.thermo-fill { position: absolute; bottom: 0; left: 0; width: 100%; height: 0%; background: linear-gradient(180deg, #63b3ed, #2e8bff); box-shadow: 0 0 16px rgba(46,139,255,.6); transition: height .8s ease; }
.thermo-bulb { width: 60px; height: 60px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #63b3ed, #2e8bff 60%, #1e6fe0); box-shadow: 0 0 26px rgba(46,139,255,.65); border: 2px solid rgba(79,142,247,.5); margin-top: -4px; }
.thermo-mascot { position: absolute; width: 54px; height: auto; left: 50%; transform: translateX(-50%); bottom: 33px; z-index: 3; filter: drop-shadow(0 0 10px rgba(46,139,255,.8)); transition: bottom .8s ease, transform .2s ease, filter .2s ease; }
.thermo-tube-wrap:hover .thermo-mascot { transform: translateX(-50%) scale(1.15); filter: drop-shadow(0 0 18px rgba(46,139,255,1)); }
.thermo-readout { margin-top: 16px; text-align: center; font-family: var(--font-display); font-weight: 400; font-size: 1.15rem; color: #4f8ef7; }
.thermo-readout .pct { color: var(--bone); font-size: .85rem; font-family: var(--font-body); font-weight: 700; display: block; margin-top: 2px; }
.thermo-empty { color: var(--muted); font-size: .85rem; text-align: center; padding: 30px 10px; }
.gamify-totals-top .gt-label { font-size: .78rem; letter-spacing: 1.5px; color: #a89f8a; }
.gamify-totals-top .gt-value { font-size: 2.3rem; color: #4f8ef7; text-shadow: 0 0 18px rgba(79,142,247,.4); }
.gamify-totals-top .gt-sub { font-size: .78rem; }
@media (max-width: 560px) { .gamify-totals-top .gt-value { font-size: 1.7rem; } }

/* ---------- GRIT mascot: ambient walk-by + "deal added" celebration ---------- */
.grit-walker { position: fixed; bottom: 16px; left: 0; width: 110px; z-index: 400; pointer-events: none; animation: gritWalkAcross 9s linear forwards; }
.grit-walker img { width: 100%; height: auto; display: block; filter: drop-shadow(0 14px 16px rgba(0,0,0,.5)); animation: gritBob .5s ease-in-out infinite alternate; }
@keyframes gritWalkAcross { from { transform: translateX(-160px); } to { transform: translateX(calc(100vw + 160px)); } }
@keyframes gritBob { from { transform: translateY(0) rotate(-2deg); } to { transform: translateY(-10px) rotate(2deg); } }

.grit-celebrate { position: fixed; left: 50%; bottom: 24px; width: 130px; z-index: 500; pointer-events: none; transform: translateX(-50%); animation: gritCelebrateIn .6s cubic-bezier(.34,1.56,.64,1) forwards, gritCelebrateOut .5s ease-in forwards 1.8s; }
.grit-celebrate img { width: 100%; height: auto; display: block; filter: drop-shadow(0 14px 20px rgba(212,168,122,.5)); animation: gritCelebrateBounce .35s ease-in-out infinite alternate; }
@keyframes gritCelebrateIn { from { opacity: 0; transform: translateX(-50%) translateY(60px) scale(.6); } to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); } }
@keyframes gritCelebrateOut { from { opacity: 1; } to { opacity: 0; transform: translateX(-50%) translateY(-40px) scale(.8); } }
@keyframes gritCelebrateBounce { from { transform: translateY(0) rotate(-4deg); } to { transform: translateY(-14px) rotate(4deg); } }
@media (max-width: 560px) { .grit-walker { width: 76px; bottom: 10px; } .grit-celebrate { width: 92px; } }

/* ---------- confetti burst ---------- */
.confetti-burst { position: fixed; inset: 0; z-index: 1200; pointer-events: none; overflow: hidden; }
.confetti-piece { position: absolute; bottom: 20%; width: 8px; height: 14px; opacity: 0; border-radius: 2px; animation: confettiPop 1.3s ease-out forwards; }
@keyframes confettiPop { 0% { opacity: 1; transform: translate(0,0) rotate(0deg); } 100% { opacity: 0; transform: translate(var(--x), -320px) rotate(var(--rot)); } }

#soundToggleBtn { font-size: .95rem; padding: 8px 12px; }

/* ---------- live deal ticker (dashboard tab) ---------- */
.deal-ticker-wrap { background: var(--brand-dark-2); border: 1px solid rgba(212,168,122,.3); border-radius: 999px; padding: 10px 0; margin-bottom: 18px; overflow: hidden; white-space: nowrap; position: relative; }
.deal-ticker-wrap::before, .deal-ticker-wrap::after { content: ""; position: absolute; top: 0; bottom: 0; width: 40px; z-index: 2; pointer-events: none; }
.deal-ticker-wrap::before { left: 0; background: linear-gradient(90deg, var(--brand-dark-2), transparent); }
.deal-ticker-wrap::after { right: 0; background: linear-gradient(270deg, var(--brand-dark-2), transparent); }
.deal-ticker-track { display: inline-block; white-space: nowrap; font-size: .85rem; font-weight: 600; color: var(--sand-soft); animation: dealTickerScroll 60s linear infinite; padding-left: 100%; }
.deal-ticker-track .tick-sep { color: var(--muted); margin: 0 22px; }
.deal-ticker-track.paused { animation-play-state: paused; }
@keyframes dealTickerScroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- monthly boss battle ---------- */
.boss-wrap { text-align: center; padding: 6px 0 2px; }
.boss-avatar { font-size: 4.2rem; line-height: 1; display: inline-block; filter: drop-shadow(0 6px 14px rgba(0,0,0,.5)); animation: bossIdle 2.4s ease-in-out infinite; }
@keyframes bossIdle { 0%,100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-6px) rotate(2deg); } }
.boss-wrap.critical .boss-avatar { animation: bossShake .25s ease-in-out infinite; }
@keyframes bossShake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.boss-name { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--muted-2); margin: 6px 0 10px; }
.boss-hp-outer { background: var(--black); border: 2px solid rgba(252,129,129,.4); border-radius: 999px; height: 20px; overflow: hidden; }
.boss-hp-fill { height: 100%; background: linear-gradient(90deg,#e53e3e,#fc8181); transition: width .8s ease; }
.boss-wrap.critical .boss-hp-fill { animation: bossHpPulse .6s ease-in-out infinite; }
@keyframes bossHpPulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }
.boss-hp-label { font-size: .74rem; color: var(--muted); margin-top: 8px; }
.boss-defeated .boss-avatar-ko { animation: bossKo .6s ease forwards; }
@keyframes bossKo { to { transform: rotate(80deg) scale(.7); opacity: .35; } }
.boss-finisher-img { width: 90px; height: auto; margin: -18px auto 4px; display: block; filter: drop-shadow(0 8px 14px rgba(0,0,0,.5)); animation: gritCelebrateBounce .4s ease-in-out infinite alternate; }
.boss-defeated-text { font-family: var(--font-display); font-weight: 400; font-size: 1.5rem; color: var(--sand); letter-spacing: .5px; margin-top: 4px; }
.boss-sub { font-size: .78rem; color: var(--muted); margin-top: 4px; }

/* ---------- recognition wall (kudos) ---------- */
.kudos-item { padding: 10px 4px; border-bottom: 1px solid var(--line-dark); font-size: .85rem; color: var(--text-2); line-height: 1.5; }
.kudos-item:last-child { border-bottom: none; }
.kudos-item strong { color: var(--sand-soft); }
.kudos-time { font-size: .7rem; color: var(--text-4); margin-top: 2px; }

/* ---------- SBX University ---------- */
.university-done-btn { background: rgba(72,187,120,.16); color: #68d391; }
.university-cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); gap: 12px; margin-bottom: 22px; }
.university-cat-btn { background: linear-gradient(160deg, var(--black-3), var(--black-2)); border: 1px solid var(--line-dark); border-radius: 14px; padding: 18px 10px; text-align: center; cursor: pointer; color: var(--text-2); transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; }
.university-cat-btn:hover { transform: translateY(-3px); border-color: rgba(212,168,122,.4); box-shadow: 0 10px 22px -14px rgba(0,0,0,.6); }
.university-cat-btn.active { border-color: var(--sand); background: rgba(212,168,122,.14); box-shadow: 0 0 0 1px rgba(212,168,122,.35); }
.university-cat-icon { font-size: 1.9rem; display: block; margin-bottom: 8px; }
.university-cat-label { font-size: .8rem; font-weight: 700; color: var(--text-1); line-height: 1.25; }
.university-cat-count { font-size: .68rem; color: var(--muted); margin-top: 4px; text-transform: uppercase; letter-spacing: .5px; }

/* ---------- competition participant picker ---------- */
.comp-participant-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px,1fr)); gap: 4px; background: var(--black-3); border: 1px solid var(--line-dark); border-radius: 10px; padding: 10px; max-height: 200px; overflow-y: auto; }
.comp-participant-row { display: flex; align-items: center; gap: 8px; font-size: .85rem; font-weight: 500; color: var(--text-1); padding: 7px 8px; border-radius: 8px; cursor: pointer; transition: background .15s ease; }
.comp-participant-row:hover { background: rgba(212,168,122,.12); }

/* ---------- achievement badges (team tab) ---------- */
.agent-badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.agent-badge-chip { display: inline-flex; align-items: center; gap: 4px; background: rgba(212,168,122,.14); border: 1px solid rgba(212,168,122,.35); color: var(--sand-soft); font-size: .68rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }

/* ---------- share-this-win pop-up ---------- */
.deal-card-modal { animation: dealCardPop .45s cubic-bezier(.34,1.56,.64,1); }
@keyframes dealCardPop { from { opacity: 0; transform: scale(.82) translateY(24px); } to { opacity: 1; transform: scale(1) translateY(0); } }
#dealCardPreviewWrap { box-shadow: 0 18px 50px -18px rgba(212,168,122,.55), 0 0 0 1px rgba(212,168,122,.25); }

/* ---------- dismiss (✕) on an ended competition banner ---------- */
.comp-dismiss-btn { flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line-dark); background: var(--black-3); color: var(--muted-2); cursor: pointer; font-size: .85rem; line-height: 1; display: flex; align-items: center; justify-content: center; transition: color .15s ease, border-color .15s ease, background .15s ease; }
.comp-dismiss-btn:hover { color: #fc8181; border-color: rgba(252,129,129,.5); background: rgba(252,129,129,.08); }
#competitionBanner .section-divider h2 { white-space: normal; min-width: 0; }
#competitionBanner .section-divider hr { min-width: 12px; }

/* ---------- shoutouts: removable, today-only ---------- */
.kudos-item { display: flex; align-items: flex-start; gap: 10px; }
.kudos-body { flex: 1; min-width: 0; }
.kudos-del { flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%; border: none; background: transparent; color: var(--muted); cursor: pointer; font-size: .8rem; line-height: 1; }
.kudos-del:hover { color: #fc8181; background: rgba(252,129,129,.1); }

/* ---------- hide bars ---------- */
.card.collapsed > :not(.collapse-head) { display: none !important; }
.card.collapsed > .collapse-head { margin-bottom: 0; }
.collapse-toggle { flex-shrink: 0; margin-left: auto; background: var(--black-3); color: var(--muted-2); border: 1px solid var(--line-dark); border-radius: 999px; padding: 5px 13px; font-size: .72rem; font-weight: 700; letter-spacing: .5px; text-transform: none; cursor: pointer; transition: color .15s ease, border-color .15s ease; }
.section-divider .collapse-toggle { margin-left: 0; }
.collapse-toggle:hover { color: var(--sand); border-color: rgba(212,168,122,.5); }

/* ---------- clients: follow-up vs closed ---------- */
.client-status-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: -6px 0 14px; }
.client-status-tab { background: var(--black-3); color: var(--muted-2); border: 1px solid var(--line-dark); border-radius: 999px; padding: 8px 16px; font-size: .82rem; font-weight: 700; cursor: pointer; transition: color .15s ease, border-color .15s ease, background .15s ease; }
.client-status-tab .count { opacity: .7; margin-left: 4px; font-weight: 600; }
.client-status-tab:hover { color: var(--sand); }
.client-status-tab.active { background: rgba(212,168,122,.16); color: var(--sand-soft); border-color: rgba(212,168,122,.5); }

/* ---------- latest deal spotlight (top of dashboard) ---------- */
.latest-deal { border: 1px solid rgba(212,168,122,.4); background: linear-gradient(160deg, #1a140d, #0a0805 70%); }
.latest-deal-body { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.latest-deal-body img { flex: 1 1 360px; min-width: 0; max-width: 580px; height: auto; border-radius: 16px; display: block; box-shadow: 0 18px 50px -18px rgba(212,168,122,.55), 0 0 0 1px rgba(212,168,122,.25); }
.latest-deal-body img.pop { animation: dealCardPop .6s cubic-bezier(.34,1.56,.64,1); }
.latest-deal-side { flex: 1; min-width: 220px; }
.latest-deal-kicker { font-size: .78rem; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; color: var(--sand); margin-bottom: 8px; }
.latest-deal-name { font-family: var(--font-display); font-size: clamp(2rem, 4.5vw, 3.4rem); line-height: 1.05; color: #fff6e6; text-transform: uppercase; word-break: break-word; }
.latest-deal-when { color: var(--muted-2); margin-top: 8px; font-size: .9rem; }
.latest-deal-actions { margin-top: 18px; display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- live deal alert pop-up ---------- */
#dealAlertHost { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 1300; width: min(94vw, 560px); display: flex; flex-direction: column; gap: 12px; pointer-events: none; }
.deal-alert { pointer-events: auto; position: relative; text-align: center; background: linear-gradient(160deg, #1a140d, #0a0805 80%); border: 1px solid rgba(212,168,122,.6); border-radius: 18px; padding: 14px 14px 16px; box-shadow: 0 24px 60px -16px rgba(0,0,0,.85), 0 0 44px -10px rgba(212,168,122,.55); animation: dealAlertIn .55s cubic-bezier(.34,1.56,.64,1); }
.deal-alert.leaving { animation: dealAlertOut .35s ease-in forwards; }
.deal-alert img { width: 100%; height: auto; border-radius: 12px; display: block; }
.deal-alert-kicker { font-size: .8rem; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; color: #e8caa1; margin: 0 28px 10px; }
.deal-alert-fallback { font-family: var(--font-display); font-size: 1.6rem; color: #fff6e6; padding: 18px 0; }
.deal-alert-close { position: absolute; top: 8px; right: 10px; width: 28px; height: 28px; border-radius: 50%; border: none; background: rgba(255,255,255,.08); color: #e8caa1; cursor: pointer; font-size: .85rem; line-height: 1; }
.deal-alert-close:hover { background: rgba(252,129,129,.2); color: #fc8181; }
.deal-alert-kudos { margin-top: 12px; }
@keyframes dealAlertIn { from { opacity: 0; transform: translateY(-46px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes dealAlertOut { to { opacity: 0; transform: translateY(-34px) scale(.95); } }

/* ---------- prize wheel ---------- */
.wheel-card { border: 1px solid rgba(212,168,122,.55); background: linear-gradient(135deg, #2a1d10, #0a0805 75%); }
.wheel-card-inner { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.wheel-card-icon { font-size: 2.8rem; line-height: 1; animation: wheelWobble 2.2s ease-in-out infinite; }
@keyframes wheelWobble { 0%,100% { transform: rotate(-9deg); } 50% { transform: rotate(9deg); } }
.wheel-card-text { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 2px; }
.wheel-card-text strong { color: #fff6e6; font-size: 1.1rem; }
.wheel-card-text span { color: var(--muted-2); font-size: .82rem; }
.wheel-stage { position: relative; width: min(100%, 380px); margin: 10px auto 4px; }
.wheel-stage canvas { width: 100%; height: auto; display: block; transition: transform 5.2s cubic-bezier(.12,.67,.1,1); filter: drop-shadow(0 12px 24px rgba(0,0,0,.45)); }
.wheel-pointer { position: absolute; top: -8px; left: 50%; transform: translateX(-50%); width: 0; height: 0; border-left: 16px solid transparent; border-right: 16px solid transparent; border-top: 32px solid #d4a87a; filter: drop-shadow(0 3px 4px rgba(0,0,0,.55)); z-index: 2; }
.wheel-result { min-height: 52px; margin-top: 12px; font-family: var(--font-display); font-size: 1.6rem; color: var(--sand); line-height: 1.2; }
.wheel-history { text-align: left; margin-top: 14px; font-size: .8rem; color: var(--text-3); }
.wheel-history-row { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line-dark); }

/* ---------- activity calendar ---------- */
.cal-head { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 12px; }
.cal-title { font-weight: 700; font-size: 1.05rem; color: var(--text-1); min-width: 150px; text-align: center; }
.cal-quick { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 14px; }
.cal-quick-btn { background: var(--black-3); color: var(--muted-2); border: 1px solid var(--line-dark); border-radius: 999px; padding: 6px 14px; font-size: .78rem; font-weight: 700; cursor: pointer; transition: color .15s ease, border-color .15s ease, background .15s ease; }
.cal-quick-btn:hover { color: var(--sand); border-color: rgba(212,168,122,.5); }
.cal-quick-btn.active { background: rgba(212,168,122,.18); color: var(--sand-soft); border-color: rgba(212,168,122,.6); }
.cal-grid { display: grid; grid-template-columns: 26px repeat(7, minmax(0,1fr)); gap: 5px; }
.cal-dow { text-align: center; font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); padding: 2px 0 4px; }
.cal-wk-btn { background: none; border: none; color: var(--muted); font-size: 1.1rem; font-weight: 700; cursor: pointer; border-radius: 8px; transition: color .15s ease, background .15s ease; }
.cal-wk-btn:hover { color: var(--sand); background: rgba(212,168,122,.12); }
.cal-day { position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; min-height: 64px; padding: 6px 7px; background: var(--black-3); background-image: linear-gradient(rgba(212,168,122,calc(var(--heat,0)*.3)), rgba(212,168,122,calc(var(--heat,0)*.3))); border: 1px solid var(--line-dark); border-radius: 10px; color: var(--text-2); text-align: left; cursor: pointer; transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease; }
.cal-day:hover { transform: translateY(-2px); border-color: rgba(212,168,122,.6); }
.cal-day.other-month { opacity: .45; }
.cal-day.today { box-shadow: inset 0 0 0 2px rgba(212,168,122,.55); }
.cal-day.in-range { background-color: rgba(212,168,122,.2); border-color: rgba(212,168,122,.45); }
.cal-day.selected { background-color: var(--sand); background-image: none; border-color: var(--sand); color: var(--ink); opacity: 1; box-shadow: 0 6px 16px -6px rgba(212,168,122,.7); }
.cal-num { font-size: .88rem; font-weight: 800; line-height: 1; }
.cal-info { font-size: .66rem; line-height: 1.25; color: var(--muted-2); }
.cal-info b { color: var(--text-1); font-size: .8rem; }
.cal-closed { display: block; font-weight: 700; color: #48bb78; }
.cal-day.selected .cal-info, .cal-day.selected .cal-info b { color: var(--ink); }
.cal-day.selected .cal-closed { color: #1c5e38; }
.cal-hint { margin-top: 12px; text-align: center; font-size: .74rem; color: var(--muted); }
.act-sel-label { font-weight: 700; font-size: 1.05rem; color: var(--text-1); margin: 0 0 12px; }
.act-sel-hint { font-weight: 500; font-size: .8rem; color: var(--sand); }
.act-day-row td { background: var(--black-3); font-size: .74rem; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--sand); padding: 9px 14px; }
@media (max-width: 560px) {
  .cal-grid { grid-template-columns: 20px repeat(7, minmax(0,1fr)); gap: 3px; }
  .cal-day { min-height: 50px; padding: 4px 4px; border-radius: 8px; }
  .cal-info .lbl { display: none; }
  .cal-hint { font-size: .68rem; }
}

/* ---------- thermometer: whose goal to show ---------- */
.thermo-title { flex-wrap: wrap; justify-content: space-between; gap: 10px; }
.goal-view-select { max-width: 100%; background: var(--black-3); color: var(--text-2); border: 1px solid var(--line-dark); border-radius: 999px; padding: 6px 12px; font-size: .78rem; font-weight: 700; text-transform: none; letter-spacing: 0; cursor: pointer; outline: none; }
.goal-view-select:hover, .goal-view-select:focus { border-color: rgba(212,168,122,.6); color: var(--sand-soft); }

/* ---------- goal score + daily goals ---------- */
.gt-great { color: #68d391; } .gt-good { color: #63b3ed; } .gt-warn { color: #f6ad55; } .gt-bad { color: #fc8181; }
.goal-score-block { display: flex; align-items: center; gap: 16px; padding: 14px 16px; margin-bottom: 18px; border: 1px solid var(--line-dark); border-radius: 14px; background: linear-gradient(135deg, rgba(212,168,122,.1), transparent 70%), var(--black-3); }
.goal-score-num { font-family: var(--font-display); font-size: 3.1rem; line-height: 1; min-width: 74px; text-align: center; text-shadow: 0 0 22px currentColor; }
.goal-score-tier { font-weight: 800; font-size: 1.05rem; }
.goal-sub { font-size: .72rem; color: var(--muted); margin-top: 6px; line-height: 1.4; }
.activity-goal-strip { margin-bottom: 18px; border: 1px solid rgba(212,168,122,.35); }
.activity-goal-strip .goal-item:last-child { margin-bottom: 0; }

.goal-score-month { font-family: var(--font-body); margin-left: 4px; background: var(--black-3); color: var(--text-2); border: 1px solid var(--line-dark); border-radius: 999px; padding: 6px 12px; font-size: .8rem; font-weight: 700; outline: none; }
.goal-score-month:focus { border-color: var(--sand); }
.gs-score { display: block; font-family: var(--font-display); font-size: 1.7rem; line-height: 1; margin: 0 0 3px; }
.gs-cell { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 800; background: var(--black-3); border: 1px solid var(--line-dark); }
.gs-cell.gt-great { background: rgba(72,187,120,.14); border-color: rgba(72,187,120,.4); }
.gs-cell.gt-good { background: rgba(99,179,237,.14); border-color: rgba(99,179,237,.4); }
.gs-cell.gt-warn { background: rgba(246,173,85,.14); border-color: rgba(246,173,85,.4); }
.gs-cell.gt-bad { background: rgba(252,129,129,.14); border-color: rgba(252,129,129,.4); }
.gs-cell.gs-none { color: var(--text-4); font-weight: 600; }
.gs-sub { display: block; margin-top: 3px; font-size: .68rem; font-weight: 600; color: var(--muted); }
.gs-score + .gs-sub { display: block; margin: 0; font-size: .74rem; font-weight: 700; white-space: nowrap; }
.gs-unscored td { opacity: .75; }

/* ============================================================
   Agent workspace — My Day, Policies, Licensing, Announcements
   ============================================================ */
.tab-badge { margin-left: auto; min-width: 20px; padding: 1px 7px; border-radius: 999px; background: var(--sand); color: var(--ink); font-size: .68rem; font-weight: 800; text-align: center; line-height: 1.5; }
.tab-badge.urgent { background: #fc8181; color: #1a0a0a; animation: badgePulse 2s ease-in-out infinite; }
@keyframes badgePulse { 0%,100% { box-shadow: 0 0 0 0 rgba(252,129,129,.5); } 50% { box-shadow: 0 0 0 5px rgba(252,129,129,0); } }

.task-add-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.task-add-row input, .task-add-row select { background: var(--black); border: 1px solid var(--line-dark); border-radius: 8px; color: var(--cream); padding: 9px 10px; font-size: .88rem; font-family: inherit; }
.task-add-row #task_title { flex: 1 1 240px; min-width: 0; }
.task-add-row .hidden { display: none; }

.todo-section { margin-bottom: 14px; }
.todo-count { background: var(--black-3); border: 1px solid var(--line-dark); border-radius: 999px; padding: 0 8px; font-size: .72rem; margin-left: 6px; color: var(--muted-2); }
.todo-overdue .card-title { color: #fc8181; }
.todo-item { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-top: 1px solid var(--line-dark); flex-wrap: wrap; }
.todo-item:first-of-type { border-top: none; }
.todo-item.overdue { background: linear-gradient(90deg, rgba(252,129,129,.07), transparent); }
.todo-item.is-done .todo-title { text-decoration: line-through; color: var(--muted); }
.todo-icon { font-size: 1.1rem; }
.todo-main { flex: 1 1 200px; min-width: 0; }
.todo-title { font-weight: 700; font-size: .92rem; color: var(--cream); overflow-wrap: anywhere; }
a.todo-link { cursor: pointer; text-decoration: underline; text-decoration-color: var(--line-dark); }
a.todo-link:hover { color: var(--sand); }
.todo-meta { font-size: .76rem; color: var(--muted); margin-top: 2px; }
.todo-from { color: var(--sand); margin-left: 6px; }
.todo-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.todo-check { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--sand-dark); background: transparent; color: var(--ink); font-weight: 900; font-size: .8rem; cursor: pointer; flex: none; line-height: 1; }
.todo-check:hover { background: rgba(212,168,122,.2); }
.todo-check.checked { background: #48bb78; border-color: #48bb78; }
.due-chip { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .72rem; font-weight: 700; background: var(--black-3); border: 1px solid var(--line-dark); color: var(--muted-2); }
.due-chip.due-overdue { background: rgba(252,129,129,.15); border-color: rgba(252,129,129,.5); color: #fc8181; }
.due-chip.due-today { background: rgba(246,173,85,.15); border-color: rgba(246,173,85,.5); color: #f6ad55; }
.due-chip.due-soon { background: rgba(99,179,237,.13); border-color: rgba(99,179,237,.4); color: #63b3ed; }

/* Policy tracker */
.win-chip { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .76rem; font-weight: 800; background: var(--black-3); border: 1px solid var(--line-dark); }
.win-chip.win-good { background: rgba(72,187,120,.14); border-color: rgba(72,187,120,.4); color: #48bb78; }
.win-chip.win-ok { background: rgba(99,179,237,.14); border-color: rgba(99,179,237,.4); color: #63b3ed; }
.win-chip.win-warn { background: rgba(246,173,85,.14); border-color: rgba(246,173,85,.4); color: #f6ad55; }
.win-chip.win-bad { background: rgba(252,129,129,.15); border-color: rgba(252,129,129,.5); color: #fc8181; }
.win-chip.win-none { color: var(--muted); }
.policy-lapsed-row td { background: rgba(252,129,129,.05); }
.policy-delivered { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: .82rem; white-space: nowrap; }
.gs-cell.gs-none { color: var(--muted); }
td small.gs-sub { display: block; font-size: .7rem; color: var(--muted); font-weight: 500; }

/* Announcements */
.announce-card { border-color: rgba(212,168,122,.45); }
.announce-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.announce-item { padding: 12px 14px; border-radius: 12px; background: var(--black-3); border: 1px solid var(--line-dark); margin-top: 10px; }
.announce-item:first-child { margin-top: 0; }
.announce-item.pinned { border-color: rgba(212,168,122,.5); }
.announce-item.unread { box-shadow: inset 3px 0 0 var(--sand); background: linear-gradient(90deg, rgba(212,168,122,.1), var(--black-3)); }
.announce-head { display: flex; align-items: center; gap: 8px; color: var(--cream); }
.announce-new { background: var(--sand); color: var(--ink); border-radius: 999px; padding: 0 8px; font-size: .64rem; font-weight: 900; letter-spacing: .5px; }
.announce-text { margin-top: 6px; font-size: .88rem; color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.announce-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; font-size: .74rem; color: var(--muted); }
.announce-admin-tools { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.announce-seen { color: #48bb78; font-weight: 700; }
.announce-seen-list { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line-dark); font-size: .8rem; color: var(--muted-2); }
.announce-alert { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 9px 12px; border-radius: 10px; margin-bottom: 10px; font-size: .86rem; }
.announce-alert.warn { background: rgba(246,173,85,.12); border: 1px solid rgba(246,173,85,.45); }
.announce-alert.bad { background: rgba(252,129,129,.13); border: 1px solid rgba(252,129,129,.55); }
.announce-pin-row { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.announce-pin-row input { width: auto; }

/* ============================================================
   Carrier Hub
   ============================================================ */
.carrier-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.carrier-toolbar input[type="search"] { flex: 1 1 240px; min-width: 0; background: var(--black); border: 1px solid var(--line-dark); border-radius: 999px; color: var(--cream); padding: 10px 16px; font-size: .9rem; font-family: inherit; outline: none; }
.carrier-toolbar input[type="search"]:focus { border-color: var(--sand); }
.carrier-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 14px; align-items: start; }
.carrier-card { background: linear-gradient(160deg, var(--black-3), var(--black-2) 65%); border: 1px solid var(--line-dark); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.carrier-card.admin-only { border-style: dashed; border-color: rgba(212,168,122,.45); }
.carrier-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.carrier-head-main { min-width: 0; }
.carrier-name { font-family: var(--font-display); font-size: 1.25rem; letter-spacing: .3px; color: var(--cream); overflow-wrap: anywhere; line-height: 1.15; }
.carrier-tags { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.carrier-tag { padding: 1px 9px; border-radius: 999px; font-size: .7rem; font-weight: 700; background: rgba(212,168,122,.15); color: var(--sand-soft); border: 1px solid rgba(212,168,122,.3); }
.carrier-tag.lock { background: rgba(159,122,234,.15); color: #b794f4; border-color: rgba(159,122,234,.35); }
.carrier-year { font-size: .7rem; color: var(--muted); }
.carrier-admin-tools { display: flex; gap: 4px; flex: none; }
.carrier-links { display: flex; gap: 8px; flex-wrap: wrap; }
.carrier-link { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; font-size: .8rem; font-weight: 700; text-decoration: none; background: var(--black-3); border: 1px solid var(--line-dark); color: var(--text-2); transition: border-color .15s ease, color .15s ease; }
.carrier-link:hover { border-color: var(--sand); color: var(--sand); }
.carrier-none { font-size: .8rem; color: var(--muted); }
.carrier-extra, .carrier-notes { font-size: .8rem; color: var(--muted-2); overflow-wrap: anywhere; line-height: 1.5; }
.carrier-tel { color: var(--sand-soft); text-decoration: none; border-bottom: 1px dotted rgba(212,168,122,.5); }
.carrier-tel:hover { color: var(--sand); }
.carrier-login { border-top: 1px dashed var(--line-dark); padding-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.carrier-login-title { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; color: var(--muted-2); }
.carrier-login-title span { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--muted); margin-left: 6px; }
.carrier-login-grid { display: grid; gap: 8px; }
.carrier-login-grid label { display: flex; flex-direction: column; gap: 4px; font-size: .7rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.pw-row { display: flex; gap: 4px; }
.pw-row input { flex: 1; min-width: 0; background: var(--black); border: 1px solid var(--line-dark); border-radius: 8px; color: var(--cream); padding: 8px 10px; font-size: .86rem; font-family: inherit; text-transform: none; letter-spacing: 0; }
.pw-row input:focus { outline: none; border-color: var(--sand); }
.pw-btn { flex: none; width: 34px; border: 1px solid var(--line-dark); background: var(--black-3); border-radius: 8px; cursor: pointer; font-size: .85rem; }
.pw-btn:hover { border-color: var(--sand); }
.carrier-save { align-self: flex-start; }
.carrier-login-notes { display: flex; flex-direction: column; gap: 4px; font-size: .7rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }

/* ============================================================
   Topbar tools: search, ＋ New, notifications
   ============================================================ */
.topbar-right { flex-wrap: nowrap; }
.topbar-icon-btn { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-dark); background: var(--black-3); color: var(--text-2); font-size: .95rem; cursor: pointer; transition: border-color .15s ease; }
.topbar-icon-btn:hover { border-color: var(--sand); }
.topbar-hint { font-size: .68rem; font-weight: 700; color: var(--muted); border: 1px solid var(--line-dark); border-radius: 6px; padding: 1px 6px; }
.topbar-add-btn { height: 36px; padding: 0 16px; border-radius: 999px; border: none; cursor: pointer; font-weight: 800; font-size: .9rem; color: var(--ink); background: linear-gradient(135deg, var(--sand-soft), var(--sand)); box-shadow: 0 6px 16px -8px rgba(212,168,122,.7); white-space: nowrap; }
.topbar-add-btn:hover { filter: brightness(1.06); }
.notif-wrap { position: relative; }
.notif-badge { position: absolute; top: -5px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--sand); color: var(--ink); font-size: .65rem; font-weight: 900; display: flex; align-items: center; justify-content: center; }
.notif-badge.urgent { background: #fc8181; color: #1a0a0a; }
.notif-badge.hidden { display: none; }
.notif-panel { position: absolute; right: 0; top: 46px; width: min(360px, calc(100vw - 24px)); max-height: 70vh; overflow-y: auto; background: var(--black-2); border: 1px solid var(--line-dark); border-radius: 14px; box-shadow: 0 24px 60px -16px rgba(0,0,0,.7); z-index: 1500; padding: 6px; }
.notif-panel.hidden { display: none; }
.notif-head { padding: 10px 12px 8px; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; color: var(--muted-2); }
.notif-item { display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left; padding: 10px 12px; border: none; background: none; color: var(--text-1); border-radius: 10px; cursor: pointer; font-family: inherit; }
.notif-item:hover { background: var(--black-3); }
.notif-item.urgent .notif-txt strong { color: #fc8181; }
.notif-ico { font-size: 1.1rem; flex: none; }
.notif-txt { display: flex; flex-direction: column; min-width: 0; }
.notif-txt strong { font-size: .86rem; }
.notif-txt small { font-size: .74rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-empty { padding: 22px 12px; text-align: center; color: var(--muted); font-size: .88rem; }
@media (max-width: 900px) {
  .topbar { gap: 8px; }
  .topbar-title { font-size: 1rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar-right { gap: 6px; }
  .topbar-hint, .topbar-add-label, .topbar-right .who, #soundToggleBtn, #quickAddBtn { display: none; }
  .topbar-icon-btn { padding: 0 10px; }
}

/* ---------- quick add ---------- */
.qa-grid { display: grid; gap: 8px; }
.qa-item { display: flex; align-items: center; gap: 14px; text-align: left; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-dark); background: var(--black-3); color: var(--text-1); cursor: pointer; font-family: inherit; transition: border-color .15s ease, transform .15s ease; }
.qa-item:hover { border-color: var(--sand); transform: translateX(2px); }
.qa-icon { font-size: 1.5rem; flex: none; }
.qa-item strong { display: block; font-size: .95rem; }
.qa-item small { display: block; font-size: .76rem; color: var(--muted); margin-top: 2px; }

/* ---------- global search ---------- */
.search-overlay { align-items: flex-start; padding-top: min(14vh, 110px); }
.search-box { width: min(620px, calc(100vw - 24px)); background: var(--black-2); border: 1px solid var(--line-dark); border-radius: 16px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.8); overflow: hidden; }
.search-box input { width: 100%; border: none; border-bottom: 1px solid var(--line-dark); background: transparent; color: var(--cream); font-size: 1.05rem; padding: 18px 20px; outline: none; font-family: inherit; }
.search-results { max-height: min(56vh, 460px); overflow-y: auto; padding: 6px; }
.search-group { padding: 10px 12px 4px; font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); }
.search-item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 9px 12px; border: none; background: none; color: var(--text-1); border-radius: 10px; cursor: pointer; font-family: inherit; }
.search-item.active, .search-item:hover { background: rgba(212,168,122,.14); }
.search-ico { font-size: 1.15rem; flex: none; width: 26px; text-align: center; }
.search-txt { display: flex; flex-direction: column; min-width: 0; }
.search-txt strong { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-txt small { font-size: .74rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-foot { display: flex; gap: 16px; justify-content: flex-end; padding: 8px 14px; border-top: 1px solid var(--line-dark); font-size: .68rem; color: var(--muted); }
@media (max-width: 600px) { .search-foot { display: none; } }

/* ---------- my snapshot (Dashboard) ---------- */
.snap-card { background: linear-gradient(160deg, var(--black-3), var(--black-2) 65%); border: 1px solid var(--line-dark); border-radius: 16px; padding: 16px 18px; }
.snap-hello { font-weight: 700; color: var(--cream); margin-bottom: 12px; }
.snap-hello span { font-weight: 500; color: var(--muted); font-size: .85rem; margin-left: 4px; }
.snap-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px,100%), 1fr)); gap: 10px; }
.snap-tile { display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-dark); background: var(--black); color: var(--text-1); cursor: pointer; font-family: inherit; transition: border-color .15s ease, transform .15s ease; }
.snap-tile:hover { border-color: var(--sand); transform: translateY(-1px); }
.snap-tile.hit { border-color: rgba(72,187,120,.55); }
.snap-tile.urgent { border-color: rgba(252,129,129,.55); }
.snap-icon { font-size: 1.5rem; flex: none; }
.snap-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.snap-val { font-family: var(--font-display); font-size: 1.6rem; line-height: 1.1; color: var(--cream); }
.snap-val small { font-family: var(--font-body); font-size: .8rem; color: var(--muted); }
.snap-lbl { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; margin-top: 2px; }
.snap-bar { display: block; height: 5px; border-radius: 999px; background: var(--black-3); margin-top: 7px; overflow: hidden; }
.snap-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--sand-dark), var(--sand-soft)); border-radius: 999px; }
.snap-tile.hit .snap-bar i { background: #48bb78; }

/* ---------- mobile bottom bar ---------- */
.bottom-nav { display: none; }
@media (max-width: 900px) {
  .bottom-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 900; justify-content: space-around; align-items: center; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: var(--brand-dark-2); border-top: 1px solid rgba(255,255,255,.1); }
  .bottom-nav button { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; border: none; background: none; color: #a89f8a; font-family: inherit; cursor: pointer; }
  .bn-icon { font-size: 1.2rem; line-height: 1; }
  .bn-label { font-size: .64rem; font-weight: 700; }
  .bottom-nav button.active { color: var(--sand); }
  .bottom-nav .bn-plus { flex: none; width: 52px; height: 52px; margin-top: -22px; border-radius: 50%; font-size: 1.7rem; font-weight: 700; color: var(--ink); background: linear-gradient(135deg, var(--sand-soft), var(--sand)); box-shadow: 0 8px 22px -6px rgba(212,168,122,.8); padding: 0; flex-direction: row; justify-content: center; }
  .bn-badge { position: absolute; top: 0; left: calc(50% + 6px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--sand); color: var(--ink); font-size: .6rem; font-weight: 900; display: flex; align-items: center; justify-content: center; }
  .bn-badge.urgent { background: #fc8181; }
  .bn-badge.hidden { display: none; }
  .main-area { padding-bottom: 76px; }
  #toast { bottom: 92px; right: 12px; left: 12px; text-align: center; }
  .grit-walker { bottom: 70px; }
}

/* ---------- scripts ---------- */
.script-cats { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.script-card { background: linear-gradient(160deg, var(--black-3), var(--black-2) 65%); border: 1px solid var(--line-dark); border-radius: 14px; margin-bottom: 10px; }
.script-card[open] { border-color: rgba(212,168,122,.4); }
.script-card summary { display: flex; align-items: center; gap: 10px; padding: 14px 16px; cursor: pointer; list-style: none; flex-wrap: wrap; }
.script-card summary::-webkit-details-marker { display: none; }
.script-title { font-weight: 700; color: var(--cream); flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
.script-star { border: none; background: none; font-size: 1.25rem; cursor: pointer; color: var(--muted); padding: 0 4px; }
.script-star.on { color: #ecc94b; }
.script-body { padding: 0 16px 8px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-2); font-size: .92rem; line-height: 1.6; }
.script-actions { display: flex; gap: 8px; align-items: center; padding: 6px 16px 14px; }

/* ---------- help ---------- */
.help-hero { margin-bottom: 20px; background: linear-gradient(135deg, rgba(212,168,122,.16), var(--black-2) 70%); border-color: rgba(212,168,122,.35); }
.help-hero-row { display: flex; gap: 18px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.help-hero-title { font-family: var(--font-display); font-size: 1.5rem; color: var(--cream); }
.help-hero-sub { color: var(--muted-2); font-size: .9rem; margin-top: 6px; max-width: 640px; line-height: 1.5; }
.help-progress { height: 8px; border-radius: 999px; background: var(--black); overflow: hidden; margin-bottom: 8px; }
.help-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--sand-dark), #48bb78); border-radius: 999px; transition: width .4s ease; }
.help-check { display: flex; align-items: center; gap: 12px; padding: 9px 2px; border-top: 1px solid var(--line-dark); }
.help-check:first-of-type { border-top: none; }
.help-tick { width: 22px; height: 22px; flex: none; border-radius: 50%; border: 2px solid var(--sand-dark); display: flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 900; color: var(--ink); }
.help-check.done .help-tick { background: #48bb78; border-color: #48bb78; }
.help-check-label { flex: 1; min-width: 0; font-size: .92rem; }
.help-check.done .help-check-label { color: var(--muted); text-decoration: line-through; }
.help-complete { margin-top: 10px; text-align: center; color: #48bb78; font-weight: 700; }
.help-guide { background: linear-gradient(160deg, var(--black-3), var(--black-2) 65%); border: 1px solid var(--line-dark); border-radius: 12px; margin-bottom: 8px; }
.help-guide summary { display: flex; gap: 12px; align-items: center; padding: 13px 16px; cursor: pointer; list-style: none; }
.help-guide summary::-webkit-details-marker { display: none; }
.help-guide summary span { font-size: 1.25rem; }
.help-guide[open] { border-color: rgba(212,168,122,.4); }
.help-guide-body { padding: 0 16px 14px 52px; color: var(--text-2); font-size: .9rem; line-height: 1.6; }
.help-guide-body .btn-sm { margin-top: 10px; }
.help-guide-body kbd { background: var(--black); border: 1px solid var(--line-dark); border-radius: 5px; padding: 0 6px; font-size: .8rem; }
.help-sub { margin: 20px 0 8px; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .7px; color: var(--muted-2); }

/* ---------- guided tour ---------- */
.tour-wrap { position: fixed; inset: 0; z-index: 9000; }
.tour-wrap.hidden { display: none; }
.tour-spot { position: fixed; display: none; border-radius: 12px; box-shadow: 0 0 0 9999px rgba(0,0,0,.72), 0 0 0 2px var(--sand); transition: top .25s ease, left .25s ease, width .25s ease, height .25s ease; pointer-events: none; }
.tour-card { position: fixed; background: var(--black-2); border: 1px solid rgba(212,168,122,.5); border-radius: 16px; padding: 18px; box-shadow: 0 30px 70px -16px rgba(0,0,0,.85); transition: top .25s ease, left .25s ease; }
.tour-card.center { top: 50%; left: 50%; transform: translate(-50%, -50%); }
.tour-wrap:has(.tour-spot[style*="display: none"]) { background: rgba(0,0,0,.72); }
.tour-count { font-size: .68rem; font-weight: 800; letter-spacing: .6px; color: var(--muted); }
.tour-title { font-family: var(--font-display); font-size: 1.25rem; color: var(--cream); margin: 4px 0 6px; }
.tour-text { font-size: .9rem; color: var(--text-2); line-height: 1.55; }
.tour-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; margin-top: 14px; }
.tour-skip { margin-right: auto; border: none; background: none; color: var(--muted); font-size: .8rem; cursor: pointer; font-family: inherit; }
.tour-skip:hover { color: var(--cream); }

/* ============================================================
   Tables that fit the screen (see fitTables() in app.js)
   ============================================================ */
/* 1) Only for a table that would otherwise scroll sideways: tighten it up first.
      (Tables that already fit keep their normal look.) */
table.compact { font-size: .8rem; }
table.compact th { padding: 9px 8px; white-space: normal; letter-spacing: .4px; font-size: .68rem; }
table.compact td { padding: 9px 8px; }
/* 2) If it still doesn't fit, each row becomes a labeled card */
table.stacked, table.stacked tbody, table.stacked tfoot, table.stacked tr, table.stacked td { display: block; width: 100%; }
table.stacked thead { display: none; }
table.stacked tr { background: linear-gradient(160deg, var(--black-3), var(--black-2) 70%); border: 1px solid var(--line-dark); border-radius: 12px; margin-bottom: 10px; padding: 4px 14px; }
table.stacked tfoot tr { border-top: 2px solid var(--sand-dark); }
table.stacked tr:hover td { background: transparent; }
table.stacked td { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 8px 0; border-bottom: 1px dashed var(--line-dark); text-align: right; min-width: 0; overflow-wrap: anywhere; }
table.stacked td:last-child { border-bottom: none; }
table.stacked td::before { content: attr(data-label); flex: none; max-width: 42%; text-align: left; color: var(--muted); font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
table.stacked td:not([data-label])::before, table.stacked td[data-label=""]::before { display: none; }
table.stacked td:not([data-label]) { display: block; text-align: center; }
table.stacked td input:not([type="checkbox"]):not([type="radio"]), table.stacked td select, table.stacked td textarea { max-width: 58%; }
table.stacked td small.gs-sub { text-align: right; }
.table-wrap:has(> table.stacked) { overflow-x: visible; }
table.stacked td[data-label=""] { justify-content: flex-end; gap: 8px; }

/* ============================================================
   Hard lock: the page only ever scrolls up and down.
   Nothing — a wide table, an animation, a stray element — can add a sideways
   scroll. (html carries the lock so the sidebar's sticky positioning keeps working.)
   ============================================================ */
html { overflow-x: hidden; max-width: 100%; overscroll-behavior-x: none; }
body { max-width: 100%; touch-action: pan-y pinch-zoom; }
@supports (overflow: clip) {
  body, .app-shell, .main-area { overflow-x: clip; }
}
.table-wrap { overflow-x: hidden; }   /* tables shrink to fit or become cards (fitTables), never scroll */
#gritLayer { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 400; }
#gritLayer .grit-walker { position: absolute; }
/* In card mode nothing may force a row wider than the card (e.g. no-wrap badges) */
table.stacked td { flex-wrap: wrap; }
table.stacked td, table.stacked td * { white-space: normal; }
table.stacked td > * { max-width: 100%; }
.med-row input { min-width: 0; }
.med-row .med-name-input, .med-row .med-duration-input { min-width: 0; width: 0; }

/* ============================================================
   Live Issued Premium board + TV mode
   ============================================================ */
.lb-card { padding: 0; overflow: hidden; border-color: rgba(212,168,122,.4); background: radial-gradient(120% 140% at 50% 0%, rgba(212,168,122,.16), transparent 55%), linear-gradient(180deg, #0c0a07, #060504); }
.lb { padding: 18px 20px 22px; color: var(--cream); }
.lb-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.lb-title { font-family: var(--font-display); font-size: 1.25rem; letter-spacing: .5px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; text-transform: uppercase; }
.lb-live { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-body); font-size: .68rem; font-weight: 900; letter-spacing: 1px; color: #fc8181; background: rgba(252,129,129,.12); border: 1px solid rgba(252,129,129,.4); border-radius: 999px; padding: 3px 10px; }
.lb-live i { width: 8px; height: 8px; border-radius: 50%; background: #fc8181; animation: lbPulse 1.4s ease-in-out infinite; }
@keyframes lbPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(252,129,129,.7); opacity: 1; } 50% { box-shadow: 0 0 0 7px rgba(252,129,129,0); opacity: .55; } }
.lb-periods { display: inline-flex; background: #000; border: 1px solid var(--line-dark); border-radius: 999px; padding: 3px; gap: 2px; max-width: 100%; overflow: hidden; }
.lb-periods button { border: none; background: none; color: var(--muted-2); font-weight: 700; font-size: .78rem; padding: 7px 14px; border-radius: 999px; cursor: pointer; font-family: inherit; white-space: nowrap; }
.lb-periods button.active { color: var(--ink); background: linear-gradient(135deg, var(--sand-soft), var(--sand)); }
.lb-tv-btn { border: 1px solid var(--line-dark); background: var(--black-3); color: var(--text-2); border-radius: 999px; padding: 7px 14px; font-size: .78rem; font-weight: 700; cursor: pointer; font-family: inherit; }
.lb-tv-btn:hover { border-color: var(--sand); color: var(--sand); }

.lb-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.25fr) minmax(0,1fr); gap: 18px; align-items: start; }
.lb-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.lb-col-title { font-family: var(--font-display); letter-spacing: 1.4px; font-size: .95rem; color: var(--sand-soft); text-transform: uppercase; margin-bottom: 2px; }
.lb-right .lb-col-title { text-align: right; }
.lb-none { color: var(--muted); font-size: .85rem; padding: 14px 4px; }

.lb-row { position: relative; display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; overflow: hidden; background: linear-gradient(90deg, #2b1f14, #1a130c); border: 1px solid rgba(212,168,122,.28); will-change: transform; }
.lb-row.r1 { border-color: rgba(236,201,75,.75); box-shadow: 0 0 22px -8px rgba(236,201,75,.6); }
.lb-bar { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, rgba(212,168,122,.34), rgba(212,168,122,.04)); transition: width .9s cubic-bezier(.2,.8,.2,1); pointer-events: none; }
.lb-row > *:not(.lb-bar) { position: relative; }
.lb-rank { flex: none; width: 18px; text-align: center; font-weight: 800; color: var(--sand-soft); font-size: .9rem; }
.lb-avatar, .lb-avatar-fallback { border-radius: 50%; object-fit: cover; flex: none; display: flex; align-items: center; justify-content: center; background: var(--sand); color: var(--ink); font-family: var(--font-display); border: 2px solid rgba(255,255,255,.2); }
.lb-name { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.lb-name b { font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-name small { font-size: .68rem; color: var(--muted-2); }
.lb-amt { flex: none; font-family: var(--font-display); font-size: 1.1rem; color: var(--sand-soft); letter-spacing: .4px; }
.lb-row.bump { animation: lbBump 1.8s ease-out; }
@keyframes lbBump { 0% { box-shadow: 0 0 0 0 rgba(72,187,120,.9); background: linear-gradient(90deg, #1f4d33, #1a130c); } 100% { box-shadow: 0 0 0 14px rgba(72,187,120,0); } }

.lb-center { display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; padding-top: 4px; }
.lb-label { font-size: .68rem; font-weight: 800; letter-spacing: 2px; color: var(--muted-2); }
.lb-label-total { margin-top: 14px; }
.lb-timer { font-family: var(--font-display); font-size: clamp(1.6rem, 3.4vw, 2.6rem); letter-spacing: 2px; color: var(--cream); margin-top: 4px; font-variant-numeric: tabular-nums; }
.lb-total-wrap { position: relative; max-width: 100%; }
.lb-total { font-family: var(--font-display); font-size: clamp(2.4rem, 6vw, 4.6rem); line-height: 1.05; color: var(--sand-soft); text-shadow: 0 0 34px rgba(212,168,122,.55); font-variant-numeric: tabular-nums; margin-top: 4px; overflow-wrap: anywhere; }
.lb-total.flash { animation: lbFlash 1.4s ease-out; }
@keyframes lbFlash { 0% { color: #fff; text-shadow: 0 0 50px rgba(255,255,255,.95); transform: scale(1.06); } 100% { transform: scale(1); } }
.lb-pop { position: absolute; left: 50%; top: -6px; transform: translateX(-50%); font-weight: 900; font-size: 1.05rem; color: #68d391; white-space: nowrap; opacity: 0; pointer-events: none; text-shadow: 0 0 16px rgba(72,187,120,.8); }
.lb-pop.show { animation: lbPop 3s ease-out forwards; }
@keyframes lbPop { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.8); } 12% { opacity: 1; transform: translate(-50%, -8px) scale(1.1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -34px); } }
.lb-goal { width: min(320px, 100%); margin-top: 10px; }
.lb-goal-bar { height: 8px; border-radius: 999px; background: #000; border: 1px solid var(--line-dark); overflow: hidden; }
.lb-goal-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--sand-dark), var(--sand-soft)); border-radius: 999px; transition: width 1s ease; }
.lb-goal small { font-size: .72rem; color: var(--muted-2); }
.lb-empty { margin-top: 8px; color: var(--muted-2); font-size: .85rem; }
.lb-stats { display: flex; gap: 22px; justify-content: center; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line-dark); width: 100%; flex-wrap: wrap; }
.lb-stats div { display: flex; flex-direction: column; align-items: center; }
.lb-stats b { font-family: var(--font-display); font-size: 1.35rem; color: var(--cream); font-weight: 400; }
.lb-stats small { font-size: .62rem; letter-spacing: 1.5px; color: var(--muted-2); font-weight: 700; }
@media (max-width: 900px) {
  .lb-grid { grid-template-columns: minmax(0,1fr); }
  .lb-center { order: -1; }
  .lb-right .lb-col-title { text-align: left; }
  .lb-periods button { padding: 7px 10px; font-size: .74rem; }
}

/* ----- TV mode ----- */
.board-tv { position: fixed; inset: 0; z-index: 8000; overflow: auto; background: radial-gradient(120% 120% at 50% 0%, #1b1408, #050403 70%); }
.board-tv.hidden { display: none; }
body.tv-open { overflow: hidden; }
.board-tv .lb { min-height: 100%; padding: clamp(14px, 2.4vw, 40px); display: flex; flex-direction: column; }
.board-tv .lb-grid { flex: 1; align-items: center; gap: clamp(14px, 2.4vw, 40px); }
.board-tv .lb-title { font-size: clamp(1.4rem, 2.6vw, 2.6rem); }
.board-tv .lb-live { font-size: clamp(.7rem, 1vw, 1rem); }
.board-tv .lb-periods button { font-size: clamp(.8rem, 1.2vw, 1.2rem); padding: .5em 1.1em; }
.board-tv .lb-col-title { font-size: clamp(1rem, 1.6vw, 1.7rem); }
.board-tv .lb-row { padding: clamp(8px, 1vw, 16px) 16px; }
.board-tv .lb-name b { font-size: clamp(.95rem, 1.5vw, 1.6rem); }
.board-tv .lb-name small { font-size: clamp(.7rem, 1vw, 1.05rem); }
.board-tv .lb-amt { font-size: clamp(1.1rem, 1.8vw, 2rem); }
.board-tv .lb-rank { font-size: clamp(.95rem, 1.4vw, 1.5rem); width: 1.6em; }
.board-tv .lb-label { font-size: clamp(.7rem, 1vw, 1.1rem); }
.board-tv .lb-timer { font-size: clamp(2rem, 5vw, 5.5rem); }
.board-tv .lb-total { font-size: clamp(3rem, 11vw, 12rem); }
.board-tv .lb-stats b { font-size: clamp(1.4rem, 3vw, 3.2rem); }
.board-tv .lb-stats small { font-size: clamp(.65rem, .9vw, 1rem); }
.board-tv .lb-pop { font-size: clamp(1.2rem, 2.4vw, 2.6rem); }
@media (max-width: 900px) { .board-tv .lb-grid { align-items: start; } }
.lb-periods { flex-wrap: wrap; justify-content: center; }
@media (max-width: 480px) {
  .lb { padding: 14px 12px 18px; }
  .lb-periods { width: 100%; }
  .lb-periods button { flex: 1 1 auto; padding: 7px 6px; font-size: .7rem; }
}

/* Issued / Submitted switch + the "other" total */
.lb-metrics { display: inline-flex; background: #000; border: 1px solid var(--line-dark); border-radius: 999px; padding: 3px; gap: 2px; }
.lb-metrics button { border: none; background: none; color: var(--muted-2); font-weight: 800; font-size: .78rem; padding: 7px 14px; border-radius: 999px; cursor: pointer; font-family: inherit; white-space: nowrap; }
.lb-metrics button.active { color: var(--ink); background: linear-gradient(135deg, var(--sand-soft), var(--sand)); }
.lb.m-submitted .lb-metrics button.active { background: linear-gradient(135deg, #bee3f8, #63b3ed); }
.lb-other { margin-top: 14px; display: inline-flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 18px; border-radius: 14px; border: 1px dashed rgba(255,255,255,.22); background: rgba(255,255,255,.03); color: var(--text-2); cursor: pointer; font-family: inherit; max-width: 100%; }
.lb-other:hover { border-color: var(--sand); }
.lb-other span { font-size: .62rem; letter-spacing: 1.6px; font-weight: 800; color: var(--muted-2); }
.lb-other b { font-family: var(--font-display); font-size: 1.4rem; font-weight: 400; color: #90cdf4; }
.lb.m-submitted .lb-other b { color: var(--sand-soft); }
.lb-other small { font-size: .7rem; color: var(--muted); }
/* Submitted view gets a cool blue accent so it's obvious which number you're looking at */
.lb.m-submitted .lb-total { color: #bee3f8; text-shadow: 0 0 34px rgba(99,179,237,.55); }
.lb.m-submitted .lb-row { background: linear-gradient(90deg, #14233a, #0d1624); border-color: rgba(99,179,237,.3); }
.lb.m-submitted .lb-row.r1 { border-color: rgba(144,205,244,.8); box-shadow: 0 0 22px -8px rgba(99,179,237,.6); }
.lb.m-submitted .lb-bar { background: linear-gradient(90deg, rgba(99,179,237,.34), rgba(99,179,237,.04)); }
.lb.m-submitted .lb-amt, .lb.m-submitted .lb-col-title, .lb.m-submitted .lb-rank { color: #90cdf4; }
.lb.m-submitted .lb-card, .lb-card:has(.m-submitted) { border-color: rgba(99,179,237,.4); }
@media (max-width: 480px) { .lb-metrics { width: 100%; } .lb-metrics button { flex: 1; } }
.board-tv .lb-metrics button { font-size: clamp(.8rem, 1.2vw, 1.2rem); padding: .5em 1.1em; }
.board-tv .lb-other b { font-size: clamp(1.4rem, 2.6vw, 2.8rem); }
.board-tv .lb-other span { font-size: clamp(.65rem, .9vw, 1rem); }

/* Header: title | [Issued/Submitted + period tabs] | TV button — controls drop to their own row when tight */
.lb-controls { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; align-items: center; }
@media (max-width: 1360px) { .lb-controls { order: 3; width: 100%; justify-content: space-between; } }
@media (max-width: 600px) { .lb-controls { flex-direction: column; align-items: stretch; } .lb-controls .lb-periods, .lb-controls .lb-metrics { width: 100%; } }
