/* Coach console brand layer. Loaded last by coach-console.html.
   Aligns the console with usesnapmind.com: Plus Jakarta headings with tight
   tracking, 12 to 16px radii on panels, cards, buttons and fields, pill
   tags, and the lime accent used only for action. It changes appearance
   only; no layout box or element id is touched, so every handler keeps
   working. Colors stay on the console's own tokens so light mode follows. */

:root {
  --cb-r-sm: 8px;
  --cb-r-md: 12px;
  --cb-r-lg: 16px;
  --cb-ease: cubic-bezier(0.2, 0, 0, 1);
}

/* ── Type ─────────────────────────────────────────────────── */
h1, h2, h3 { letter-spacing:0; font-weight:600; line-height: 1.12; }
h1 { font-size: clamp(28px, 3vw, 36px); }
h2 { font-size: clamp(21px, 2vw, 25px); }
h3 { font-size: 17px; letter-spacing:0; font-weight:600; }
h4 { font-size: 12px; letter-spacing:0; text-transform:none; font-weight:600; color: var(--muted); }
.ph h2 { letter-spacing:0; }

/* ── Surfaces ─────────────────────────────────────────────── */
.panel { border-radius: var(--cb-r-lg); border-color: var(--line); }
.modal, .drawer, .auth-box, .ev-card, .stat, .cmd-stat, .cmd-focal, .bc-item, .conv-item, .msg-shell, .msg-pane, .link-box { border-radius: var(--cb-r-lg); }
.drawer { border-radius: var(--cb-r-lg) 0 0 var(--cb-r-lg); }
.modal { overflow: hidden; }
.menu-pop, #more-menu, #notif-panel { border-radius: var(--cb-r-md); overflow: hidden; }
.msg { border-radius: 14px; }
.toast { border-radius: var(--cb-r-md); }
table { border-collapse: separate; border-spacing: 0; }

/* ── Controls ─────────────────────────────────────────────── */
button {
  border-radius: 10px;
  min-height: 38px;
  transition: background-color 150ms var(--cb-ease), border-color 150ms var(--cb-ease), color 150ms var(--cb-ease);
}
button.ghost { min-height: 0; border-radius: 8px; }
button.primary { font-weight:600; }
.tab, .menu-item, .more-item, .chip, input[type=checkbox], input[type=radio] { min-height: 0; }
.menu-pop button.menu-item, #more-menu .more-item { border-radius: 0; }
input, select, textarea { border-radius: 10px; border-color: var(--line2); }
#team-select { border-radius: 10px !important; }
button:focus-visible, a:focus-visible, .tab:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* ── Tags, pills and counts ───────────────────────────────── */
.pill, .chip, .home-tag, .cmd-state { border-radius: 999px; letter-spacing:0; }
.home-count {
  border-radius: 10px; border: 0;
  background: color-mix(in srgb, var(--c-attn, var(--warn)) 16%, transparent);
  min-width: 36px; padding: 6px 8px;
}
.home-count.risk { background: color-mix(in srgb, var(--c-risk, var(--danger)) 16%, transparent); }

/* ── Top bar ──────────────────────────────────────────────── */
.topbar { padding: 10px 20px; gap: 10px; }
.brand { font-weight:600; letter-spacing:0; }
#user-chip:empty { display: none; }
.acct-btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line2); border-radius: 999px; padding: 4px 12px 4px 4px; min-height: 36px;
  color: var(--text); font-weight: 600; font-size: 13px;
}
.acct-btn:hover { border-color: var(--accent); color: var(--text); }
.acct-av {
  width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: #0a0a0a; font-weight:600; font-size: 12px;
}
.acct-menu { right: 0; left: auto; min-width: 260px; }
.acct-menu .acct-who { padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.acct-menu .acct-who b { display: block; color: var(--text); font-size: 13px; margin-bottom: 2px; }
.acct-menu button.menu-item { min-height: 0; }
.acct-menu .acct-danger { color: var(--muted); }

/* ── Tabs ─────────────────────────────────────────────────── */
.tab { font-weight: 600; }
.tab.active { font-weight:600; }

/* ── Notices ──────────────────────────────────────────────── */
#mfa-banner-slot > *, .mfa-banner, .banner { border-radius: var(--cb-r-lg); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ── Specific console pieces ──────────────────────────────── */
#team-select { width: auto !important; max-width: 260px; }
#role-badge { border-radius: 999px !important; }
.unread { border-radius: 999px; padding: 1px 8px; font-weight:600; }
.snapmfa-banner { border-radius: var(--cb-r-lg) !important; }
#ov-cover-name { letter-spacing:0 !important; font-weight:600; }
#ov-cover-banner { border-radius: var(--cb-r-lg); }
#ov-cover-logo { border-radius: 10px; }
/* Event type stays on the colored dot; the card outline stays quiet. */
.ev-card { border-color: var(--line) !important; border-radius: var(--cb-r-md) !important; }
.ev-card:hover { border-color: var(--line2) !important; background: var(--panel); }
.snapmfa-banner-later {
  background: transparent !important; border: 1px solid var(--line2) !important; color: var(--muted) !important;
  text-decoration: none !important; padding: 8px 14px !important; border-radius: 10px !important;
}
.snapmfa-banner-later:hover { border-color: var(--accent) !important; color: var(--text) !important; }
/* Phones: the bar wraps; the team picker takes its own row. */
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; row-gap: 8px; padding: 10px 14px; }
  .topbar .spacer { display: none; }
  .brand { flex: 1 1 auto; min-width: 0; }
  .brand .brand-sub { display: none; }
  #team-create-btn, #role-badge { display: none !important; }
  #acct-label { display: none; }
  .acct-btn { padding: 4px; }
  #team-select { order: 10; flex: 1 1 100%; max-width: none; width: 100% !important; }
  .topbar { position: relative; }
  .tabnav { top: 0; }
}

/* Command Center is the program's main view: it sits right after Home and
   reads stronger than the other tabs even when it is not the one open. */
.tab.tab-cc { display: inline-flex; align-items: center; gap: 7px; color: var(--text); font-weight:600; }
.tab.tab-cc svg { color: var(--accent); flex: none; }
.tab.tab-cc.active { color: var(--accent); }

/* ── Shared system (css/system.css), 2026-10 rollout ──────────
   The console's own tokens now point at the system surfaces in both
   themes, so the page is the neutral base, panels are the working
   surface with a faint edge, and overlays sit highest. */
:root, :root[data-theme="light"] {
  --bg: var(--black);
  --panel: var(--dark);
  --panel2: var(--raised);
  --line: var(--border);
  --line2: var(--border-strong);
  --text: var(--white);
  --muted: var(--gray);
  --dim: var(--muted-dark);
}
.panel { border-color: var(--edge); }
.stat, .cmd-stat { border-color: var(--edge); }
h1 { font-size: 28px; line-height: 34px; }
h2 { font-size: 22px; line-height: 28px; }
h3 { font-size: 18px; line-height: 24px; }
h4 { font-size: 13px; line-height: 18px; }
.tab { color: var(--muted); }
.tab:hover { color: var(--text); }

/* Buttons: filled brand primary, filled neutral secondary, quiet ghost. */
button { background: var(--raised); border-color: transparent; color: var(--text); font-weight: 500; font-size: 14px; }
button:hover { background: var(--border-strong); border-color: transparent; color: var(--text); }
button.primary { background: var(--accent); border-color: transparent; color: var(--on-accent, #0A0A0A); font-weight: 600; }
button.primary:hover { background: var(--accent); filter: brightness(0.94); color: var(--on-accent, #0A0A0A); }
button.danger { background: var(--raised); border-color: transparent; color: var(--danger); }
button.danger:hover { background: var(--danger); color: #fff; }
button.ghost, button.close, button.pill { background: transparent; }
button.ghost:hover, button.close:hover { background: var(--raised); color: var(--text); }
button:disabled, button.primary:disabled { background: var(--raised); color: var(--muted-dark); opacity: 1; filter: none; }
.menu-pop button.menu-item, #more-menu .more-item, button.tab, .acct-btn { background: transparent; }
.menu-pop button.menu-item:hover { background: var(--raised); color: var(--text); }
.acct-btn:hover { background: var(--raised); border-color: var(--line2); }
.acct-av { color: var(--on-accent, #0A0A0A); }
input, select, textarea { background: var(--sunken); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

/* Overlays: elevated surface, strongest shadow, scrim behind. */
.modal-bg, .drawer-bg { background: var(--scrim, rgba(0,0,0,.66)); }
.modal, .drawer, .menu-pop, #notif-panel { background: var(--elevated); border-color: var(--edge); box-shadow: var(--shadow-2); }
#more-menu { background: var(--elevated); border: 1px solid var(--edge); box-shadow: var(--shadow-2); }
#more-menu .more-head { color: var(--muted); font-size: 13px; }
#more-menu .more-item { background: var(--raised); border-color: transparent; border-radius: 10px !important; }
#more-menu .more-item:hover { background: var(--border-strong); color: var(--text); border-color: transparent; }
.toast { background: var(--elevated); border: 1px solid var(--edge); color: var(--text); box-shadow: var(--shadow-2); font-size: 14px; }
.toast.err { border-color: var(--edge); border-left-color: var(--c-risk, var(--danger)); color: var(--text); }

/* States: empty and load errors. */
.empty { font-size: 16px; line-height: 24px; }
.empty h3 { font-size: 18px; }
.state-err { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 28px 16px; color: var(--muted); font-size: 16px; }
/* Team color used as text on a light page is darkened so it stays readable;
   as a fill (primary buttons) it keeps the team's exact color. */
:root[data-theme="light"] .brand span:not(.brand-sub),
:root[data-theme="light"] .tab.active,
:root[data-theme="light"] .tab.tab-cc.active { color: color-mix(in srgb, var(--accent) 50%, #0A0A0A); }
:root[data-theme="light"] .tab.active { border-bottom-color: var(--accent); }

/* Team color used as text: coach-console.html computes a readable version of
   the team color for each theme (setAccentText), so a navy or maroon team
   name or tab stays legible on the dark surface. */
:root { --accent-text: var(--accent-text-dark, var(--accent)); }
:root[data-theme="light"] { --accent-text: var(--accent-text-light, var(--accent)); }
.tab.tab-cc svg, .tab.tab-cc.active { color: var(--accent-text, var(--accent)); }
