/* ===========================================================================
   Gold Reviews — Consolidated Dashboard App
   Brand: Gold #d4af37 + Navy #1e293b, Inter font, white cards
   Self-contained static SPA. No build step, no external dependencies.
   =========================================================================== */

/* ===========================================================================
   DESIGN TOKENS — the single source of truth for the app's look & feel.
   To re-theme the entire app, edit ONLY this block. Every colour, font, radius
   and shadow used anywhere in styles.css and app.js routes through these vars
   (pure status tints — green "good" / red "bad" badges — stay literal on
   purpose; they shouldn't change with a brand reskin). Self-contained pages
   (quicksend.html, approve.html, widget.js) carry their own copy of the brand
   colours by design and are themed separately.
   =========================================================================== */
:root {
  /* — Brand — */
  --gold: #d4af37;            /* primary brand gold */
  --gold-mid: #c9a227;        /* gradient mid-stop */
  --gold-deep: #b8860b;       /* links, hovers */
  --gold-darkest: #92700a;    /* gradient start */
  --gold-grad: linear-gradient(135deg, var(--gold-darkest) 0%, var(--gold-mid) 50%, var(--gold) 100%);
  --gold-soft: #fffbeb;       /* faint gold tint background */
  --gold-border: #fde68a;     /* gold tint border */
  --navy: #1e293b;            /* primary dark / headings */
  --navy-2: #0f172a;          /* deepest dark (sidebar) */

  /* — Neutrals (slate scale) — */
  --bg: #f1f5f9;              /* page background */
  --surface: #f8fafc;         /* subtle panel / inset background */
  --card: #ffffff;            /* card surface */
  --line: #e2e8f0;            /* borders / dividers */
  --ink: #1e293b;             /* strongest body text (= navy) */
  --text: #334155;            /* standard body text */
  --text-soft: #475569;       /* secondary body text */
  --muted: #64748b;           /* muted labels */
  --faint: #94a3b8;           /* faint / timestamps */
  --on-dark: #cbd5e1;         /* text on the dark sidebar */

  /* — Semantic accents — */
  --green: #16a34a;
  --amber: #d97706;
  --red: #dc2626;
  --blue: #3b82f6;
  --orange: #f97316;

  /* — Shape & type — */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 30px rgba(15, 23, 42, 0.12);
}

/* ===========================================================================
   DARK THEME — navy + gold, same brand, same layout. Activated by
   <html data-theme="dark">. Because the whole app routes through the tokens
   above, dark mode is almost entirely a token re-map. The handful of elements
   that used --navy as a *surface* (avatar, navy button, navy badge, toast) get
   targeted overrides below so they stay legible when --navy flips to light text.
   =========================================================================== */
html[data-theme="dark"] {
  /* === TWO-NAVY SYSTEM ===========================================
     The whole dark UI is built from just two solid navies:
        Navy-1  #0b1322  → page background            (--bg)
        Navy-2  #0f1a2f  → EVERY panel: sidebar/nav, cards, topbar,
                           menus, inputs               (--card, --navy-2)
     Anything that used to be a third/fourth blue (insets, feed rows,
     nav buttons, grey badges, borders) is now a translucent WHITE
     overlay sitting on top of those two navies — so it reads as the
     same navy, lifted, not a new colour. Separation between bg and
     panels comes from shadow + a hairline border (Troy's note:
     "maintain contrast, maybe using better shadowing effects").
     To retune the whole theme, edit just the two hexes below. */
  --bg: #0b1322;            /* Navy-1 — page background */
  --navy-2: #0f1a2f;        /* Navy-2 — sidebar / nav */
  --card: #0f1a2f;          /* Navy-2 — all panels & cards */
  --surface: rgba(255,255,255,0.05);    /* inset lift (same navy, brighter) */
  --line: rgba(148,163,184,0.16);       /* hairline border — not a fill */
  --ink: #f1f5f9;           /* strongest text */
  --text: #d3dceb;          /* standard body text */
  --text-soft: #aab8cc;     /* secondary text */
  --muted: #8f9fb6;         /* muted labels */
  --faint: #74859d;         /* faint / timestamps */
  /* --navy flips to light so every heading/value that used it stays readable */
  --navy: #f1f5f9;
  /* Gold reads brighter on dark; links/hovers need lift */
  --gold-deep: #e4c45a;
  --gold-soft: rgba(212, 175, 55, 0.10);   /* callout / nudge tint */
  --gold-border: rgba(212, 175, 55, 0.32);
  /* Brighter semantic accents for contrast on dark */
  --green: #34d399;
  --amber: #fbbf24;
  --red: #f87171;
  --blue: #60a5fa;
  --orange: #fb923c;
  /* Beefier shadows do the elevation work now that panel↔bg is subtle */
  --shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.62);
}

/* Cards/metrics lift off the near-same-navy bg via shadow, not fill */
html[data-theme="dark"] .card,
html[data-theme="dark"] .metric { box-shadow: 0 6px 22px rgba(0,0,0,0.42); }

/* Former --navy *surfaces* → translucent overlays (stay in the 2-navy family) */
html[data-theme="dark"] .avatar-circle { background: var(--gold-grad); color: var(--navy-2); }
html[data-theme="dark"] .btn-navy { background: rgba(255,255,255,0.08); color: #fff; }
html[data-theme="dark"] .btn-navy:hover { background: rgba(255,255,255,0.14); }
html[data-theme="dark"] .badge.navy { background: rgba(255,255,255,0.10); color: #eaf0f8; }
html[data-theme="dark"] .badge.grey { background: rgba(255,255,255,0.07); color: var(--text-soft); }
html[data-theme="dark"] .toast { background: #16233c; color: #fff; }
/* Punchier status tints on dark */
html[data-theme="dark"] .badge.gold { background: rgba(212,175,55,0.18); }
html[data-theme="dark"] .badge.green { background: rgba(52,211,153,0.16); }
html[data-theme="dark"] .badge.blue { background: rgba(96,165,250,0.16); }
html[data-theme="dark"] .badge.orange { background: rgba(251,146,60,0.16); }
html[data-theme="dark"] .badge.red { background: rgba(248,113,113,0.16); }
/* Tooltip bubble was invisible on dark (used --navy, which flips to light).
   Give it a readable popover navy + light text. */
html[data-theme="dark"] .gr-tip-bubble { background: #243450; color: #f1f5f9; }
html[data-theme="dark"] .gr-tip-bubble::after { border-top-color: #243450; }
html[data-theme="dark"] .gr-tip-bubble.below::after { border-top-color: transparent; border-bottom-color: #243450; }
html[data-theme="dark"] .gr-tip:hover,
html[data-theme="dark"] .gr-tip.open { background: #243450; color: #fff; border-color: #3a4d72; }
/* Inputs/selects: lift placeholder + caret legibility */
html[data-theme="dark"] ::placeholder { color: var(--faint); opacity: 1; }
html[data-theme="dark"] input, html[data-theme="dark"] select, html[data-theme="dark"] textarea { color-scheme: dark; }

/* ===== Floating theme toggle (preview affordance) ===== */
.theme-toggle {
  position: fixed; bottom: 18px; right: 18px; z-index: 500;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  font-family: var(--font); font-size: 12.5px; font-weight: 700;
  box-shadow: var(--shadow-lg); user-select: none; transition: all 0.15s;
}
.theme-toggle:hover { border-color: var(--gold); color: var(--gold-deep); }
.theme-toggle .tt-ico { font-size: 15px; }

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }

/* ===== App shell ===== */
.app { display: flex; min-height: 100vh; }

/* ---- Sidebar ---- */
.sidebar {
  width: 248px;
  flex-shrink: 0;
  background: var(--navy-2);
  color: var(--on-dark);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 64px;               /* match the topbar so the divider lines up */
  padding: 0 14px 0 20px;
  border-bottom: 1px solid var(--line);
}
.brand-id { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.brand-logo { height: 26px; width: auto; max-width: 100%; display: block; }
.brand-name { font-weight: 700; color: #fff; font-size: 16px; letter-spacing: -0.2px; }
/* indent so "Reputation engine" R sits under the "G" of Gold (past the star) */
.brand-sub { font-size: 11px; color: var(--muted); padding-left: 28px; }

.nav { padding: 12px 12px; overflow-y: auto; flex: 1; }
.nav-section-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--text-soft); font-weight: 700; padding: 14px 12px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: 9px;
  color: var(--on-dark); font-weight: 500; font-size: 13.5px;
  cursor: pointer; transition: background 0.12s, color 0.12s;
  margin-bottom: 2px; user-select: none;
}
.nav-item:hover { background: rgba(255,255,255,0.05); color: #fff; }
.nav-item.active { background: rgba(212,175,55,0.14); color: var(--gold); }
.nav-item.active .nav-ico { opacity: 1; }
.nav-ico { width: 18px; text-align: center; opacity: 0.8; font-size: 15px; }
.nav-badge {
  margin-left: auto; background: var(--gold); color: var(--navy-2);
  font-size: 11px; font-weight: 700; border-radius: 10px;
  min-width: 19px; text-align: center; padding: 1px 6px;
}
.nav-badge.alert { background: var(--red); color: #fff; }

.sidebar-foot {
  padding: 14px 18px; border-top: 1px solid rgba(255,255,255,0.07);
  font-size: 11.5px; color: var(--muted);
}
.sidebar-foot a { color: var(--gold); }

/* ---- Main column ---- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 64px; background: var(--card); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 16px;
  padding: 0 28px; position: sticky; top: 0; z-index: 20;
}
.topbar-title { font-size: 17px; font-weight: 700; color: var(--navy); }
.topbar-spacer { flex: 1; }
.topbar-pill {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 6px 5px 14px; font-size: 13px;
}
.topbar-pill .biz { font-weight: 600; color: var(--navy); }
.topbar-pill .tier {
  font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px;
  background: var(--gold-grad); color: var(--navy-2);
}
.avatar-circle {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; aspect-ratio: 1;
  background: var(--navy); color: #fff; font-weight: 700; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
}

.content { padding: 28px; max-width: 1180px; width: 100%; margin: 0 auto; }

.page-head { margin-bottom: 22px; }
.page-head h1 { font-size: 22px; font-weight: 700; color: var(--navy); letter-spacing: -0.4px; }
.page-head p { color: var(--muted); margin-top: 4px; font-size: 13.5px; max-width: 640px; }

/* ===== Generic card ===== */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.card-pad { padding: 20px 22px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 22px; border-bottom: 1px solid var(--line);
}
.card-title { font-size: 14.5px; font-weight: 700; color: var(--navy); display: flex; align-items: center; gap: 8px; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px; border-radius: 9px; font-size: 13px; font-weight: 600;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  transition: all 0.13s;
}
.btn { text-decoration: none; }
.btn:hover { background: var(--bg); border-color: var(--gold); color: var(--navy); text-decoration: none; }
.btn-gold { background: var(--gold-grad); border: none; color: #fff; box-shadow: 0 1px 2px rgba(146,112,10,0.3); }
/* Keep the gold fill on hover (don't let .btn:hover flatten it to a solid bg) */
.btn-gold:hover { background: var(--gold-grad); filter: brightness(1.05); color: #fff; border: none; }
.btn-navy { background: var(--navy); border: none; color: #fff; }
.btn-navy:hover { background: var(--navy-2); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--line); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; }

/* ===== Metric cards ===== */
.metrics { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 18px; }
.metric {
  background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--gold);
  border-radius: var(--radius); padding: 18px 16px; text-align: center; box-shadow: var(--shadow);
}
.metric-value { font-size: 26px; font-weight: 700; color: var(--navy); line-height: 1.1; }
.metric-value.gold { color: var(--gold-deep); }
.metric-value.green { color: var(--green); }
.metric-value.amber { color: var(--amber); }
.metric-value.red { color: var(--red); }
.metric-value .star { color: var(--gold); font-size: 19px; }
.metric-label { font-size: 11px; color: var(--faint); font-weight: 600; margin-top: 5px; text-transform: uppercase; letter-spacing: 0.4px; }

/* ===== Badges ===== */
.badge { font-size: 11px; font-weight: 600; padding: 3px 11px; border-radius: 999px; white-space: nowrap; display: inline-block; }
.badge.gold { background: rgba(212,175,55,0.14); color: var(--gold-deep); }
.badge.green { background: rgba(22,163,74,0.12); color: var(--green); }
.badge.blue { background: rgba(59,130,246,0.12); color: var(--blue); }
.badge.orange { background: rgba(249,115,22,0.13); color: var(--orange); }
.badge.red { background: rgba(220,38,38,0.1); color: var(--red); }
.badge.grey { background: var(--bg); color: var(--muted); }
.badge.navy { background: var(--navy); color: #fff; }

/* ===== Feed items ===== */
.item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; background: var(--surface); border-radius: 10px; margin-bottom: 8px; gap: 12px;
}
.item:last-child { margin-bottom: 0; }
.item-left { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.avatar {
  width: 38px; height: 38px; border-radius: 9px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700;
}
.avatar.gold { background: rgba(212,175,55,0.14); color: var(--gold-deep); }
.avatar.green { background: rgba(22,163,74,0.12); color: var(--green); }
.avatar.blue { background: rgba(59,130,246,0.12); color: var(--blue); }
.avatar.orange { background: rgba(249,115,22,0.13); color: var(--orange); }
.avatar.red { background: rgba(220,38,38,0.1); color: var(--red); }
.item-name { font-size: 13.5px; font-weight: 600; color: var(--navy); }
.item-name .stars { color: var(--gold); font-size: 12.5px; letter-spacing: 1px; }
.item-detail { font-size: 12px; color: var(--muted); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; }
.stars-lg { color: var(--gold); letter-spacing: 2px; font-size: 15px; }
.stars-empty { color: var(--on-dark); }

/* ===== Grids ===== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.mb16 { margin-bottom: 16px; }
.mb18 { margin-bottom: 18px; }

/* ===== Action centre ===== */
.action-row { display: flex; gap: 10px; flex-wrap: wrap; }
.action-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 16px; border-radius: 9px; font-size: 13px; font-weight: 600;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); transition: all 0.13s;
}
.action-btn:hover { border-color: var(--gold); color: var(--navy); text-decoration: none; }
.action-btn .count { background: var(--gold); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 10px; }
.all-clear {
  display: flex; align-items: center; gap: 12px; padding: 16px;
  background: #f0fdf4; border-radius: 10px; color: #15803d; font-weight: 500;
}

/* ===== Filter tabs ===== */
.tabs { display: inline-flex; gap: 8px; background: transparent; padding: 0; border-radius: 10px; margin-bottom: 18px; }
.tab {
  padding: 7px 15px; border-radius: 8px; font-size: 13px; font-weight: 600;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  transition: all 0.13s; cursor: pointer;
}
.tab:hover { border-color: var(--gold); color: var(--text); }
.tab.active { background: var(--card); color: var(--navy); border-color: var(--gold); box-shadow: var(--shadow); }
.tab .tab-count { color: var(--faint); font-weight: 600; margin-left: 4px; }
.tab.active .tab-count { color: var(--gold-deep); }

/* ===== Empty state ===== */
.empty { text-align: center; padding: 48px 20px; color: var(--faint); }
.empty-ico { font-size: 36px; margin-bottom: 12px; }
.empty h3 { color: var(--muted); font-weight: 600; font-size: 15px; margin-bottom: 6px; }

/* ===== AI Draft card ===== */
.adr-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 14px; box-shadow: var(--shadow); }
.adr-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.adr-reviewer { font-weight: 700; color: var(--navy); font-size: 15px; }
.adr-date { font-size: 12px; color: var(--faint); }
.adr-review { background: var(--surface); border-radius: 9px; padding: 12px 14px; font-size: 13.5px; color: var(--text-soft); margin-bottom: 12px; font-style: italic; }
.adr-draft { border: 1px dashed var(--gold); background: rgba(212,175,55,0.05); border-radius: 9px; padding: 14px; margin-bottom: 14px; }
.adr-draft-label { font-size: 11px; font-weight: 700; color: var(--gold-deep); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.adr-draft-text { font-size: 13.5px; color: var(--ink); line-height: 1.55; }
.adr-draft-text[contenteditable="true"] { outline: 2px solid var(--gold); border-radius: 6px; padding: 6px; background: var(--card); }
.adr-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ===== Funnel ===== */
.funnel { display: flex; flex-direction: column; gap: 10px; }
.funnel-stage { display: flex; align-items: center; gap: 14px; }
.funnel-bar-wrap { flex: 1; background: var(--bg); border-radius: 8px; height: 42px; overflow: hidden; position: relative; }
.funnel-bar { height: 100%; border-radius: 8px; display: flex; align-items: center; padding: 0 14px; color: #fff; font-weight: 700; font-size: 14px; min-width: 60px; transition: width 0.6s ease; }
.funnel-label { width: 150px; font-size: 13px; font-weight: 600; color: var(--navy); flex-shrink: 0; }
.funnel-pct { width: 70px; text-align: right; font-size: 13px; font-weight: 700; color: var(--muted); flex-shrink: 0; }

/* ===== Table ===== */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--faint); font-weight: 700; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 13px 14px; border-bottom: 1px solid var(--bg); font-size: 13.5px; color: var(--ink); }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: var(--surface); }

/* ===== Trust gauge ===== */
.gauge { width: 180px; height: 180px; position: relative; margin: 0 auto; }
.gauge svg { width: 180px; height: 180px; transform: rotate(-90deg); }
.gauge .track { fill: none; stroke: var(--bg); stroke-width: 14; }
.gauge .fill { fill: none; stroke: var(--gold); stroke-width: 14; stroke-linecap: round; transition: stroke-dashoffset 1s ease; }
.gauge-center { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); text-align: center; }
.gauge-num { font-size: 46px; font-weight: 800; color: var(--navy); line-height: 1; }
.gauge-of { font-size: 13px; color: var(--faint); }

.factor { margin-bottom: 14px; }
.factor-top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; }
.factor-name { font-weight: 600; color: var(--navy); }
.factor-val { color: var(--muted); font-weight: 600; }
.factor-bar { background: var(--bg); border-radius: 6px; height: 8px; overflow: hidden; }
.factor-fill { height: 100%; background: var(--gold); border-radius: 6px; }

.tier-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 9px; margin-bottom: 6px; }
.tier-row.current { background: rgba(212,175,55,0.1); border: 1px solid var(--gold); }
.tier-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.tier-name { font-weight: 600; color: var(--navy); flex: 1; }
.tier-range { color: var(--faint); font-size: 12px; }

.streak-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: var(--amber); background: var(--gold-soft); padding: 4px 12px; border-radius: 999px; }
.shield-box { display: flex; gap: 12px; align-items: center; background: var(--gold-soft); border: 1px solid var(--gold-border); border-radius: 10px; padding: 14px 16px; }

/* ===== Competitor card ===== */
.comp-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.comp-name { font-weight: 700; color: var(--navy); font-size: 14.5px; }
.comp-rating { font-size: 22px; font-weight: 700; color: var(--navy); }
.trend { font-size: 12px; font-weight: 700; }
.trend.up { color: var(--green); }
.trend.down { color: var(--red); }
.trend.flat { color: var(--faint); }
.you-row { background: linear-gradient(135deg, rgba(212,175,55,0.12), rgba(212,175,55,0.04)); border: 1px solid var(--gold); }

/* ===== Forms ===== */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--navy); margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px;
  font-family: inherit; font-size: 13.5px; color: var(--ink); background: var(--card);
}
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212,175,55,0.15); }
.field textarea { resize: vertical; min-height: 90px; }
.field-hint { font-size: 11.5px; color: var(--faint); margin-top: 5px; }

.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg-opt { flex: 1; min-width: 120px; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; cursor: pointer; transition: all 0.13s; }
.seg-opt:hover { border-color: var(--gold); }
.seg-opt.active { border-color: var(--gold); background: rgba(212,175,55,0.07); box-shadow: 0 0 0 2px rgba(212,175,55,0.18); }
.seg-opt .seg-title { font-weight: 600; color: var(--navy); font-size: 13.5px; }
.seg-opt .seg-desc { font-size: 12px; color: var(--muted); margin-top: 3px; }

.toggle { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-track { position: absolute; inset: 0; background: var(--on-dark); border-radius: 999px; transition: 0.2s; }
.toggle-track::before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: 0.2s; }
.toggle input:checked + .toggle-track { background: var(--gold); }
.toggle input:checked + .toggle-track::before { transform: translateX(20px); }

/* ===== Modal ===== */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,0.55); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal { background: var(--card); border-radius: 16px; width: 100%; max-width: 480px; box-shadow: var(--shadow-lg); max-height: 90vh; overflow-y: auto; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 16px; font-weight: 700; color: var(--navy); }
.modal-x { width: 30px; height: 30px; border-radius: 8px; border: none; background: var(--bg); color: var(--muted); font-size: 18px; display: flex; align-items: center; justify-content: center; }
.modal-x:hover { background: var(--line); }
.modal-body { padding: 22px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 16px 22px; border-top: 1px solid var(--line); }

/* ===== Upgrade overlay (tier gating) ===== */
.gate { position: relative; }
.gate-overlay {
  background: linear-gradient(135deg, rgba(30,41,59,0.96), rgba(15,23,42,0.96));
  border-radius: var(--radius); padding: 40px 28px; text-align: center; color: #fff;
}
.gate-overlay .lock { font-size: 38px; margin-bottom: 12px; }
.gate-overlay h3 { font-size: 19px; font-weight: 700; margin-bottom: 8px; }
.gate-overlay p { color: var(--on-dark); max-width: 460px; margin: 0 auto 18px; font-size: 13.5px; }

/* ===== Hero banner (gold) ===== */
.hero {
  background: var(--gold-grad); border-radius: var(--radius); padding: 26px 28px;
  color: #fff; margin-bottom: 22px; box-shadow: var(--shadow);
}
.hero h1 { font-size: 22px; font-weight: 700; }
.hero p { color: rgba(255,255,255,0.9); margin-top: 6px; font-size: 14px; }

/* ===== Insight callout ===== */
.callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.callout-ico { font-size: 20px; flex-shrink: 0; }
.callout-body { font-size: 13px; color: var(--text-soft); line-height: 1.5; }

/* ===== Toast ===== */
.toast-wrap { position: fixed; bottom: 24px; right: 24px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 10px;
  font-size: 13px; font-weight: 500; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 9px; animation: toast-in 0.25s ease;
}
.toast .t-ico { color: var(--gold); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ===== Misc ===== */
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.flex { display: flex; }
.between { justify-content: space-between; }
.center { align-items: center; }
.gap8 { gap: 8px; }
.gap12 { gap: 12px; }
.right { text-align: right; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.dl-row { display: flex; justify-content: space-between; padding: 7px 0; font-size: 13.5px; }
.dl-row .k { color: var(--muted); }
.dl-row .v { font-weight: 600; color: var(--navy); }

/* ===== Coming-soon review platforms ===== */
.soon-platforms { display: flex; flex-direction: column; gap: 6px; }
.soon-platform { display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-radius: 9px; background: var(--surface); color: var(--faint); font-size: 13px; font-weight: 500; }
.soon-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--on-dark); flex-shrink: 0; }

/* ===== Social tile generator ===== */
.tile-size-row { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.tile-size.active { border-color: var(--gold); background: rgba(212,175,55,0.1); color: var(--navy); }
.tile-canvas-wrap { background: var(--bg); border-radius: 12px; padding: 16px; }

/* ===== Website Widget preview ===== */
.widget-preview { background: var(--surface); border: 1px dashed var(--line); border-radius: 12px; padding: 24px; }
.wgt-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; box-shadow: var(--shadow); }
.wgt-stars { color: var(--gold); letter-spacing: 2px; font-size: 15px; margin-bottom: 8px; }
.wgt-quote { font-size: 14px; color: var(--text); line-height: 1.55; margin-bottom: 10px; }
.wgt-name { font-size: 13px; font-weight: 700; color: var(--navy); }
.wgt-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.wgt-single { max-width: 460px; margin: 0 auto; }
.wgt-carousel { max-width: 460px; margin: 0 auto; text-align: center; }
.wgt-carousel .wgt-card { text-align: left; }
.wgt-dots { display: flex; gap: 6px; justify-content: center; margin-top: 12px; }
.wgt-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--on-dark); }
.wgt-dot.on { background: var(--gold); }
.wgt-badge { display: inline-flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 20px; box-shadow: var(--shadow); }
.wgt-badge-star { font-size: 30px; color: var(--gold); }
.wgt-badge-rating { font-size: 18px; font-weight: 800; color: var(--navy); }
.wgt-badge-sub { font-size: 12px; color: var(--muted); }
.embed-code {
  background: var(--navy-2); color: var(--line); border-radius: 10px; padding: 14px 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px;
  overflow-x: auto; white-space: pre-wrap; word-break: break-all;
}
@media (max-width: 700px) { .wgt-grid { grid-template-columns: 1fr; } }

/* ===== Rich plan cards ===== */
.plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: stretch; }
.plan-card {
  position: relative; display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 22px 20px;
}
.plan-card.popular { border: 2px solid var(--gold); box-shadow: 0 6px 24px rgba(212,175,55,0.18); }
.plan-card.current { background: linear-gradient(180deg, rgba(212,175,55,0.05), var(--card)); }
.plan-ribbon {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  background: var(--gold-grad); color: #fff; font-size: 11px; font-weight: 700;
  padding: 3px 14px; border-radius: 999px; white-space: nowrap; box-shadow: var(--shadow);
}
.plan-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.plan-name { font-size: 17px; font-weight: 800; color: var(--navy); }
.plan-tagline { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.plan-price { font-size: 30px; font-weight: 800; color: var(--navy); margin: 4px 0 14px; }
.plan-per { font-size: 14px; font-weight: 600; color: var(--faint); }
.plan-plus { font-size: 12px; font-weight: 700; color: var(--gold-deep); margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.3px; }
.plan-features { list-style: none; margin: 0 0 18px; padding: 0; flex: 1; }
.plan-features li { font-size: 12.8px; line-height: 1.45; padding: 5px 0 5px 24px; position: relative; color: var(--text); }
.plan-features li.pf-yes::before { content: '✓'; position: absolute; left: 2px; color: var(--green); font-weight: 800; }
.plan-features li.pf-no { color: var(--faint); }
.plan-features li.pf-no::before { content: '✕'; position: absolute; left: 2px; color: var(--on-dark); font-weight: 700; }
.plan-features li.pf-soon { color: var(--muted); }
.plan-features li.pf-soon::before { content: '🔜'; position: absolute; left: 0; font-size: 11px; }
.pf-soon-tag { font-size: 10px; color: var(--faint); font-style: italic; }
@media (max-width: 900px) { .plan-grid { grid-template-columns: 1fr; } }

/* ===== CSV download button ===== */
.page-head.has-csv { position: relative; padding-right: 96px; }
.csv-btn {
  position: absolute; top: 2px; right: 0;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: 9px; font-size: 12.5px; font-weight: 600;
  border: 1px solid var(--line); background: var(--card); color: var(--text); transition: all 0.13s;
}
.csv-btn:hover { border-color: var(--gold); color: var(--navy); }
.csv-btn .csv-ico { font-size: 13px; }
.csv-btn.disabled { opacity: 0.5; cursor: not-allowed; }
.csv-btn.disabled:hover { border-color: var(--line); color: var(--text); }
@media (max-width: 560px) {
  .page-head.has-csv { padding-right: 0; }
  .csv-btn { position: static; margin-top: 10px; }
}

/* ===== Auth / login pages ===== */
.auth-root {
  position: fixed; inset: 0; z-index: 40;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1200px 600px at 50% -10%, rgba(212,175,55,0.10), transparent), var(--bg);
  padding: 24px;
}
.auth-card {
  width: 100%; max-width: 420px; background: var(--card);
  border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow-lg); padding: 36px 34px 28px; text-align: center;
}
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 22px; }
.auth-brand svg { display: block; }
.auth-wordmark { font-size: 24px; font-weight: 800; letter-spacing: -0.4px; }
.auth-h1 { font-size: 20px; font-weight: 700; color: var(--navy); margin-bottom: 8px; }
.auth-sub { font-size: 14px; color: var(--muted); line-height: 1.55; margin-bottom: 20px; }
.auth-icon { font-size: 40px; margin-bottom: 10px; }
.auth-label { display: block; text-align: left; font-size: 12.5px; font-weight: 600; color: var(--navy); margin-bottom: 6px; }
.auth-input {
  width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: 10px;
  font-family: inherit; font-size: 15px; color: var(--ink); background: var(--card); margin-bottom: 14px;
}
.auth-input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212,175,55,0.18); }
.auth-btn {
  width: 100%; display: inline-flex; align-items: center; justify-content: center;
  padding: 13px 18px; border-radius: 10px; font-size: 15px; font-weight: 700; font-family: inherit;
  border: none; background: var(--gold-grad); color: #fff; cursor: pointer; box-shadow: 0 1px 2px rgba(146,112,10,0.3);
  text-decoration: none;
}
.auth-btn:hover { filter: brightness(1.05); color: #fff; text-decoration: none; }
.auth-btn:disabled { opacity: 0.6; cursor: default; filter: none; }
.auth-btn-ghost { background: var(--card); color: var(--text); border: 1px solid var(--line); box-shadow: none; margin-top: 10px; }
.auth-btn-ghost:hover { background: var(--surface); color: var(--navy); border-color: var(--gold); filter: none; }
.auth-alt { font-size: 13px; color: var(--muted); margin-top: 16px; }
.auth-alt a, .auth-footer a { color: var(--gold-deep); font-weight: 600; }
.auth-error {
  background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c;
  font-size: 13px; line-height: 1.5; border-radius: 10px; padding: 11px 13px; margin-bottom: 16px; text-align: left;
}
.auth-note {
  background: var(--surface); border: 1px solid var(--line); color: var(--text-soft);
  font-size: 12.5px; line-height: 1.5; border-radius: 10px; padding: 11px 13px; margin-bottom: 14px;
}
.auth-note code { background: #eef2f7; padding: 1px 5px; border-radius: 4px; font-size: 11.5px; word-break: break-all; }
.auth-footer { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--faint); }
@media (max-width: 460px) { .auth-card { padding: 28px 22px 22px; border-radius: 14px; } }

/* ===== Boot spinner ===== */
.boot-spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--gold);
  animation: boot-spin 0.8s linear infinite;
}
@keyframes boot-spin { to { transform: rotate(360deg); } }

/* ===== Magic-link "Signing you in…" gold-pour animation =====
   Replaces the spinner on the validating screen. Full-bleed Grok footage,
   colour-graded honey→gold in-browser, with a rising gold flood + our crisp
   wordmark. hideAuthUI() adds .pourfx-reveal to crossfade into the dashboard. */
.auth-root.pourfx { position: fixed; inset: 0; display: block; padding: 0; background: #0b1322;
  z-index: 1000; overflow: hidden; transition: opacity .9s cubic-bezier(.4,0,.2,1); }
.auth-root.pourfx.pourfx-reveal { opacity: 0; pointer-events: none; }
.pourfx-vid { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #0b1322;
  /* contain shows the FULL video frame (not zoomed/cropped) on both orientations */
  /* industrial molten-gold footage is already gold — just enrich/pop, don't recolour */
  filter: saturate(1.32) brightness(1.05) contrast(1.1); }
.pourfx-color { position: absolute; inset: 0; mix-blend-mode: color; opacity: .2;
  background: linear-gradient(180deg, #ffe9a8, #e8c75c 45%, #c9a227); }
.pourfx-glow { position: absolute; inset: 0; mix-blend-mode: screen; opacity: .2;
  background: radial-gradient(60% 50% at 50% 38%, rgba(255,236,170,.5), rgba(255,236,170,0) 70%); }
.pourfx-scrim { position: absolute; inset: 0;
  background: radial-gradient(120% 90% at 50% 2%, rgba(11,19,34,.1), rgba(11,19,34,.5) 55%, rgba(11,19,34,.92) 100%); }
/* The realistic footage already shows gold pooling, so the flood is just a
   gentle bottom glow that seats the caption — not a full-screen wash. */
.pourfx-flood { position: absolute; left: 0; right: 0; bottom: 0; height: 0;
  background: linear-gradient(180deg, rgba(212,175,55,0), rgba(228,196,90,.28) 55%, rgba(201,162,39,.5));
  box-shadow: 0 -8px 50px rgba(212,175,55,.25); animation: pourfxRise 2.4s cubic-bezier(.25,.7,.3,1) .1s forwards; }
@keyframes pourfxRise { 0% { height: 0; } 100% { height: 32%; } }
.pourfx-cap { position: absolute; left: 0; right: 0; bottom: 20%; text-align: center; padding: 0 24px; z-index: 3; }
.pourfx-star { font-size: 32px; color: var(--gold); filter: drop-shadow(0 3px 10px rgba(212,175,55,.6)); }
.pourfx-brand { font-weight: 800; font-size: 22px; margin-top: 10px; color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,.6); }
.pourfx-brand .g { color: #e4c45a; }
.pourfx-sub { color: #eadfae; font-size: 14px; margin-top: 6px; text-shadow: 0 1px 8px rgba(0,0,0,.6); }
@media (prefers-reduced-motion: reduce) { .pourfx-flood { animation: none; height: 60%; } .pourfx-vid { filter: sepia(.62) saturate(2.4) brightness(1.12); } }


/* ===== Filter toolbar (tabs + action button) ===== */
.filter-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.filter-toolbar .tabs { margin-bottom: 0; min-width: 0; }
.filter-toolbar .btn { flex-shrink: 0; }
@media (max-width: 560px) {
  .filter-toolbar { flex-direction: column; align-items: stretch; }
  /* Wrap the filter chips onto multiple rows instead of a cramped h-scroll */
  .filter-toolbar .tabs { width: 100%; flex-wrap: wrap; }
  .filter-toolbar .btn { width: 100%; justify-content: center; }
}

/* ===== Trust Score rewards box (top) ===== */
.reward-amount { font-size: 20px; font-weight: 800; color: var(--green); line-height: 1.2; }
.reward-scroll {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 14px;
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--gold-deep); font-size: 13px; font-weight: 700; font-family: inherit;
}
.reward-scroll:hover { text-decoration: underline; color: var(--gold); }

/* ===== Trust Score rewards ===== */
.rewards-tbl td { vertical-align: middle; }
.rewards-tbl tr.rewards-total td { border-top: 2px solid var(--line); background: rgba(212,175,55,0.05); }
.grow-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 9px; font-size: 13px; color: var(--text-soft); }
.grow-row.hit { background: rgba(212,175,55,0.1); border: 1px solid rgba(212,175,55,0.4); }
.grow-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--on-dark); flex-shrink: 0; }
.grow-row.hit .grow-dot { background: var(--gold); }
.grow-label { flex: 1; color: var(--navy); }
.grow-val { font-weight: 600; color: var(--green); white-space: nowrap; }
.grow-example { margin-top: 14px; padding: 14px 16px; background: var(--surface); border-radius: 10px; font-size: 13px; color: var(--text-soft); line-height: 1.6; border-left: 3px solid var(--gold); }
@media (max-width: 560px) { .grow-row { flex-wrap: wrap; } .grow-val { width: 100%; padding-left: 18px; } }

/* ===== Coming-soon feature box ===== */
.soon-feature-box { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px 22px; text-align: left; }
.soon-feature-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--faint); font-weight: 700; margin-bottom: 10px; }
.soon-feature-list { margin: 0; padding-left: 0; list-style: none; }
.soon-feature-list li { font-size: 13.5px; color: var(--text-soft); padding: 6px 0 6px 26px; position: relative; }
.soon-feature-list li::before { content: '○'; position: absolute; left: 6px; color: var(--gold); }

/* ===== Inline upgrade nudge ===== */
.nudge {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(135deg, rgba(212,175,55,0.10), rgba(212,175,55,0.04));
  border: 1px solid rgba(212,175,55,0.4); border-radius: 12px; padding: 16px 18px;
}
.nudge-ico { font-size: 22px; flex-shrink: 0; }
.nudge-body { flex: 1; min-width: 0; }
.nudge-title { font-weight: 700; color: var(--navy); font-size: 14px; }
.nudge-text { font-size: 12.5px; color: var(--text-soft); margin-top: 2px; line-height: 1.5; }
.recovery-locked {
  display: inline-flex; align-items: center; font-size: 12px; font-weight: 600;
  color: var(--faint); padding: 6px 10px; background: var(--surface); border-radius: 8px;
}
@media (max-width: 560px) { .nudge { flex-direction: column; align-items: flex-start; } }

/* ===== AI draft external link ===== */
.adr-extlink {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--line);
  color: var(--muted); font-size: 14px; text-decoration: none; background: var(--card);
}
.adr-extlink:hover { border-color: var(--gold); color: var(--navy); text-decoration: none; }

/* ===== Help Centre ===== */
.help-search { position: relative; margin-bottom: 22px; }
.help-search-ico { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); font-size: 15px; opacity: 0.5; }
.help-search input {
  width: 100%; padding: 13px 16px 13px 44px; border: 1px solid var(--line); border-radius: 12px;
  font-family: inherit; font-size: 14px; color: var(--ink); background: var(--card); box-shadow: var(--shadow);
}
.help-search input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212,175,55,0.15); }
.help-topic-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--faint); font-weight: 700; margin: 18px 4px 8px; }
.help-article { margin-bottom: 10px; overflow: hidden; }
.help-art-head { display: flex; align-items: center; gap: 14px; padding: 16px 18px; cursor: pointer; user-select: none; }
.help-art-head:hover { background: #fafbfc; }
.help-art-ico {
  width: 38px; height: 38px; border-radius: 9px; flex-shrink: 0; font-size: 18px;
  display: flex; align-items: center; justify-content: center; background: rgba(212,175,55,0.12);
}
.help-art-title { font-size: 14.5px; font-weight: 600; color: var(--navy); }
.help-art-desc { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.help-chevron { color: var(--faint); font-size: 14px; transition: transform 0.2s; flex-shrink: 0; }
.help-article.open .help-chevron { transform: rotate(180deg); }
.help-art-body { display: none; padding: 0 18px 18px 70px; font-size: 13.5px; color: var(--text-soft); line-height: 1.6; }
.help-article.open .help-art-body { display: block; }
.help-art-body h3 { font-size: 13.5px; font-weight: 700; color: var(--navy); margin: 14px 0 4px; }
.help-art-body p { margin-bottom: 8px; }
.help-art-body ul, .help-art-body ol { margin: 6px 0 10px 18px; }
.help-art-body li { margin-bottom: 4px; }
.help-art-body strong { color: var(--navy); }
.help-plan-note { margin-top: 14px; padding: 10px 14px; background: rgba(212,175,55,0.08); border: 1px solid rgba(212,175,55,0.3); border-radius: 9px; font-size: 12.5px; font-weight: 600; color: var(--gold-deep); }
@media (max-width: 560px) { .help-art-body { padding-left: 18px; } }

/* ===== Nav lock (tier gating) ===== */
.nav-item.locked { color: var(--muted); }
.nav-item.locked:hover { color: var(--faint); }
.nav-lock { margin-left: auto; font-size: 11px; opacity: 0.7; }

/* ===== Compliance banner ===== */
.compliance-banner { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: var(--radius); padding: 14px 16px; }

/* AHPRA onboarding banner (Gap 10 UX) — dashboard nudge to the Settings acknowledgment. */
.ahpra-onboard-banner { background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%); border: 2px solid var(--gold-mid, #d4af37); border-radius: 12px; padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.aob-head { display: flex; gap: 14px; align-items: flex-start; }
.aob-icon { font-size: 24px; flex-shrink: 0; }
.aob-title { font-size: 14.5px; font-weight: 700; color: #1e293b; margin-bottom: 4px; }
.aob-sub { font-size: 12.5px; color: #64748b; line-height: 1.5; }
.aob-action { flex-shrink: 0; background: var(--gold-mid, #d4af37); color: #fff; font-size: 13px; font-weight: 700; padding: 10px 18px; border-radius: 8px; text-decoration: none; white-space: nowrap; }
.aob-action:hover { background: #c9a227; }
@media (max-width: 600px) { .ahpra-onboard-banner { flex-direction: column; align-items: stretch; } .aob-action { text-align: center; margin-top: 8px; } }
.cb-head { display: flex; gap: 12px; align-items: flex-start; }
.cb-shield { font-size: 20px; flex-shrink: 0; }
.cb-title { font-weight: 700; color: #1e3a8a; font-size: 14px; }
.cb-sub { font-size: 12.5px; color: #1e40af; margin-top: 2px; }
.cb-rules { margin: 10px 0 0 32px; padding: 0; }
.cb-rules li { font-size: 12.5px; color: #1e40af; margin-bottom: 4px; line-height: 1.45; }

/* ===== Account dropdown ===== */
.acct-menu {
  position: fixed; top: 60px; right: 20px; width: 264px; z-index: 120;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-lg); padding: 8px; overflow: hidden;
}
.acct-head { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.acct-item { display: block; padding: 9px 12px; border-radius: 9px; font-size: 13.5px; font-weight: 500; color: var(--text); cursor: pointer; }
.acct-item:hover { background: var(--bg); color: var(--navy); text-decoration: none; }

/* ===== Responsive ===== */
@media (max-width: 1100px) {
  .metrics { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 980px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .funnel-label { width: 110px; font-size: 12px; }
  .funnel-pct { width: 48px; }
}
@media (max-width: 820px) {
  .sidebar { position: fixed; left: -270px; top: 0; z-index: 60; transition: left 0.25s; box-shadow: var(--shadow-lg); }
  .sidebar.open { left: 0; }
  .menu-toggle { display: inline-flex !important; }
  .content { padding: 18px; }
  .topbar { padding: 0 16px; gap: 10px; }
  .topbar-pill .biz { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 560px) {
  .metrics { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .metric { padding: 14px 10px; }
  .metric-value { font-size: 22px; }
  .page-head h1 { font-size: 19px; }
  .topbar-title { font-size: 15px; }
  .topbar-pill .biz { display: none; }
  .tabs { width: 100%; overflow-x: auto; }
  .adr-actions, .action-row { gap: 6px; }
  .btn { padding: 8px 12px; font-size: 12.5px; }
  .acct-menu { right: 10px; width: calc(100vw - 20px); max-width: 300px; }
  .funnel-label { width: 92px; }
  .funnel-stage { gap: 8px; }
  .seg-opt { min-width: 100%; }
  .modal { max-width: 100%; }
}
.menu-toggle { display: none; width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--line); background: var(--card); color: var(--ink); align-items: center; justify-content: center; font-size: 18px; line-height: 1; flex-shrink: 0; }
.menu-toggle:hover { border-color: var(--gold); color: var(--gold-deep); }

/* ===== Collapsible slimline icon rail (desktop) =====
   The toggle lives in the sidebar header (Netlify-style): top-right when
   expanded, stacked under the star when collapsed. It shrinks the sidebar to a
   72px icon-only rail; labels, section headers, footer CTA and badge counts
   collapse and hovering an icon shows its name via the native title tooltip.
   The collapsed STATE is desktop-only (min-width:821px) — on mobile the sidebar
   is a slide-in drawer that always shows the FULL menu, regardless of the saved
   desktop collapse preference. */
.nav-collapse {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line);
  background: transparent; color: var(--text-soft); font-size: 12px; flex-shrink: 0;
  transition: color .13s, border-color .13s, transform .25s;
}
.nav-collapse:hover { border-color: var(--gold); color: var(--gold-deep); }
.app.nav-collapsed .nav-collapse { transform: rotate(180deg); }
@media (max-width: 820px) { .nav-collapse { display: none; } }

.sidebar { transition: width .2s ease; }

@media (min-width: 821px) {
  .app.nav-collapsed .sidebar { width: 72px; }
  .app.nav-collapsed .brand {
    flex-direction: column; height: auto; justify-content: center;
    gap: 12px; padding: 14px 0;
  }
  .app.nav-collapsed .brand-id { display: none; }
  .app.nav-collapsed .brand::before {
    content: '★'; color: var(--gold); font-size: 24px; line-height: 1; order: -1;
  }
  .app.nav-collapsed .nav { padding: 12px 8px; }
  .app.nav-collapsed .nav-section-label {
    height: 1px; padding: 0; margin: 12px 12px; overflow: hidden;
    background: var(--line); color: transparent; letter-spacing: 0;
  }
  .app.nav-collapsed .nav-item { position: relative; justify-content: center; padding: 11px 0; gap: 0; }
  .app.nav-collapsed .nav-label { display: none; }
  .app.nav-collapsed .nav-ico { width: auto; font-size: 17px; opacity: .9; }
  .app.nav-collapsed .nav-lock { display: none; }
  .app.nav-collapsed .nav-badge {
    position: absolute; top: 5px; right: 12px; min-width: 9px; width: 9px; height: 9px;
    padding: 0; font-size: 0; line-height: 0; border-radius: 50%;
  }
  .app.nav-collapsed .sidebar-foot { display: none; }
}

/* ====================================================================== */
/* Round 5 — UX polish + Gold Partner marketing                           */
/* ====================================================================== */

/* #2 Mobile nav backdrop (sidebar z-index is 60, overlay sits just below) */
.nav-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 55; }
@media (max-width: 820px) { .nav-overlay.show { display: block; } }

/* #6 Gold Partner stats — 4 across on desktop, 2x2 on phones (was inline grid) */
.metrics-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 560px) { .metrics-4 { grid-template-columns: repeat(2, 1fr); } }
/* #6 Don't let the iOS bottom browser bar hide the last rows */
@media (max-width: 820px) { .content { padding-bottom: 80px; } }
/* #6 Horizontal-scroll hint for wide tables on phones */
.tbl-scroll-hint { display: none; font-size: 11px; color: var(--faint); font-weight: 600; margin: 0 0 6px; }
@media (max-width: 560px) { .tbl-scroll-hint { display: block; } }

/* #3 Clickable dashboard metric cards */
.metric-link { display: block; text-decoration: none; cursor: pointer; transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s; }
.metric-link:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--gold); }
.metric-link:active { transform: translateY(0); }

/* #5 Gold Partner — sidebar CTA */
.gp-cta { display: block; text-decoration: none; border-radius: 12px; padding: 13px 14px; background: linear-gradient(135deg, rgba(212,175,55,0.14), rgba(146,112,10,0.10)); border: 1px solid rgba(212,175,55,0.45); }
.gp-cta-title { font-size: 12.5px; font-weight: 800; color: var(--gold-deep); display: flex; align-items: center; gap: 6px; }
/* Sidebar is always dark — use a bright on-dark colour so the callout body
   reads clearly against the gold-tint box (UI improvement: contrasting text). */
.gp-cta-sub { font-size: 12px; color: #e3ebf7; margin: 4px 0 9px; line-height: 1.4; }
.gp-cta-link { font-size: 12px; font-weight: 700; color: var(--gold-deep); }
.gp-cta-support { font-size: 11px; color: var(--faint); text-align: center; margin-top: 10px; }
.gp-cta-support a { color: var(--faint); }

/* #5B Dashboard Gold Partner card + #5C ROI banner */
.gp-card { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; border: 1px solid rgba(212,175,55,0.45); background: linear-gradient(135deg, rgba(212,175,55,0.10), rgba(146,112,10,0.06)); border-radius: 14px; padding: 16px 18px; margin-bottom: 18px; }
.gp-card-main { flex: 1; min-width: 200px; }
.gp-card-title { font-size: 15px; font-weight: 800; color: var(--gold-deep); }
.gp-card-sub { font-size: 13px; color: var(--text-soft); margin-top: 3px; }
.gp-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.gp-roi-row { display: flex; justify-content: space-between; font-size: 13.5px; padding: 4px 0; }
.gp-roi-row .lbl { color: var(--text-soft); }
.gp-roi-row .val { font-weight: 700; }
.gp-roi-total { border-top: 2px solid var(--line); margin-top: 8px; padding-top: 10px; font-size: 15px; }

/* #1 Tooltips */
.gr-tip { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--faint); font-size: 10.5px; font-weight: 800; cursor: pointer; margin-left: 6px; vertical-align: middle; flex-shrink: 0; user-select: none; }
.gr-tip:hover, .gr-tip.open { background: var(--navy); color: #fff; border-color: var(--navy); }
.gr-tip-bubble { position: absolute; z-index: 300; left: 50%; transform: translateX(-50%); bottom: calc(100% + 8px); width: max-content; max-width: 260px; background: var(--navy); color: #fff; font-size: 12px; font-weight: 500; line-height: 1.45; text-align: left; padding: 9px 11px; border-radius: 9px; box-shadow: var(--shadow-lg); white-space: normal; }
.gr-tip-bubble::after { content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); border: 6px solid transparent; border-top-color: var(--navy); }
.gr-tip-bubble.below { bottom: auto; top: calc(100% + 8px); }
.gr-tip-bubble.below::after { top: auto; bottom: 100%; border-top-color: transparent; border-bottom-color: var(--navy); }
@media (max-width: 560px) { .gr-tip-bubble { max-width: 200px; } }

/* #1 How-to expandable */
.howto { margin-top: 14px; margin-bottom: 18px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.howto-head { display: flex; align-items: center; gap: 8px; padding: 10px 13px; cursor: pointer; font-size: 12.5px; font-weight: 700; color: var(--navy); user-select: none; background: var(--bg-soft, var(--surface)); }
.howto-body { display: none; padding: 4px 14px 13px; font-size: 12.5px; color: var(--text-soft); line-height: 1.6; }
.howto.open .howto-body { display: block; }
.howto.open .howto-chev { transform: rotate(180deg); }
.howto-chev { margin-left: auto; transition: transform 0.15s; }

/* #1 First-login tutorial (spotlight tour) */
.tour-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,0.62); z-index: 400; }
.tour-spot { position: fixed; z-index: 401; border-radius: 12px; box-shadow: 0 0 0 4px rgba(212,175,55,0.9), 0 0 0 9999px rgba(15,23,42,0.62); transition: all 0.25s ease; pointer-events: none; }
.tour-pop { position: fixed; z-index: 402; width: min(300px, calc(100vw - 32px)); background: var(--card); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 18px; }
.tour-step { font-size: 11px; font-weight: 700; color: var(--gold-deep); text-transform: uppercase; letter-spacing: 0.5px; }
.tour-title { font-size: 16px; font-weight: 800; color: var(--navy); margin: 4px 0 6px; }
.tour-text { font-size: 13.5px; color: var(--text-soft); line-height: 1.55; }
.tour-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; gap: 10px; }
.tour-skip { background: none; border: none; color: var(--faint); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.tour-dots { display: flex; gap: 5px; }
.tour-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.tour-dot.on { background: var(--gold); }

/* ===========================================================================
   UI IMPROVEMENTS (dark refresh) — dashboard cards, metrics, action row.
   =========================================================================== */
.metrics.metrics-6 { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 1200px) { .metrics.metrics-6 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px)  { .metrics.metrics-6 { grid-template-columns: repeat(2, 1fr); } }

/* Sub-line that turns a bare number into a metric */
.metric-sub { font-size: 11px; font-weight: 600; color: var(--faint); margin-top: 6px; letter-spacing: 0.1px; }
.metric-sub.good { color: var(--green); }
.metric-sub.warn { color: var(--amber); }
.metric-value .pct { font-size: 16px; font-weight: 700; color: var(--faint); }
/* Metric cards are links — never underline them */
.metric-link, .metric-link:hover { text-decoration: none; }
.metric-link:hover { border-color: var(--gold); }

/* "Needs your attention" — evenly sized, full-width action buttons */
.action-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.action-btn { justify-content: space-between; }
.action-btn-gold { background: var(--gold-grad); border: none; color: #fff; justify-content: center; }
.action-btn-gold:hover { filter: brightness(1.05); color: #fff; border: none; }

/* Dashboard mini Trust-Score scorecard rows */
.mini-metrics { margin-top: 12px; text-align: left; border-top: 1px solid var(--line); padding-top: 8px; }
.mini-metrics .dl-row { padding: 4px 0; }

/* ===== "This month at a glance" horizontal bars (Activity) ===== */
.glance { display: flex; flex-direction: column; gap: 16px; }
.glance-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 7px; }
.glance-label { font-size: 13.5px; color: var(--text-soft); font-weight: 600; }
.glance-val { font-size: 16px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.glance-track { height: 8px; border-radius: 999px; background: var(--surface); overflow: hidden; }
.glance-fill { height: 100%; border-radius: 999px; min-width: 4px; transition: width 0.4s ease; }

/* ===== Responsive tables — table on desktop, stacked cards on mobile ===== */
@media (max-width: 640px) {
  .tbl-responsive thead { display: none; }
  .tbl-responsive tbody { display: block; }
  .tbl-responsive tr {
    display: block; border: 1px solid var(--line); border-radius: 12px;
    padding: 6px 4px; margin-bottom: 12px; background: var(--surface);
  }
  .tbl-responsive tr:hover td { background: transparent; }
  .tbl-responsive td {
    display: flex; justify-content: space-between; align-items: center; gap: 14px;
    padding: 8px 14px; border-bottom: 1px solid var(--line); text-align: right;
  }
  .tbl-responsive tr td:last-child { border-bottom: none; }
  .tbl-responsive td::before {
    content: attr(data-label); text-align: left; flex-shrink: 0;
    font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px;
    color: var(--faint); font-weight: 700;
  }
}

/* Comms Hub / gate upsell — separate the two CTAs so they don't touch */
.gate-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 8px; }

/* ===== "⋯ More" dropdown menus (AI drafts, Proof Vault) ===== */
.menu { position: relative; display: inline-block; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary::marker { content: ''; }
.menu-list {
  /* Anchor to the LEFT of the trigger so the menu opens toward the open
     right-hand side of the card — the ⋯ More button sits on the left of the
     action row, so right:0 used to push the menu off the left screen edge on
     mobile. Clamp the width so it can never exceed the viewport. */
  position: absolute; left: 0; right: auto; top: calc(100% + 6px); z-index: 60;
  min-width: 210px; max-width: calc(100vw - 28px); background: var(--card);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg);
  padding: 6px; display: flex; flex-direction: column; gap: 2px;
}
.menu-list .btn {
  width: 100%; justify-content: flex-start; border: none; background: transparent;
  color: var(--text); padding: 9px 10px; border-radius: 7px; box-shadow: none; font-weight: 600;
}
.menu-list .btn:hover { background: var(--surface); color: var(--ink); border: none; }

/* ===== Consolidated filter dropdown (Proof Vault, Customer Notes) ===== */
.filter-select {
  font-family: inherit; font-size: 13.5px; font-weight: 600; color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-radius: 9px;
  padding: 9px 36px 9px 14px; cursor: pointer; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2 4l4 4 4-4' stroke='%2394a3b8' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat; background-position: right 12px center; transition: border-color .13s, box-shadow .13s;
}
.filter-select:hover { border-color: var(--gold); }
.filter-select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212,175,55,0.15); }
.filter-select option { background: var(--card); color: var(--ink); font-weight: 600; }

/* ===== Themed search input (Customer Notes) ===== */
.search-input {
  font-family: inherit; font-size: 13.5px; color: var(--ink);
  background: var(--card); border: 1px solid var(--line);
  border-radius: 9px; padding: 10px 14px; transition: border-color 0.13s, box-shadow 0.13s;
}
.search-input::placeholder { color: var(--faint); }
.search-input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212,175,55,0.15); }

/* ===== Competitor scorecard — compact inline stat cards ===== */
.stat-strip { display: flex; gap: 12px; }
.stat-chip {
  flex: 1; background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--gold);
  border-radius: var(--radius); padding: 13px 10px; text-align: center; box-shadow: var(--shadow);
}
.stat-chip-val { font-size: 22px; font-weight: 800; color: var(--navy); line-height: 1; }
.stat-chip-val.gold { color: var(--gold-deep); }
.stat-chip-val.green { color: var(--green); }
.stat-chip-label { font-size: 10.5px; color: var(--faint); font-weight: 600; margin-top: 5px; text-transform: uppercase; letter-spacing: 0.3px; }
@media (max-width: 560px) {
  .stat-strip { gap: 8px; }
  .stat-chip { padding: 10px 6px; }
  .stat-chip-val { font-size: 18px; }
  .stat-chip-label { font-size: 9px; letter-spacing: 0; }
}
/* Don't render an empty stacked cell (e.g. the "you" row's blank edit cell) */
@media (max-width: 640px) { .tbl-responsive td:empty { display: none; } }
