/* ============================================================
   SUBSPACE CRM - ONE DESIGN SYSTEM (self-contained, no CDNs)
   ------------------------------------------------------------
   Spacing scale : 4 / 8 / 12 / 16 / 20 / 24 px   -> --space-1..6
   Type scale    : 12 / 13 / 14 / 16 / 22 / 26 px -> --fs-xs..xxl
   Radius        : 8 controls | 10-12 cards | 14 auth | 20 pills
   Layout        : .center (auth) | .wrap (app, max 900) | .topbar
   Nav           : .nav-links + .nav-link (.active)
   Surfaces      : .panel (section) | .card (auth) | .tile | .stat-box
   Section head  : .panel-head (title + meta, one spacing) / .spread
   Buttons       : button (primary gradient) | .btn-sm | .btn-line
                   .btn-danger | .btn-approve | .ghost  (share states)
   Forms         : label | input | textarea | select | .field | .form-grid
   Data          : table/th/td | .badge | .pill | .count-tag | .mono
   Utilities     : .row | .muted | .hidden | .scroll-x | .w-auto
   States        : hover lift+glow | focus accent ring | disabled dimmed
   ============================================================ */
:root {
  --bg: #0b0f0c;
  --panel: #121814;
  --border: #223026;
  --fg: #e6efe8;
  --muted: #8aa093;
  --accent: #3fae6b;
  --accent-dim: #2c7d4c;
  --accent-bright: #5fd48a;
  --danger: #d0533f;
  /* accent system: gradient + glow tokens */
  --accent-gradient: linear-gradient(135deg, #48c47a 0%, #2c7d4c 100%);
  --accent-glow: 0 6px 18px -6px rgba(63,174,107,.55), 0 0 0 1px rgba(95,212,138,.25);
  --glow-soft: 0 0 14px rgba(63,174,107,.35);
  --ease: cubic-bezier(.22,.61,.36,1);
  /* spacing scale */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 20px; --space-6: 24px;
  /* type scale */
  --fs-xs: 12px; --fs-sm: 13px; --fs-md: 14px; --fs-lg: 16px; --fs-xl: 22px; --fs-xxl: 26px;
  /* radius scale */
  --r-sm: 8px; --r-md: 10px; --r-lg: 12px;
  /* account-status hues - ONLY for account statuses (tiles, dots, status badges) */
  --acc-farming: #c9a227; --acc-ready: var(--accent); --acc-sold: #6aa0ff;
  --acc-banned: var(--danger);
  /* KPI hues (finance + team) - deliberately DISTINCT from every account hue,
     and each means exactly ONE thing */
  --kpi-money:   #23c2b8;  /* bright teal   - revenue / money in     */
  --kpi-expense: #4b8f8a;  /* muted teal    - expenses / money out   */
  --kpi-info:    #a98bff;  /* violet        - pending proofs / info  */
  --kpi-attn:    #ff7d3a;  /* hot orange    - trainee stuck / attn   (kept well clear of farming gold) */
  --pos: var(--accent-bright); --neg: var(--danger);  /* profit: green when up, red when down - never the teal of Revenue */
  /* legacy aliases kept so old references resolve to the account token, not a raw hex */
  --warn: var(--acc-farming); --info: var(--acc-sold);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
}
a { color: var(--accent); }
.center { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  width: 100%;
  max-width: 380px;
}
.card h1 { margin: 0 0 4px; font-size: 22px; }
.card .sub { color: var(--muted); margin: 0 0 20px; font-size: 14px; }
label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 6px; }
input {
  width: 100%;
  padding: 11px 12px;
  background: #0d130f;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--fg);
  font-size: 15px;
}
input:focus { outline: none; border-color: var(--accent-dim); }
button {
  width: 100%;
  margin-top: 20px;
  padding: 12px;
  background: var(--accent-gradient);
  color: #04140a;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px -3px rgba(63,174,107,.5);
  transition: transform .14s var(--ease), box-shadow .2s var(--ease), filter .2s var(--ease), border-color .2s var(--ease), background .2s var(--ease), color .2s var(--ease);
}
button:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: var(--accent-glow); }
button:active { transform: translateY(0) scale(.98); }
button.ghost { background: transparent; border: 1px solid var(--border); color: var(--muted); width: auto; padding: 8px 14px; margin: 0; }
button.ghost:hover { color: var(--fg); border-color: var(--accent-dim); }
.err { color: var(--danger); font-size: 13px; min-height: 18px; margin-top: 10px; }

.wrap { max-width: 900px; margin: 0 auto; padding: 24px 20px; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; gap: 12px; flex-wrap: wrap; }
.topbar .who { font-size: 14px; color: var(--muted); }
.topbar .who b { color: var(--fg); }
.nav-links { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nav-link {
  font-size: 14px; color: var(--muted); text-decoration: none;
  padding: 8px 14px; border: 1px solid var(--border); border-radius: 8px;
  transition: color .2s var(--ease), border-color .2s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease);
}
.nav-link:hover { color: var(--fg); border-color: var(--accent-dim); }
.nav-link.active { color: var(--accent-bright); border-color: var(--accent); background: #16241b; box-shadow: var(--glow-soft); }

/* Account menu: Change password / Log out live here, separate from primary nav */
.account-menu { position: relative; display: inline-block; }
.account-menu-btn { padding: 8px 12px; font-size: 18px; line-height: 1; letter-spacing: 1px; }
.account-menu-panel {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 20;
  display: flex; flex-direction: column; min-width: 180px;
  max-width: calc(100vw - 32px);
  background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.4); padding: 6px;
}
.account-menu-panel.hidden { display: none; }
.account-menu-item {
  display: block; width: 100%; text-align: left; background: transparent; border: none;
  color: var(--fg); font-size: 14px; padding: 9px 10px; border-radius: 6px; margin: 0; cursor: pointer;
}
.account-menu-item:hover { background: rgba(255,255,255,.06); }
.badge {
  display: inline-block; font-size: 11px; text-transform: uppercase; letter-spacing: .5px;
  padding: 2px 8px; border-radius: 20px; background: #16241b; border: 1px solid var(--border); color: var(--accent);
}
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin-bottom: 16px; }
.panel h2 { margin: 0 0 12px; font-size: 16px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; }
.muted { color: var(--muted); }

/* buttons inline */
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; }
.btn-sm { width: auto; margin: 0; padding: 7px 12px; font-size: 13px; }
.btn-line { background: transparent; border: 1px solid var(--border); color: var(--muted); }
.btn-line:hover { color: var(--fg); border-color: var(--accent-dim); background: transparent; }
.btn-danger { background: transparent; border: 1px solid #4a2620; color: var(--danger); }
.btn-danger:hover { background: #2a1512; color: var(--danger); }

/* ---- shared section header + layout utilities (used on every page) ---- */
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.panel-head > h2 { margin: 0; }

/* collapsible panels: <details class="panel"><summary class="panel-head">...</summary>...</details> */
summary.panel-head { cursor: pointer; user-select: none; list-style: none; margin-bottom: 0; }
summary.panel-head::-webkit-details-marker { display: none; }
details.panel[open] > summary.panel-head { margin-bottom: 14px; }
.ph-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ph-title > h2 { margin: 0; }
.chev { color: var(--muted); font-size: 12px; transition: transform .15s var(--ease); flex: none; }
details.panel[open] > summary.panel-head .chev { transform: rotate(180deg); }
.spread > h2 { margin: 0; }
.step > h3 { margin-top: 0; }
.scroll-x { overflow-x: auto; }
.w-auto { width: auto; }
.cat-grid { display: flex; gap: 20px; flex-wrap: wrap; }
.cat-col { flex: 1; min-width: 220px; }
.cat-h { margin: 0 0 6px; font-size: var(--fs-sm); color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.grow { flex: 1; min-width: 0; }
.mt { margin-top: 14px; }

/* left-aligned stat box (money panel) - same tokens as .tile */
.stat-box { flex: 1; min-width: 120px; padding: 14px; border: 1px solid var(--border); border-radius: var(--r-md); background: #0e140f; }
.stat-box .l { color: var(--muted); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .5px; }
.stat-box .n { font-size: var(--fs-xl); font-weight: 700; margin-top: 2px; }
/* finance stat-boxes: KPI hues, never account hues */
.stat-box.kpi-money .n { color: var(--kpi-money); }
.stat-box.kpi-expense .n { color: var(--kpi-expense); }
.stat-box.kpi-attn .n { color: var(--kpi-attn); }
.stat-box.pos .n { color: var(--pos); }
.stat-box.neg .n { color: var(--neg); }
/* profit box gets a matching edge so up/down is legible before you read the number */
.stat-box.pos { border-color: var(--accent-dim); }
.stat-box.neg { border-color: #4a2620; }
.warn-text { color: var(--warn); }
.ok-text { color: var(--accent); }

/* topic tabs: one section shown at a time. Underline style (not boxed
   buttons) - reads as "sub-view of this page", visually distinct from the
   boxed top nav (page-to-page navigation) one level above it. */
.tabs { display: flex; gap: 22px; flex-wrap: wrap; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.tab {
  width: auto; margin: 0; padding: 8px 2px 10px; background: transparent; color: var(--muted);
  border: none; border-bottom: 2px solid transparent; border-radius: 0; font-size: 14px; font-weight: 500;
  box-shadow: none; cursor: pointer;
}
.tab:hover { color: var(--fg); background: transparent; filter: none; transform: none; box-shadow: none; }
.tab.active { color: var(--accent-bright); border-bottom-color: var(--accent); background: transparent; box-shadow: none; font-weight: 700; }
.tab:active { transform: none; }

/* ---- one set of interactive states for buttons + fields (all pages) ---- */
button:disabled, button[disabled] { opacity: .5; cursor: not-allowed; filter: none; transform: none; box-shadow: none; }
button:focus-visible, .nav-link:focus-visible, a.btn-sm:focus-visible, .nav-tile:focus-visible {
  outline: 2px solid var(--accent-bright); outline-offset: 2px;
}
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: none; border-color: var(--accent-dim); box-shadow: 0 0 0 3px rgba(63,174,107,.18);
}
input:disabled, textarea:disabled, select:disabled { opacity: .6; cursor: not-allowed; }
input[type=file] { padding: 8px; }

textarea, select {
  width: 100%; padding: 11px 12px; background: #0d130f; border: 1px solid var(--border);
  border-radius: 8px; color: var(--fg); font-size: 14px; font-family: inherit;
}
textarea:focus, select:focus { outline: none; border-color: var(--accent-dim); }
textarea { resize: vertical; min-height: 80px; }

/* Rich-text editor for module descriptions - contenteditable + toolbar,
   so staff format with buttons instead of typing raw HTML tags. */
.rte-toolbar { display: flex; gap: 6px; margin-bottom: 6px; }
.rte-btn {
  width: auto; padding: 5px 10px; font-size: 13px; background: #0d130f;
  border: 1px solid var(--border); border-radius: 6px; color: var(--muted); cursor: pointer;
}
.rte-btn:hover { color: var(--fg); border-color: var(--accent-dim); }
.rte-editor {
  width: 100%; min-height: 110px; padding: 11px 12px; background: #0d130f;
  border: 1px solid var(--border); border-radius: 8px; color: var(--fg); font-size: 14px;
  line-height: 1.5; overflow-y: auto;
}
.rte-editor:focus { outline: none; border-color: var(--accent-dim); }
.rte-editor:empty::before { content: attr(data-placeholder); color: var(--muted); }
.rte-editor p { margin: 0 0 10px; }
.rte-editor p:last-child { margin-bottom: 0; }
.rte-editor ul, .rte-editor ol { margin: 0 0 10px 20px; padding: 0; }

/* module list rows */
.mod-row { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; background: #0e140f; }
.mod-row .ord { color: var(--muted); font-variant-numeric: tabular-nums; width: 22px; text-align: center; }
.mod-row .grow { flex: 1; min-width: 0; }
.mod-row .title { font-weight: 600; }
.mod-row .meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.pill { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 20px; border: 1px solid var(--border); color: var(--muted); margin-right: 4px; }
.pill.on { color: var(--accent); border-color: var(--accent-dim); }

/* editor */
.field { margin-bottom: 14px; }
.field > label { margin-top: 0; }
.q-card { border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin-bottom: 10px; background: #0e140f; }
.q-opt { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.q-opt input[type=text] { flex: 1; }
.q-opt input[type=radio] { width: auto; }
.hint { color: var(--muted); font-size: 12px; margin-top: 4px; }
.hidden { display: none !important; }
.ok-msg { color: var(--accent); font-size: 13px; min-height: 18px; }

/* onboarding map */
.progress-head { margin-bottom: 18px; }
.progress-bar { height: 8px; background: #16211a; border-radius: 20px; overflow: hidden; margin-top: 10px; }
.progress-bar > span { display: block; height: 100%; background: var(--accent); border-radius: 20px; transition: width .3s; }
.map-item {
  display: flex; align-items: center; gap: 14px; padding: 16px; border: 1px solid var(--border);
  border-radius: 12px; margin-bottom: 10px; background: #0e140f;
}
.map-item.locked { opacity: .5; }
.map-item.clickable { cursor: pointer; }
.map-item.clickable:hover { border-color: var(--accent-dim); }
.map-num {
  width: 34px; height: 34px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 700; background: #16211a; border: 1px solid var(--border); color: var(--muted);
}
.map-item.current .map-num { background: var(--accent); color: #04140a; border-color: var(--accent); }
.map-item.completed .map-num { background: var(--accent-dim); color: var(--fg); border-color: var(--accent-dim); }
.map-item .grow { flex: 1; min-width: 0; }
.map-item .title { font-weight: 600; }
.map-item .st { font-size: 12px; margin-top: 3px; }
.st.locked-t { color: var(--muted); }
.st.current-t { color: var(--accent); }
.st.completed-t { color: var(--accent-dim); }
.st.pending-t { color: var(--kpi-info); }
.st.rejected-t { color: var(--danger); }

/* module runner */
video { width: 100%; border-radius: 10px; background: #000; margin: 8px 0; }
.desc { line-height: 1.55; }
.desc :is(h1,h2,h3) { font-size: 17px; }
.quiz-q { border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin-bottom: 10px; background: #0e140f; }
.quiz-q .qtext { font-weight: 600; margin-bottom: 10px; }
.opt-btn {
  display: block; width: 100%; text-align: left; padding: 10px 12px; margin: 6px 0; background: #0d130f;
  border: 1px solid var(--border); border-radius: 8px; color: var(--fg); cursor: pointer; font-size: 14px;
}
.opt-btn:hover { border-color: var(--accent-dim); background: #0d130f; color: var(--fg); }
.opt-btn.sel { border-color: var(--accent); background: #16241b; color: var(--fg); }
.step { border-top: 1px solid var(--border); margin-top: 18px; padding-top: 18px; }
.badge.pend { color: var(--kpi-info); border-color: #3a3358; }
.result-line { font-size: 15px; font-weight: 600; margin: 10px 0; }
/* onboarding intro + proof upload */
.intro-panel { border-color: var(--accent-dim); }
.intro-panel h2 { color: var(--accent-bright); margin-bottom: 8px; }
.intro-panel p { margin: 0; line-height: 1.55; }
#proofFileWrap input[type=file] {
  width: 100%; padding: 10px 12px; background: #0d130f; border: 1px dashed var(--border);
  border-radius: 8px; color: var(--muted); font-size: 13px; cursor: pointer;
}
#proofFileWrap input[type=file]::file-selector-button {
  margin-right: 12px; padding: 7px 12px; border-radius: 6px; border: 1px solid var(--border);
  background: #16241b; color: var(--accent-bright); font-weight: 600; cursor: pointer; font-size: 13px;
}
#proofFileWrap input[type=file]::file-selector-button:hover { border-color: var(--accent-dim); }
.file-name { font-size: 13px; color: var(--accent); margin-top: 8px; }

/* review queue */
.review-card { border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin-bottom: 12px; background: #0e140f; }
.review-card .rc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.review-card .rc-who { font-weight: 600; }
.review-card .rc-mod { color: var(--muted); font-size: 13px; }
.review-card .rc-body { margin: 12px 0; }
.review-card img.proof { max-width: 320px; max-height: 240px; border-radius: 8px; border: 1px solid var(--border); display: block; }
.review-card .proof-text { background: #0d130f; border: 1px solid var(--border); border-radius: 8px; padding: 10px; white-space: pre-wrap; font-size: 14px; }
.review-card .rc-actions { display: flex; gap: 8px; }
.btn-approve { background: var(--accent); color: #04140a; }
.btn-approve:hover { background: var(--accent-dim); color: var(--fg); }

/* trainee dashboard rows */
.tr-row { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; background: #0e140f; }
.tr-row.stuck { border-color: #4a2620; }
.tr-row .grow { flex: 1; min-width: 0; }
.tr-row .mini-bar { height: 6px; background: #16211a; border-radius: 20px; overflow: hidden; margin-top: 6px; max-width: 220px; }
.tr-row .mini-bar > span { display: block; height: 100%; background: var(--accent); }
.badge.stuck-b { color: var(--danger); border-color: #4a2620; }
.badge.grad-b { color: var(--accent); border-color: var(--accent-dim); }
.count-tag { font-size: 12px; color: var(--muted); }
.count-tag b { color: var(--accent); }

/* plan feature checklist (client landing) */
.feature-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.feature-list li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; font-size: 13px; color: var(--fg); background: #0e140f; border: 1px solid var(--border); border-radius: 8px; }
.feature-list li::before { content: '\2713'; color: var(--accent); font-weight: 700; }
.feature-list li.locked { color: var(--muted); }
.feature-list li.locked::before { content: '\1F512'; }

/* help affordance: "?" dot + non-blocking popover */
.help-dot {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; margin-left: 6px; padding: 0;
  font-size: 11px; font-weight: 700; line-height: 1; vertical-align: middle;
  border-radius: 50%; border: 1px solid var(--border);
  background: #16241b; color: var(--muted); cursor: pointer; user-select: none;
  transition: color .15s var(--ease), border-color .15s var(--ease), background .15s var(--ease), box-shadow .15s var(--ease);
}
.help-dot:hover { color: var(--accent-bright); border-color: var(--accent-dim); background: #1c2f22; }
.help-dot:focus-visible { outline: none; color: var(--accent-bright); border-color: var(--accent-dim); box-shadow: 0 0 0 2px rgba(63,174,107,.4); }
/* pin the dot to the corner of tiles / stat-boxes so it never shifts the number */
.tile, .stat-box { position: relative; }
.tile > .help-dot, .stat-box > .help-dot { position: absolute; top: 6px; right: 6px; margin-left: 0; z-index: 2; }
.help-pop {
  position: fixed; z-index: 10001; width: min(280px, calc(100vw - 24px));
  background: var(--panel); border: 1px solid var(--accent-dim); border-radius: 10px;
  padding: 12px 14px; box-shadow: 0 12px 32px rgba(0,0,0,.5);
  animation: helpIn .14s var(--ease) both;
}
.help-pop-title { font-weight: 700; font-size: 13px; color: var(--accent-bright); margin-bottom: 5px; }
.help-pop-body { font-size: 13px; line-height: 1.5; color: var(--fg); }
@keyframes helpIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* change-password modal (nav.js) */
.pw-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center; z-index: 10002; padding: 16px;
}
.pw-modal-box { width: min(360px, 100%); margin: 0; }

/* toasts */
#toastWrap { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 9999; }
.toast {
  background: var(--panel); border: 1px solid var(--border); border-left: 3px solid var(--muted);
  color: var(--fg); padding: 12px 16px; border-radius: 8px; font-size: 14px; max-width: 340px;
  box-shadow: 0 8px 24px rgba(0,0,0,.4); opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s;
}
.toast.in { opacity: 1; transform: translateY(0); }
.toast.success { border-left-color: var(--accent); }
.toast.error { border-left-color: var(--danger); }
.toast.info { border-left-color: var(--accent-dim); }

/* inline reject form */
.reject-box { margin-top: 10px; }
.reject-box textarea { min-height: 60px; }

/* add-user form */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; align-items: end; }
.form-grid .field { margin-bottom: 0; }
.new-pass { font-family: 'JetBrains Mono', ui-monospace, monospace; color: var(--accent); }

/* stat tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
/* Trends panel: fixed 3-up / 2-up sub-rows so 5 tiles (or 3, for TL) always fill their row
   evenly - no tile ever wraps alone with empty space beside it. */
.tiles-split { display: flex; flex-direction: column; gap: 10px; }
.tiles-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tiles-row-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.tiles-row-3:empty, .tiles-row-2:empty { display: none; }
.tile { background: #0e140f; border: 1px solid var(--border); border-radius: 10px; padding: 14px; text-align: center; }
.tile .n { font-size: 26px; font-weight: 700; }
.tile .l { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-top: 2px; }
/* account-status tiles: account hues ONLY */
.tile.farming .n { color: var(--acc-farming); }
.tile.ready .n { color: var(--acc-ready); }
.tile.sold .n { color: var(--acc-sold); }
.tile.banned .n { color: var(--acc-banned); }
/* KPI tiles (finance + team): distinct hues, never an account hue */
.tile.kpi-money .n { color: var(--kpi-money); }
.tile.kpi-expense .n { color: var(--kpi-expense); }
.tile.kpi-info  .n { color: var(--kpi-info); }
.tile.kpi-attn  .n { color: var(--kpi-attn); }
.tile.kpi-neutral .n { color: var(--fg); }
.tile.pos .n { color: var(--pos); }
.tile.neg .n { color: var(--neg); }
a.tile { text-decoration: none; color: inherit; display: block; }
.tile.clickable { cursor: pointer; }
.tile.clickable:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 2px; }

/* cockpit */
.cockpit-alert {
  display: block; text-decoration: none; margin-bottom: 14px; padding: 12px 16px;
  border: 1px solid #33305a; border-left: 3px solid var(--kpi-info); border-radius: 8px;
  background: #16142a; color: #cfc6ee; font-size: 14px; font-weight: 600; cursor: pointer;
}
.cockpit-alert:hover { border-color: var(--kpi-info); }
.cockpit-alert b { color: var(--kpi-info); }
/* attention variant (orange) - trainees stuck, kept clear of the violet proof alert */
.cockpit-alert.attn { border-color: #4a331f; border-left-color: var(--kpi-attn); background: #241a12; color: #f0dccb; }
.cockpit-alert.attn:hover { border-color: var(--kpi-attn); }
.cockpit-alert.attn b { color: var(--kpi-attn); }
.nav-tile {
  display: inline-block; text-decoration: none; padding: 10px 16px;
  border: 1px solid var(--border); border-radius: 8px; background: #0e140f;
  color: var(--fg); font-size: 14px; font-weight: 600;
}
.nav-tile:hover { border-color: var(--accent-dim); background: #16241b; }

/* accounts table */
.acct-table { border-collapse: collapse; width: 100%; }
.acct-table thead th {
  background: rgba(63, 174, 107, .08);
  border-bottom: 2px solid var(--accent-dim);
  color: var(--fg);
  font-weight: 700;
  text-align: left;
}
.acct-table tbody tr:nth-child(even) { background: rgba(255, 255, 255, .02); }
.acct-table tbody tr:hover { background: rgba(63, 174, 107, .06); }
.acct-table select { padding: 5px 8px; font-size: 13px; width: auto; }
.acct-table td { vertical-align: middle; }
.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 13px; }
.st-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.st-farming { background: var(--acc-farming); } .st-ready { background: var(--acc-ready); }
.st-sold { background: var(--acc-sold); } .st-banned { background: var(--acc-banned); }
.cred-box { background: #0d130f; border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin-top: 8px; }
.cred-box .kv { display: flex; gap: 8px; margin: 3px 0; font-size: 13px; }
.cred-box .kv .k { color: var(--muted); min-width: 90px; }
.timeline { list-style: none; padding: 0; margin: 10px 0 0; }
.timeline li { font-size: 12px; color: var(--muted); padding: 3px 0; border-left: 2px solid var(--border); padding-left: 10px; }

/* working-sheet groups (My accounts, split by device) */
.sheet-group { margin-bottom: 18px; }
.sheet-head h3 { margin: 6px 0 6px; font-size: 14px; }
.sheet-group .acct-table th, .sheet-group .acct-table td { padding: 6px 8px; font-size: 12px; white-space: nowrap; }
.cred-cell { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.bb-bad { color: var(--danger); font-weight: 700; }

/* team roster picker */
.roster { display: flex; flex-wrap: wrap; gap: 8px; }
.roster-btn {
  width: auto; margin: 0; text-align: left; padding: 8px 12px; background: #0e140f;
  border: 1px solid var(--border); border-radius: 8px; color: var(--fg); cursor: pointer;
  box-shadow: none; display: flex; flex-direction: column; gap: 2px;
}
.roster-btn:hover { border-color: var(--accent-dim); background: #16241b; filter: none; transform: none; box-shadow: none; }
.roster-btn.active { border-color: var(--accent); background: #16241b; box-shadow: var(--glow-soft); }
.roster-btn .rn { font-weight: 600; font-size: 14px; }
.roster-btn .rc { font-size: 11px; color: var(--muted); }

/* ============================================================
   Momentum polish: transitions, glow, entrances, celebration
   ============================================================ */

/* smooth interactions on cards/rows/inputs */
.panel, .card, .tile, .map-item, .review-card, .tr-row, .mod-row, .nav-tile, .opt-btn, .cockpit-alert, input, textarea, select {
  transition: transform .16s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease), background .2s var(--ease);
}

/* hover lift ONLY on tiles that actually go somewhere (links or .clickable) -
   an inert stat tile must never look pressable */
a.tile:hover, .tile.clickable:hover { transform: translateY(-3px); border-color: var(--accent-dim); box-shadow: 0 10px 24px -12px rgba(63,174,107,.5); }
.nav-tile:hover { transform: translateY(-2px); box-shadow: var(--glow-soft); }
.review-card:hover, .mod-row:hover { border-color: var(--accent-dim); }
.opt-btn:hover { transform: translateX(2px); }
.opt-btn.sel { box-shadow: var(--glow-soft); }

/* primary/approve buttons share the accent gradient */
.btn-approve { background: var(--accent-gradient); }

/* progress bars: animated fill + subtle sheen */
.progress-bar > span, .mini-bar > span, .tr-row .mini-bar > span {
  transition: width .6s var(--ease);
  background: var(--accent-gradient);
}
.progress-bar { position: relative; }
.progress-bar > span::after {
  content: ''; position: absolute; inset: 0; border-radius: 20px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.28), transparent);
  transform: translateX(-100%); animation: sheen 2.4s var(--ease) infinite;
}
.progress-bar.burst > span { box-shadow: 0 0 16px rgba(95,212,138,.8); }
@keyframes sheen { 0% { transform: translateX(-100%); } 60%,100% { transform: translateX(100%); } }

/* KPI / stat tiles: staggered entrance (consistent across dashboard, accounts, operator) */
.tile { animation: tileIn .5s var(--ease) backwards; }
.tiles > .tile:nth-child(1) { animation-delay: .02s; }
.tiles > .tile:nth-child(2) { animation-delay: .07s; }
.tiles > .tile:nth-child(3) { animation-delay: .12s; }
.tiles > .tile:nth-child(4) { animation-delay: .17s; }
.tiles > .tile:nth-child(5) { animation-delay: .22s; }
.tiles > .tile:nth-child(6) { animation-delay: .27s; }
.tiles > .tile:nth-child(7) { animation-delay: .32s; }
.tiles > .tile:nth-child(8) { animation-delay: .37s; }
.tiles > .tile:nth-child(9) { animation-delay: .42s; }
.tiles > .tile:nth-child(n+10) { animation-delay: .47s; }
.tile .n { display: inline-block; transition: transform .2s var(--ease); }
.streak-flame { display: inline-block; margin-right: 4px; font-size: 20px; vertical-align: -1px; }
a.tile:hover .n, .tile.clickable:hover .n { transform: scale(1.06); }
@keyframes tileIn {
  0% { opacity: 0; transform: translateY(10px) scale(.96); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* trainee map: current module pulses/glows */
.map-item.current {
  border-color: var(--accent);
  box-shadow: var(--glow-soft);
  animation: currentPulse 2.2s ease-in-out infinite;
}
.map-item.current .map-num { background: var(--accent-gradient); border-color: var(--accent); color: #04140a; }
@keyframes currentPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(63,174,107,.0), var(--glow-soft); }
  50%     { box-shadow: 0 0 0 4px rgba(63,174,107,.12), 0 0 20px rgba(63,174,107,.5); }
}

/* trainee map: completed modules get a satisfying checked pop */
.map-item.completed { border-color: rgba(63,174,107,.35); }
.map-item.completed .map-num {
  background: var(--accent-gradient); color: #04140a; border-color: var(--accent);
  box-shadow: var(--glow-soft); font-size: 18px;
  animation: checkPop .45s var(--ease) both;
}
@keyframes checkPop {
  0%   { transform: scale(.4); opacity: 0; }
  60%  { transform: scale(1.18); opacity: 1; }
  100% { transform: scale(1); }
}

/* graduation banner glow-in */
#gradPanel:not(.hidden) { animation: gradIn .6s var(--ease) both; border-color: var(--accent); box-shadow: var(--glow-soft); }
@keyframes gradIn { 0% { opacity: 0; transform: translateY(12px) scale(.98); } 100% { opacity: 1; transform: none; } }

/* confetti celebration layer (self-contained, non-blocking) */
.confetti-layer { position: fixed; inset: 0; pointer-events: none; z-index: 10000; overflow: hidden; }
.confetti-piece {
  position: absolute; top: -24px; width: 10px; height: 14px; border-radius: 2px;
  will-change: transform, opacity; opacity: 0;
  animation: confetti-fall linear forwards;
}
@keyframes confetti-fall {
  0%   { opacity: 1; transform: translate3d(0, -24px, 0) rotate(0deg); }
  100% { opacity: .95; transform: translate3d(calc(var(--x) * 42vw), 106vh, 0) rotate(var(--r)); }
}

/* result line pop on module complete */
.result-line.pop { animation: linePop .5s var(--ease) both; }
@keyframes linePop { 0% { transform: scale(.7); opacity: 0; } 60% { transform: scale(1.12); } 100% { transform: scale(1); opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::after, *::before { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .confetti-layer { display: none; }
}

/* Checker metric-param picker (accounts page) */
.param-picker { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 13px; border-radius: 8px; padding: 6px 10px; border: 1px solid transparent; }
.param-picker .pp-label { color: var(--muted); }
.param-picker .pp-item { display: inline-flex; align-items: center; gap: 4px; margin: 0; color: var(--fg); cursor: pointer; user-select: none; font-size: 13px; }
.param-picker .pp-item input {
  appearance: none; -webkit-appearance: none;
  width: 16px; height: 16px; margin: 0; flex: none;
  border: 1.5px solid var(--muted); border-radius: 4px;
  background: var(--panel);
  cursor: pointer; position: relative;
}
.param-picker .pp-item input:checked { background: var(--accent); border-color: var(--accent); }
.param-picker .pp-item input:checked::after {
  content: ""; position: absolute; left: 4px; top: 1px;
  width: 4px; height: 8px; border: solid var(--panel);
  border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.param-picker .pp-item input:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 1px; }

/* Distinguish "check fields" (checker params) from "columns" (table display) - same base layout, different accent + icon */
.param-picker.field-picker { background: rgba(63, 174, 107, .10); border-color: var(--accent-dim); }
.param-picker.field-picker .pp-label { color: var(--accent-bright); font-weight: 600; }
.param-picker.field-picker .pp-label::before { content: "\1F50D"; margin-right: 5px; }
.param-picker.column-picker { background: rgba(138, 160, 147, .10); border-color: var(--muted); margin-top: 2px; }
.param-picker.column-picker .pp-label { color: var(--muted); font-weight: 600; }
.param-picker.column-picker .pp-label::before { content: "\25A6"; margin-right: 5px; }
