:root {
  /* Epic Brand Kit (received 25 Jun 2026) — source of truth */
  --epic-white: #FFFFFF;
  --epic-red:   #ED1B24;
  --epic-green: #8EC63F;
  --epic-blue:  #00ADEF;
  --epic-black: #000000;

  /* Derived tokens */
  --epic-blue-50:  #E6F7FE;
  --epic-blue-200: #99DEF7;
  --epic-red-50:   #FDE7E8;
  --epic-green-50: #F1F8E5;
  --epic-gray-50:  #F9FAFB;
  --epic-gray-200: #E5E7EB;
  --epic-gray-500: #6B7280;
  --epic-gray-700: #374151;

  /* Severity ladder (event economics, KPI grading) — extends brand palette */
  --sev-stellar:  #4D8E1F;  /* deep green   — beats target +50% */
  --sev-strong:   #8EC63F;  /* brand green  — comfortably profitable */
  --sev-healthy:  #C3DD8A;  /* pale green   — covers overhead */
  --sev-watch:    #D88E1C;  /* amber        — slight loss after overhead */
  --sev-concern:  #E85C28;  /* amber-red    — significant loss */
  --sev-poor:     #ED1B24;  /* brand red    — major loss */
  --sev-critical: #A30E15;  /* deep red     — catastrophic, kill or rework */
  --sev-info:     #00ADEF;  /* brand blue   — needs data / projection only */

  /* Severity background tints (for pill backgrounds on light surfaces) */
  --sev-stellar-50:  #E4F1D2;
  --sev-strong-50:   #F1F8E5;
  --sev-healthy-50:  #F4F9E6;
  --sev-watch-50:    #FCEFD5;
  --sev-concern-50:  #FCE3D5;
  --sev-poor-50:     #FDE7E8;
  --sev-critical-50: #F4D2D4;
  --sev-info-50:     #E6F7FE;

  /* Legacy aliases (kept so existing rules stay valid) */
  --epic-amber: #D88E1C;
  --dark-bg:    #000000;   /* brand black */
  --warm-grey:  #F9FAFB;   /* gray-50 surface */
  --ink:        #111418;
  --muted:      var(--epic-gray-500);
  --line:       #D1D5DB; /* was epic-gray-200 (#E5E7EB) — darkened so tile bounding boxes are clearly visible */
  --ms-blue:    var(--epic-blue);

  /* Type scale */
  --type-title: 64px;
  --type-h1:    40px;
  --type-h2:    30px;
  --type-h3:    24px;
  --type-kpi:   32px;
  --type-body:  16px;
  --type-small: 14px;

  --font-stack: "Open Sauce Sans", "Open Sauce", -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-stack);
  font-feature-settings: "ss01", "cv11";
  font-size: var(--type-body);
  color: var(--ink);
  background: var(--warm-grey);
  -webkit-font-smoothing: antialiased;
}

/* Topbar */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  background: var(--dark-bg); color: white;
  position: sticky; top: 0; z-index: 10;
  padding-top: max(14px, env(safe-area-inset-top));
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-logo {
  display: block;
  height: 22px;
  width: auto;
  /* Logo is dark-on-light by default; topbar is dark, so invert to white */
  filter: brightness(0) invert(1);
}
.brand-mark {
  display: inline-block; width: 16px; height: 16px;
  background: var(--epic-red); border-radius: 4px;
}
.brand-name { font-weight: 700; letter-spacing: 0.02em; font-size: 15px; }
#nav-user { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.role-chip {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15);
  padding: 3px 8px; border-radius: 999px; color: #e5e5e5;
}
#logout {
  background: transparent; color: white; border: 1px solid #444; padding: 6px 12px;
  border-radius: 999px; cursor: pointer; font: inherit;
}

main { padding: 24px 20px 80px; max-width: 1100px; margin: 0 auto; }

/* Signed out */
.centred { text-align: center; padding: 64px 16px; }
.centred h1 { font-size: 36px; margin: 8px 0 12px; }
.centred p { color: var(--muted); margin: 0 0 32px; }
.btn-primary {
  display: inline-block; background: var(--ms-blue); color: white;
  padding: 14px 24px; border-radius: 999px; text-decoration: none; font-weight: 600;
}
.btn-primary:hover { background: #006abf; }

/* Dashboard */
.dash-title { font-size: 28px; margin: 8px 0; }
.dash-sub { color: var(--muted); margin: 0 0 24px; font-size: 14px; }

.tile-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  grid-auto-flow: row dense;
  align-items: start;
}
.tile {
  background: white; border-radius: 16px;
  border: 1px solid var(--line);
  padding: 18px 20px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
  /* CRITICAL: grid items default to min-width: min-content which lets contents push the
     cell wider than its track, causing overflow into siblings. Force shrink-to-fit. */
  min-width: 0;
  /* Clip any content that's still too tall/wide so tiles can never visually bleed
     into neighbours. */
  overflow: hidden;
}
.tile header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.tile h2 { font-size: 16px; margin: 0; letter-spacing: 0.01em; font-weight: 600; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #ccc; cursor: help; position: relative; }
.dot.green { background: var(--epic-green); }
.dot.amber { background: var(--epic-amber); }
.dot.red { background: var(--epic-red); }

/* Custom hover tooltip for tile status dots (v26.11)
   Uses the title attribute as fallback; this CSS tooltip is the prettier version */
.dot[title]:hover::after {
  content: attr(title);
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  background: var(--dark-bg, #000);
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
  max-width: 280px;
  white-space: normal;
  width: max-content;
  z-index: 100;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}
.dot[title]:hover::before {
  content: '';
  position: absolute;
  bottom: 100%;
  right: 4px;
  border: 5px solid transparent;
  border-top-color: var(--dark-bg, #000);
  z-index: 100;
}
.tile-body { font-size: 14px; min-height: 100px; }
.tile-body.skel { color: var(--muted); font-style: italic; }
.tile-empty, .tile-empty-sm { color: var(--muted); padding: 8px 0; font-size: 13px; }
.tile-meta {
  margin-top: 12px; padding-top: 8px; border-top: 1px solid var(--line);
  font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em;
}
.metric-row .meta { color: var(--muted); font-size: 12px; font-weight: 400; margin-left: 6px; }
.metric-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  padding: 6px 0; border-bottom: 1px dashed var(--line);
  min-width: 0;
}
.metric-row:last-child { border: none; }
.metric-row .label {
  color: var(--muted);
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.metric-row .label .meta {
  display: inline-block; max-width: 100%; vertical-align: baseline;
}
.metric-row .value {
  font-variant-numeric: tabular-nums; font-weight: 600;
  flex: 0 0 auto;
  white-space: nowrap;
}
.value.red { color: var(--epic-red); }
.value.amber { color: var(--epic-amber); }
.value.green { color: var(--epic-green); }

/* v27.1.5 — finance reconciliation variance highlighting (detail-page table cells
   + the inline legend spans). >5% amber, >15% red. */
.fin-amber { color: var(--epic-amber); font-weight: 600; }
.fin-red   { color: var(--epic-red); font-weight: 600; }
td.fin-amber { background: rgba(245, 158, 11, 0.12); }
td.fin-red   { background: rgba(239, 68, 68, 0.14); }

/* Self-service */
.section-title { margin: 32px 0 12px; font-size: 18px; }
.self-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.self-card {
  background: white; border: 1px solid var(--line); border-radius: 12px;
  padding: 16px; text-decoration: none; color: var(--ink); font-weight: 500;
  text-align: center;
}
.self-card:hover { border-color: var(--epic-blue); }

.foot {
  text-align: center; color: var(--muted); font-size: 12px; padding: 24px 16px 48px;
}
#env-badge { padding: 2px 8px; background: var(--warm-grey); border-radius: 4px; }

@media (prefers-color-scheme: dark) {
  body { background: #0f0f0f; color: #f0eee8; }
  .tile, .self-card { background: #1c1c1c; border-color: #2a2a2a; color: #f0eee8; }
  .metric-row, .tile-meta { border-color: #2a2a2a; }
  .foot { color: #888; }
  .self-card { color: #f0eee8; }
}

@media (max-width: 520px) {
  main { padding: 16px 12px 80px; }
  .dash-title { font-size: 22px; }
  .tile { padding: 14px 16px; }
}

/* ===== Management dashboard ===== */
.tile-wide { grid-column: 1 / -1; }

.tuning-panel {
  display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: end;
  padding: 12px 14px; margin: 8px 0 14px; border-radius: 8px;
  background: rgba(32, 128, 141, 0.06);
  border: 1px solid rgba(32, 128, 141, 0.18);
  font-size: 13px;
}
.tuning-panel label {
  display: flex; flex-direction: column; gap: 4px;
  color: var(--muted); font-size: 12px;
}
.tuning-panel input[type=number] {
  width: 84px; padding: 6px 8px; border-radius: 6px;
  border: 1px solid #ccc; background: #fff; font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.tuning-panel button {
  padding: 7px 14px; border-radius: 6px; border: 0;
  background: var(--epic-blue, #20808D); color: #fff;
  font-weight: 500; cursor: pointer; font-size: 13px;
}
.tuning-panel button.btn-secondary {
  background: transparent; color: var(--epic-blue, #20808D);
  border: 1px solid var(--epic-blue, #20808D);
}
.tune-status { color: var(--muted); font-size: 12px; }
.tuning-applied-meta {
  color: var(--muted); font-size: 11px;
  margin-bottom: 8px; font-variant-numeric: tabular-nums;
}

/* Monthly chart */
.chart-legend {
  display: flex; gap: 16px; margin-bottom: 6px;
  font-size: 12px; color: var(--muted);
}
.chart-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.chart-swatch { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }

/* Events margin rows */
.evrows { display: flex; flex-direction: column; gap: 6px; }
.evrow {
  display: grid; grid-template-columns: 1fr 200px 80px;
  align-items: center; gap: 10px; padding: 6px 4px;
  border-bottom: 1px solid var(--border, #eee); font-size: 13px;
}
.evrow-label { display: flex; flex-direction: column; min-width: 0; }
.evrow-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.evrow-meta { font-size: 11px; color: var(--muted); }
.evrow-bar { background: #f1f1ee; height: 10px; border-radius: 5px; overflow: hidden; }
.evrow-bar .bar { height: 100%; border-radius: 5px; }
.bar-neg { background: #ED1B24; }
.bar-amber { background: #D88E1C; }
.bar-pos { background: #8EC63F; }
.evrow-val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }

@media (prefers-color-scheme: dark) {
  .tuning-panel input[type=number] {
    background: #2a2a2a; color: #f0eee8; border-color: #3a3a3a;
  }
  .evrow-bar { background: #2a2a2a; }
  .evrow { border-color: #2a2a2a; }
}

@media (max-width: 600px) {
  .evrow { grid-template-columns: 1fr 120px 70px; }
  .tuning-panel { font-size: 12px; }
}

/* ---------- Modal (monthly accounts drill-in) ---------- */
.modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15,18,22,0.6); }
.modal-panel { position: relative; background: var(--surface, #fff); width: min(96vw, 1100px); max-height: 92vh; overflow-y: auto; border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.modal-header { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border, #e6e6e2); }
.modal-header h2 { margin: 0; font-size: 1.1rem; flex: 1; }
.modal-header .modal-month-picker { display: inline-flex; align-items: center; gap: 6px; font-size: 0.85rem; color: var(--text-muted, #6b6b66); }
.modal-header .modal-month-picker select { padding: 4px 8px; border-radius: 6px; border: 1px solid var(--border, #ddd); }
.btn-close { background: none; border: 0; font-size: 1.2rem; cursor: pointer; color: var(--text-muted, #6b6b66); padding: 4px 8px; }
.btn-close:hover { color: var(--text, #28251d); }
.modal-body { padding: 20px; }
.btn-link { background: none; border: 0; color: var(--primary, #01696f); cursor: pointer; font-size: 0.9rem; padding: 2px 6px; margin-left: auto; }
.btn-link:hover { text-decoration: underline; }

/* Lynne three-business comparison table */
.lynne-grid { display: grid; grid-template-columns: minmax(160px, 1.4fr) repeat(3, minmax(120px, 1fr)) minmax(110px, 0.9fr); gap: 1px; background: var(--border, #e6e6e2); border: 1px solid var(--border, #e6e6e2); border-radius: 8px; overflow: hidden; font-size: 0.85rem; }
.lynne-grid > div { background: var(--surface, #fff); padding: 8px 10px; }
.lynne-grid .lynne-hdr { background: var(--surface-alt, #f7f6f2); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted, #6b6b66); }
.lynne-grid .lynne-row-label { font-weight: 500; color: var(--text, #28251d); }
.lynne-grid .lynne-num { text-align: right; font-variant-numeric: tabular-nums lining-nums; }
.lynne-grid .lynne-section { background: var(--surface-alt, #f5f4ee); font-weight: 600; text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.05em; color: var(--text-muted, #6b6b66); }
.lynne-grid .lynne-flag-warn { color: var(--warning, #964219); font-weight: 600; }
.lynne-grid .lynne-flag-error { color: var(--error, #a12c7b); font-weight: 600; }

/* Variance tile mini table */
.variance-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.variance-table th, .variance-table td { padding: 6px 10px; text-align: left; border-bottom: 1px solid var(--border, #eee); }
.variance-table th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted, #6b6b66); font-weight: 600; }
.variance-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.variance-table tr.flagged td { background: rgba(161,44,123,0.04); }

/* Cash / aging tiles */
.cash-table, .aging-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.cash-table th, .cash-table td, .aging-table th, .aging-table td { padding: 4px 8px; }
.cash-table .num, .aging-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.cash-row-total { font-weight: 600; border-top: 1px solid var(--border, #ddd); }

.tile-monthly .open-monthly-accounts:hover { background: var(--surface-alt, #f5f4ee); }

/* ───────────────────────────────────────────────────────────────────────
   Year-on-year (PY vs CY) tiles + modal
   ─────────────────────────────────────────────────────────────────── */

.modal-panel-wide { width: min(98vw, 1280px) !important; }

/* Home tile — group card */
.yoy-group { padding: 8px 0 12px; border-bottom: 1px solid var(--border, #d4d1ca); margin-bottom: 12px; }
.yoy-group-label { font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted, #7a7974); margin-bottom: 6px; }
.yoy-group-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px 16px; }
.yoy-group-grid .k-label { font-size: 11px; color: var(--muted, #7a7974); }
.yoy-group-grid .k-value { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums lining-nums; }
.yoy-group-grid .k-value.muted { font-weight: 500; color: var(--muted, #7a7974); }

.yoy-seg-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.yoy-seg-card { padding: 10px 12px; background: var(--surface-alt, #fbfbf9); border: 1px solid var(--border, #d4d1ca); border-radius: 8px; }
.yoy-seg-label { font-size: 12px; font-weight: 600; margin-bottom: 6px; }
.yoy-seg-rows { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.yoy-row { display: grid; grid-template-columns: 64px 1fr auto; align-items: baseline; gap: 8px; font-variant-numeric: tabular-nums lining-nums; }
.yoy-row > span:first-child { color: var(--muted, #7a7974); font-size: 11px; }
.k-num { font-weight: 600; }
.k-num .muted { font-weight: 400; font-size: 11px; }

/* Delta colour conventions */
.d-up   { color: #437a22; font-weight: 600; }
.d-down { color: #a12c7b; font-weight: 600; }

/* PY months chip strip */
.py-chip-strip { display: flex; flex-wrap: wrap; gap: 6px; }
.py-chip {
  border: 1px solid var(--border, #d4d1ca);
  background: var(--surface, #f9f8f5);
  color: var(--text, #28251d);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-variant-numeric: tabular-nums lining-nums;
}
.py-chip:hover { background: var(--primary, #01696f); color: #fff; border-color: var(--primary, #01696f); }
.py-chip-help { font-size: 11px; margin-top: 8px; }

/* Modal — KPI strip */
.yoy-kpi-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.kpi-card { background: var(--surface-alt, #fbfbf9); border: 1px solid var(--border, #d4d1ca); border-radius: 10px; padding: 14px 16px; }
.kpi-card .k-label { font-size: 11px; color: var(--muted, #7a7974); text-transform: uppercase; letter-spacing: 0.04em; }
.kpi-card .k-big { font-size: 28px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums lining-nums; }
.kpi-card .k-sub { font-size: 12px; margin-top: 2px; }
.kpi-card .k-delta { font-size: 13px; margin-top: 8px; font-variant-numeric: tabular-nums lining-nums; }

/* Modal blocks */
.yoy-block { margin-top: 28px; }
.yoy-block h3 { font-size: 14px; font-weight: 600; margin: 0 0 12px; color: var(--text, #28251d); }

.yoy-bridge-svg { background: var(--surface-alt, #fbfbf9); border-radius: 8px; border: 1px solid var(--border, #d4d1ca); }
.yoy-bridge-svg .bridge-val { font-size: 11px; font-weight: 600; fill: var(--text, #28251d); font-variant-numeric: tabular-nums; }
.yoy-bridge-svg .bridge-lbl { font-size: 11px; fill: var(--muted, #7a7974); }

/* Small multiples */
.yoy-smalls { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.yoy-small { padding: 12px; background: var(--surface-alt, #fbfbf9); border: 1px solid var(--border, #d4d1ca); border-radius: 8px; }
.yoy-small h4 { font-size: 12px; font-weight: 600; margin: 0 0 8px; }
.yoy-small .px-tick { font-size: 9px; fill: var(--muted, #7a7974); }
.yoy-small-legend { display: flex; gap: 12px; font-size: 11px; color: var(--muted, #7a7974); margin-top: 4px; align-items: center; }
.yoy-small-legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }
.yoy-small-legend .sw.cy { background: #00ADEF; }
.yoy-small-legend .sw.py { background: #6B7280; }

/* Month-picker grid */
.month-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-bottom: 18px; }
.month-cell {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 8px 6px; border-radius: 8px;
  border: 1px solid var(--border, #d4d1ca);
  background: var(--surface, #f9f8f5);
  font-family: inherit; cursor: pointer;
  font-variant-numeric: tabular-nums lining-nums;
}
.month-cell-py { font-size: 13px; font-weight: 600; }
.month-cell-vs { font-size: 9px; color: var(--muted, #7a7974); margin: 1px 0; }
.month-cell-cy { font-size: 12px; color: var(--muted, #7a7974); }
.month-cell.has-cy .month-cell-cy { color: var(--primary, #01696f); font-weight: 600; }
.month-cell:hover { border-color: var(--primary, #01696f); }
.month-cell.active { border-color: var(--primary, #01696f); background: rgba(1, 105, 111, 0.08); }
.month-cell-flag { font-size: 9px; color: var(--muted, #7a7974); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 2px; }

/* Month detail table */
.yoy-month-detail { margin-top: 16px; }
.yoy-month-detail h4 { font-size: 13px; font-weight: 600; margin: 0 0 8px; }
.yoy-detail-scroll { overflow-x: auto; }
.yoy-detail-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.yoy-detail-table th, .yoy-detail-table td { padding: 8px 10px; text-align: right; border-bottom: 1px solid var(--border, #d4d1ca); font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; }
.yoy-detail-table thead th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted, #7a7974); font-weight: 500; }
.yoy-detail-table tbody th { text-align: left; font-weight: 600; }

/* Responsive */
@media (max-width: 900px) {
  .yoy-group-grid { grid-template-columns: repeat(3, 1fr); }
  .yoy-seg-grid { grid-template-columns: 1fr; }
  .yoy-kpi-strip { grid-template-columns: repeat(2, 1fr); }
  .yoy-smalls { grid-template-columns: 1fr; }
}

/* Dark mode parity */
@media (prefers-color-scheme: dark) {
  .yoy-group { border-color: #2a2a2a; }
  .yoy-seg-card, .kpi-card, .yoy-bridge-svg, .yoy-small, .month-cell { background: #1c1b19; border-color: #393836; }
  .py-chip { background: #1c1b19; border-color: #393836; color: #cdccca; }
  .month-cell.active { background: rgba(79, 152, 163, 0.15); border-color: #4f98a3; }
  .yoy-detail-table th, .yoy-detail-table td { border-color: #2a2a2a; }
  .d-up { color: #6daa45; }
  .d-down { color: #d163a7; }
}

/* ----- Sign-in refresh banner ----- */
.refresh-banner {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a1a;
  color: #fff;
  padding: 0.65rem 1.1rem;
  border-radius: 999px;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
  z-index: 9999;
  opacity: 1;
  transition: opacity 4s ease-out;
  max-width: calc(100vw - 2rem);
}
.refresh-banner.fading { opacity: 0; }
.refresh-banner .dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: #2daae2;
  box-shadow: 0 0 0 0 rgba(45, 170, 226, 0.7);
  animation: refresh-pulse 1.4s infinite;
}
@keyframes refresh-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(45, 170, 226, 0.7); }
  70%  { box-shadow: 0 0 0 10px rgba(45, 170, 226, 0); }
  100% { box-shadow: 0 0 0 0 rgba(45, 170, 226, 0); }
}
@media (prefers-color-scheme: dark) {
  .refresh-banner { background: #f0f0f0; color: #1a1a1a; }
}

/* ----- Admin: role matrix ----- */
.role-matrix-wrap { overflow-x: auto; }
table.role-matrix {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
table.role-matrix th, table.role-matrix td {
  text-align: left;
  padding: 0.5rem 0.65rem;
  vertical-align: top;
  border-bottom: 1px solid #ECEAE6;
}
table.role-matrix th {
  background: #F6F4F0;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #5A5752;
}
table.role-matrix tr:last-child td { border-bottom: none; }
table.role-matrix .muted { color: #807C75; font-size: 0.8rem; }

.role-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #BAB9B4;
  color: #1A1A1A;
}
.role-badge.role-admin   { background: #A12C7B; color: #fff; }
.role-badge.role-finance { background: #01696F; color: #fff; }
.role-badge.role-manager { background: #437A22; color: #fff; }
.role-badge.role-staff   { background: #BAB9B4; color: #1A1A1A; }

.chip {
  display: inline-block;
  font-size: 0.72rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  margin: 0.1rem 0.15rem 0.1rem 0;
  background: #F0EDE7;
  color: #3A3934;
  border: 1px solid #ECEAE6;
}
.chip-admin   { background: #FBE6F2; border-color: #F1C0DD; color: #5E0E40; }
.chip-finance { background: #DDEDEE; border-color: #B8DADC; color: #013236; }
.chip-manager { background: #E3F0DA; border-color: #BCDDA5; color: #1E3A0E; }
.chip-staff   { background: #F0EDE7; border-color: #ECEAE6; color: #3A3934; }
.chip-none    { background: #FFF4F4; border-color: #F5C2C2; color: #842121; }

.btn-ghost {
  background: transparent;
  border: 1px solid #ECEAE6;
  border-radius: 6px;
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
  cursor: pointer;
  color: #3A3934;
}
.btn-ghost:hover { background: #F6F4F0; }

@media (prefers-color-scheme: dark) {
  table.role-matrix th { background: #2A2926; color: #B5B2AC; }
  table.role-matrix th, table.role-matrix td { border-bottom-color: #3A3934; }
  table.role-matrix .muted { color: #908C85; }
  .chip { background: #2A2926; border-color: #3A3934; color: #D5D2CC; }
  .chip-admin   { background: #3D1A2D; border-color: #6E2A52; color: #F1C0DD; }
  .chip-finance { background: #0F2F31; border-color: #2A5C60; color: #B8DADC; }
  .chip-manager { background: #1E2E14; border-color: #436626; color: #BCDDA5; }
  .chip-staff   { background: #2A2926; border-color: #3A3934; color: #B5B2AC; }
  .chip-none    { background: #3D1F1F; border-color: #6A2F2F; color: #F5C2C2; }
  .btn-ghost { border-color: #3A3934; color: #D5D2CC; }
  .btn-ghost:hover { background: #2A2926; }
}

/* ---- Bar tile click-through ---- */
.tile-clickable {
  cursor: pointer;
  transition: box-shadow 0.15s ease, transform 0.1s ease;
}
.tile-clickable:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  transform: translateY(-1px);
}
.tile-clickable:focus-visible {
  outline: 2px solid #2daae2;
  outline-offset: 2px;
}
.tile-clickable:active {
  transform: translateY(0);
}

/* ---- Bar detail view ---- */
#bar-detail {
  padding: 0;
}

.bar-detail-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0 1.25rem;
  border-bottom: 1px solid #ECEAE6;
  margin-bottom: 1.5rem;
}

.btn-back {
  background: transparent;
  border: 1px solid #ECEAE6;
  border-radius: 6px;
  padding: 0.4rem 0.85rem;
  font-size: 0.875rem;
  cursor: pointer;
  color: #3A3934;
  transition: background 0.12s;
  white-space: nowrap;
}
.btn-back:hover { background: #F6F4F0; }
.btn-back:focus-visible { outline: 2px solid #2daae2; outline-offset: 2px; }

.bar-detail-title {
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0;
  color: #1A1A1A;
}

/* ---- Staff: My Bar Shift view ---- */
.bar-shift-headline {
  background: #F6F4F0;
  border: 1px solid #ECEAE6;
  border-radius: 10px;
  padding: 1.5rem 2rem;
  margin-bottom: 1.5rem;
  display: inline-block;
  min-width: 200px;
}
.bar-shift-headline-label {
  font-size: 0.8rem;
  color: #7A7974;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.35rem;
}
.bar-shift-headline-value {
  font-size: 2rem;
  font-weight: 700;
  color: #1A1A1A;
}
.bar-shift-section-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #3A3934;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}
.bar-shift-notice {
  color: #7A7974;
  font-size: 0.9rem;
  padding: 1rem 0;
}
.bar-shift-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.bar-shift-row {
  display: grid;
  grid-template-columns: 120px 140px 1fr;
  gap: 0.5rem 1rem;
  align-items: center;
  padding: 0.65rem 1rem;
  background: #F6F4F0;
  border: 1px solid #ECEAE6;
  border-radius: 8px;
  font-size: 0.9rem;
}
.bar-shift-date { font-weight: 600; color: #1A1A1A; }
.bar-shift-time { color: #3A3934; }
.bar-shift-loc  { color: #7A7974; font-size: 0.85rem; }

@media (max-width: 600px) {
  .bar-shift-row {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
  }
  .bar-shift-loc { grid-column: 1 / -1; }
}

@media (prefers-color-scheme: dark) {
  .bar-detail-header { border-bottom-color: #3A3934; }
  .bar-detail-title { color: #F5F4F0; }
  .btn-back { border-color: #3A3934; color: #D5D2CC; }
  .btn-back:hover { background: #2A2926; }
  .bar-shift-headline { background: #222120; border-color: #3A3934; }
  .bar-shift-headline-label { color: #908C85; }
  .bar-shift-headline-value { color: #F5F4F0; }
  .bar-shift-section-title { color: #D5D2CC; }
  .bar-shift-row { background: #222120; border-color: #3A3934; }
  .bar-shift-date { color: #F5F4F0; }
  .bar-shift-time { color: #D5D2CC; }
  .bar-shift-loc  { color: #908C85; }
}

/* ===== Week Navigator (global topbar control) ===== */
.week-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #F5F4F0;
  border: 1px solid #ECEAE6;
  border-radius: 10px;
  padding: 4px 6px;
}
.week-nav-btn {
  background: transparent;
  border: 0;
  color: #3A3934;
  font-size: 1rem;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
}
.week-nav-btn:hover { background: #ECEAE6; }
.week-picker {
  background: transparent;
  border: 0;
  font: inherit;
  color: #1A1A1A;
  padding: 2px 4px;
  cursor: pointer;
  width: 0;
  opacity: 0;
  position: absolute;
}
.week-today-btn {
  background: #1A1A1A;
  color: #F5F4F0;
  border: 0;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.8rem;
  cursor: pointer;
}
.week-today-btn:hover { background: #2A2926; }
.week-label {
  font-size: 0.9rem;
  color: #1A1A1A;
  font-weight: 600;
  padding: 0 6px;
  min-width: 8.5em;
  text-align: center;
  cursor: pointer;
}
.week-label:hover { text-decoration: underline; }

/* ===== Events tile ===== */
.events-today-banner {
  background: #FFF7E6;
  border: 1px solid #F5C97A;
  border-radius: 8px;
  padding: 8px 10px;
  margin: 8px 0;
  font-size: 0.85rem;
  color: #5A4A1A;
}
.events-today-banner strong { color: #1A1A1A; }
.tile-more-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.85rem;
  color: #1A6FB5;
  text-decoration: none;
}
.tile-more-link:hover { text-decoration: underline; }

/* ===== Event detail cards ===== */
.event-card {
  background: #FAFAF8;
  border: 1px solid #ECEAE6;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.event-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}
.event-card-head .title {
  font-weight: 600;
  color: #1A1A1A;
}
.event-card-head .date {
  font-size: 0.85rem;
  color: #7A7974;
}
.event-ticket {
  display: inline-block;
  background: #E8F3FF;
  color: #1A4A7A;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.8rem;
  font-weight: 600;
}
.event-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 6px 14px;
  font-size: 0.85rem;
}
.event-field { display: flex; gap: 6px; }
.event-field-k {
  color: #7A7974;
  min-width: 5.5em;
}
.event-field-v {
  color: #1A1A1A;
  font-weight: 500;
  word-break: break-word;
}

/* ===== Events week table ===== */
.week-events-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-top: 10px;
}
.week-events-table th,
.week-events-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid #ECEAE6;
}
.week-events-table th {
  font-size: 0.8rem;
  color: #7A7974;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.week-row-green td { background: #EAF7EC; }
.week-row-amber td { background: #FFF6E0; }
.week-row-red td   { background: #FBE7E7; }

/* ===== Brevo tile ===== */
.brevo-kpi-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 6px 0 8px;
}
.brevo-kpi {
  background: #F5F4F0;
  border: 1px solid #ECEAE6;
  border-radius: 8px;
  padding: 8px 10px;
}
.kpi-k {
  font-size: 0.75rem;
  color: #7A7974;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.kpi-v {
  font-size: 1.4rem;
  font-weight: 700;
  color: #1A1A1A;
  line-height: 1.1;
}
.kpi-sub {
  font-size: 0.75rem;
  color: #7A7974;
  margin-top: 2px;
}

/* ===== Brevo campaign cards (detail) ===== */
.brevo-campaign-card {
  background: #FAFAF8;
  border: 1px solid #ECEAE6;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.brevo-subject {
  font-weight: 600;
  color: #1A1A1A;
  margin-bottom: 8px;
}
.brevo-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}
.brevo-stat {
  background: #F5F4F0;
  border: 1px solid #ECEAE6;
  border-radius: 8px;
  padding: 6px 10px;
}
.stat-k {
  font-size: 0.72rem;
  color: #7A7974;
  text-transform: uppercase;
}
.stat-v {
  font-size: 1.05rem;
  font-weight: 600;
  color: #1A1A1A;
}
.stat-sub {
  font-size: 0.72rem;
  color: #7A7974;
}
.brevo-stat-green { background: #EAF7EC; border-color: #C0E5C5; }
.brevo-stat-amber { background: #FFF6E0; border-color: #F1D27D; }
.brevo-stat-red   { background: #FBE7E7; border-color: #E5B5B5; }

/* ===== Events detail section ===== */
.events-detail-section {
  margin-top: 16px;
}
.events-detail-section h3 {
  font-size: 0.95rem;
  margin: 12px 0 8px;
  color: #1A1A1A;
  font-weight: 600;
}

/* ===== Dark mode overrides ===== */
@media (prefers-color-scheme: dark) {
  .week-nav { background: #222120; border-color: #3A3934; }
  .week-nav-btn { color: #D5D2CC; }
  .week-nav-btn:hover { background: #2A2926; }
  .week-today-btn { background: #F5F4F0; color: #1A1A1A; }
  .week-today-btn:hover { background: #ECEAE6; }
  .week-label { color: #F5F4F0; }

  .events-today-banner { background: #2A2520; border-color: #5A4A1A; color: #F5DCA0; }
  .events-today-banner strong { color: #F5F4F0; }
  .tile-more-link { color: #6FB5F0; }

  .event-card { background: #222120; border-color: #3A3934; }
  .event-card-head .title { color: #F5F4F0; }
  .event-card-head .date { color: #908C85; }
  .event-ticket { background: #1A3A5A; color: #BFE0FF; }
  .event-field-k { color: #908C85; }
  .event-field-v { color: #F5F4F0; }

  .week-events-table th { color: #908C85; }
  .week-events-table th, .week-events-table td { border-bottom-color: #3A3934; }
  .week-row-green td { background: #1F3A22; }
  .week-row-amber td { background: #3A2F18; }
  .week-row-red td   { background: #3A1F1F; }

  .brevo-kpi { background: #222120; border-color: #3A3934; }
  .kpi-k { color: #908C85; }
  .kpi-v { color: #F5F4F0; }
  .kpi-sub { color: #908C85; }

  .brevo-campaign-card { background: #222120; border-color: #3A3934; }
  .brevo-subject { color: #F5F4F0; }
  .brevo-stat { background: #2A2926; border-color: #3A3934; }
  .stat-k { color: #908C85; }
  .stat-v { color: #F5F4F0; }
  .stat-sub { color: #908C85; }
  .brevo-stat-green { background: #1F3A22; border-color: #2F5A35; }
  .brevo-stat-amber { background: #3A2F18; border-color: #5A4A20; }
  .brevo-stat-red   { background: #3A1F1F; border-color: #5A2F2F; }

  .events-detail-section h3 { color: #F5F4F0; }
}

/* ===== As-of banner ===== */
.asof-banner {
  margin: 8px 16px 0;
  padding: 8px 14px;
  background: var(--blue-50, #E6F7FE);
  border: 1px solid var(--blue-200, #99DEF7);
  border-radius: 8px;
  font-size: var(--type-small, 14px);
  color: var(--gray-700, #374151);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.asof-banner strong { color: #00599A; font-weight: 600; }
.link-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  color: var(--epic-blue, #00ADEF);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}
.link-btn:hover { color: #0089BE; }

/* ===== KPI block (used in Brevo tile etc.) ===== */
.kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 8px;
}
.kpi-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 6px 0;
}
.kpi-value {
  font-size: var(--type-kpi, 32px);
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.kpi-value-sm { font-size: 24px; }
.kpi-label {
  font-size: 12px;
  color: var(--gray-500, #6B7280);
  margin-top: 2px;
  line-height: 1.25;
  /* Allow wrapping to 2 lines instead of cutting off the campaign name */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  max-width: 100%;
}
.kpi-sub {
  font-size: 11px;
  color: var(--gray-500, #6B7280);
  margin-top: 4px;
}
.kpi-value-lg { font-size: 48px; }
.kpi-block-tight { padding: 4px 0; }

/* ===== Compact tile (slimmer body) ===== */
.tile.tile-compact .tile-body {
  min-height: 0;
  padding-top: 4px;
  padding-bottom: 4px;
}

/* ===== People exceptions footer (small badge row) ===== */
.people-exc-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--gray-200, #E5E7EB);
  font-size: 13px;
  color: var(--gray-700, #374151);
}
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.badge-green { background: #DCFCE7; color: #166534; }
.badge-amber { background: #FEF3C7; color: #92400E; }
.badge-red   { background: #FEE2E2; color: #991B1B; }

/* ===== Events tile (today + week) ===== */
.ev-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray-500, #6B7280);
  margin: 8px 0 6px;
}
.ev-section-label:first-child { margin-top: 0; }
.ev-today {
  background: var(--epic-blue-50, #E6F7FE);
  border: 1px solid var(--epic-blue-100, #B9E8FB);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 4px;
}
.ev-today-empty {
  background: var(--gray-50, #F9FAFB);
  border-color: var(--gray-200, #E5E7EB);
}
.ev-today-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.ev-today-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-900, #111827);
  line-height: 1.2;
}
.ev-type {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--epic-blue, #00599A);
  background: #FFFFFF;
  border: 1px solid var(--epic-blue-100, #B9E8FB);
  border-radius: 6px;
  padding: 2px 6px;
  white-space: nowrap;
}
.ev-today-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 6px 12px;
  font-size: 12px;
  color: var(--gray-700, #374151);
}
.ev-fact {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  /* Wrap long values (e.g. "19:00 (21:00 KO)") instead of forcing the cell wider. */
  overflow-wrap: anywhere;
}
.ev-fact-k {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray-500, #6B7280);
  font-weight: 600;
  line-height: 1.1;
}
.ev-fact-v {
  font-size: 12px;
  color: var(--gray-700, #374151);
  line-height: 1.25;
  word-break: break-word;
}
.ev-week-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: baseline;
  padding: 4px 0;
  font-size: 13px;
  border-bottom: 1px dashed var(--gray-200, #E5E7EB);
  min-width: 0;
}
.ev-week-row:last-child { border-bottom: none; }
.ev-week-date {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-500, #6B7280);
  text-transform: uppercase;
}
.ev-week-name {
  color: var(--gray-900, #111827);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ev-week-time {
  font-size: 12px;
  color: var(--gray-700, #374151);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

@media (prefers-color-scheme: dark) {
  .asof-banner {
    background: #15303C;
    border-color: #1F4A5E;
    color: #C8D8E0;
  }
  .asof-banner strong { color: #79CFF2; }
  .link-btn { color: #5BC4F0; }
  .kpi-label { color: #908C85; }
  .kpi-sub { color: #908C85; }
  .people-exc-line { color: #D2D2D2; border-top-color: #2A2A2A; }
  .badge-green { background: #14361F; color: #6ED394; }
  .badge-amber { background: #3A2C0A; color: #F2C765; }
  .badge-red   { background: #3A1313; color: #F18C8C; }
  .ev-section-label { color: #908C85; }
  .ev-today {
    background: rgba(0, 173, 239, 0.08);
    border-color: rgba(0, 173, 239, 0.30);
  }
  .ev-today-empty { background: #1A1A1A; border-color: #2A2A2A; }
  .ev-today-name { color: #F4F4F4; }
  .ev-type { background: #15252E; color: #79CFF2; border-color: #1F4A5E; }
  .ev-today-facts { color: #D2D2D2; }
  .ev-fact-k { color: #908C85; }
  .ev-week-row { border-bottom-color: #2A2A2A; }
  .ev-week-date { color: #908C85; }
  .ev-week-name { color: #F4F4F4; }
  .ev-week-time { color: #D2D2D2; }
  .brevo-mini-row { border-bottom-color: #2A2A2A; }
  .brevo-mini-name { color: #F4F4F4; }
  .brevo-mini-date { color: #908C85; }
}

/* ===== Events tile =====
   Renders as a regular single-column tile inside .tile-grid, exactly like
   Bar/Finance/People/Marketing. Today section on top, rest-of-week list
   below — stacked vertically, no container queries, no two-column. */
.ev-today { margin-bottom: 10px; }
.ev-today-name { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.ev-today-facts { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; color: var(--muted); }
.ev-fact { display: inline-flex; gap: 4px; }
.ev-fact-k { color: var(--muted); }
.ev-fact-v { color: var(--ink); font-weight: 500; }
.ev-section-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--muted); margin: 10px 0 6px;
}
.ev-section-label:first-child { margin-top: 0; }

/* ===== Marketing tile — mini campaign list ===== */
.kpi-grid-4 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 12px;
  margin-bottom: 8px;
}
.brevo-mini-list { margin-top: 10px; }
.brevo-mini-row {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 4px 0;
  font-size: 12px;
  border-bottom: 1px dashed var(--epic-gray-200, #E5E7EB);
}
.brevo-mini-row:last-child { border-bottom: none; }
.brevo-mini-date { color: var(--epic-gray-500, #6B7280); font-variant-numeric: tabular-nums; }
.brevo-mini-name {
  color: var(--epic-gray-700, #374151);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.brevo-mini-open.badge { font-size: 11px; min-width: 34px; }

/* ===== People tile — trim vertical height ===== */
.tile.tile-compact .kpi-value-lg { font-size: 36px; line-height: 1; }
.tile.tile-compact .kpi-block-tight { padding: 2px 0; }
.tile.tile-compact .kpi-sub { margin-top: 2px; }
.tile.tile-compact .people-exc-line {
  margin-top: 8px;
  padding-top: 6px;
  font-size: 12px;
}

/* ===== As-of banner — quieter look so it doesn't read as a brand-coloured top bar ===== */
.asof-banner {
  margin: 0 0 12px;
  background: var(--epic-gray-50, #F9FAFB);
  border: 1px solid var(--epic-gray-200, #E5E7EB);
  color: var(--epic-gray-700, #374151);
}
.asof-banner strong { color: var(--ink, #111418); }

/* ============================================================
   v23 Dashboard Expansion — wide tiles + new tile sub-sections
   ============================================================ */

/* Wide tiles span two grid tracks; collapse to one on narrow screens.
   Uses `span 2` (not `1 / -1`) so it coexists with repeat(auto-fit,…). */
.tile.tile-wide-2 { grid-column: span 2; }
@media (max-width: 700px) {
  .tile.tile-wide-2 { grid-column: span 1; }
}

/* Generic muted-text utility (matches the --muted token used app-wide). */
.muted { color: var(--muted); }

/* ----- Bar tile: live "Last 7 days" section ----- */
.bar-week-section { margin-top: 10px; }
.bar-week-loading { font-size: 12px; padding: 4px 0; }
.bar-week-totals { margin-top: 6px; font-size: 12px; }

.bar-sparkline {
  display: flex; align-items: flex-end; gap: 4px;
  height: 52px; margin: 6px 0 10px;
}
.bar-spark-col {
  flex: 1 1 0; min-width: 0; height: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.bar-spark-track {
  width: 70%; flex: 1 1 auto; min-height: 0;
  background: var(--epic-gray-200, #E5E7EB);
  border-radius: 3px; overflow: hidden;
  display: flex; align-items: flex-end;
}
.bar-spark-fill {
  width: 100%; min-height: 2px;
  background: var(--epic-blue, #00ADEF);
  border-radius: 3px 3px 0 0;
}
.bar-spark-lbl {
  font-size: 9px; line-height: 1; color: var(--muted);
  text-transform: uppercase;
}

/* ----- Finance tile: YTD income vs target bar ----- */
.fin-target { margin: 4px 0 2px; }
.fin-target-bar {
  height: 10px; border-radius: 5px; overflow: hidden;
  background: var(--epic-gray-200, #E5E7EB);
}
.fin-target-fill { height: 100%; border-radius: 5px; min-width: 2px; }
.fin-target-green { background: var(--epic-green, #8EC63F); }
.fin-target-amber { background: var(--epic-amber, #D88E1C); }
.fin-target-red   { background: var(--epic-red, #ED1B24); }
.fin-target-meta { margin-top: 4px; font-size: 12px; }

/* ----- Marketing tile: recent-campaigns table + engagement trend ----- */
.brevo-table {
  width: 100%; border-collapse: collapse;
  font-size: 12px; margin-top: 8px;
}
.brevo-table th {
  text-align: left; font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--muted); padding: 4px 6px;
  border-bottom: 1px solid var(--epic-gray-200, #E5E7EB);
}
.brevo-table td {
  padding: 5px 6px;
  border-bottom: 1px dashed var(--epic-gray-200, #E5E7EB);
}
.brevo-table tr:last-child td { border-bottom: none; }
.brevo-td-date { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.brevo-td-subject {
  max-width: 0; width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ink);
}
.brevo-td-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.brevo-green { color: #166534; font-weight: 600; }
.brevo-amber { color: #92400E; font-weight: 600; }
.brevo-red   { color: #991B1B; font-weight: 600; }
.brevo-trend {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-top: 8px; font-size: 12px;
}
.brevo-trend-up   { color: #437A22; font-weight: 600; }
.brevo-trend-down { color: #A12C7B; font-weight: 600; }

/* ----- Tickets tile ----- */
.ticket-wow { margin: 2px 0 8px; }
.ticket-event-row .ev-week-time {
  display: flex; align-items: center; justify-content: flex-end; gap: 6px;
}
.ticket-soldcap { font-variant-numeric: tabular-nums; color: var(--muted); }
.badge-grey { background: var(--epic-gray-200, #E5E7EB); color: var(--epic-gray-700, #374151); }

/* ----- Dark-mode parity for v23 additions ----- */
@media (prefers-color-scheme: dark) {
  .bar-spark-track { background: #2A2A2A; }
  .fin-target-bar { background: #2A2A2A; }
  .brevo-table th { border-bottom-color: #2A2A2A; }
  .brevo-table td { border-bottom-color: #2A2A2A; }
  .brevo-td-subject { color: #F4F4F4; }
  .brevo-green { color: #6ED394; }
  .brevo-amber { color: #F2C765; }
  .brevo-red   { color: #F18C8C; }
  .brevo-trend-up   { color: #6DAA45; }
  .brevo-trend-down { color: #D163A7; }
  .badge-grey { background: #2F2F2F; color: #C9C7C2; }
}

/* ============================================================ */
/* v24 — dashboard restructure (header-pair + 3×3 grid) + detail */
/* ============================================================ */

/* Row 1: two equal-width hero tiles (Today at Epic + People in Building). */
/* Kept for backwards compat — replaced by .dashboard-header-banner in v25.5 */
.dashboard-header-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

/* v25.5 — thin header banner replacing the two-card pair */
.dashboard-header-banner {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 1fr) minmax(220px, 1fr);
  align-items: center;
  gap: 24px;
  padding: 16px 4px 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line, #E5E7EB);
}

.header-left h1 {
  margin: 0 0 4px;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
}
.header-left .sub {
  color: var(--muted, #6B7280);
  font-size: 13px;
}

.header-middle {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  text-align: center;
  flex-wrap: wrap;
}
.header-middle .weather-icon { font-size: 28px; }
.header-middle .weather-temp { font-size: 24px; font-weight: 700; }
.header-middle .weather-desc { color: var(--muted, #6B7280); font-size: 13px; }
.header-middle .weather-range { color: var(--muted, #6B7280); font-size: 13px; }

.header-right {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
}
.header-right .people-meta { text-align: right; }
.header-right .people-meta .label { font-weight: 600; font-size: 14px; }
.header-right .people-meta .status {
  color: var(--muted, #6B7280);
  font-size: 12px;
  font-style: italic;
  margin-top: 2px;
}
.header-right .people-count {
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
}
.header-right .people-count-pill {
  background: #DCFCE7;
  color: #166534;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  text-align: center;
  display: inline-block;
  margin-top: 4px;
}

@media (prefers-color-scheme: dark) {
  .header-right .people-count-pill {
    background: #14532D;
    color: #BBF7D0;
  }
}

/* Mobile: collapse banner to single column */
@media (max-width: 800px) {
  .dashboard-header-banner {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .header-middle, .header-right { justify-content: flex-start; text-align: left; }
  .header-right { grid-template-columns: 1fr auto; }
}

/* v27.3.0 — secret-rotation warning banner (admin-only). Full-width row inside
   the header grid; red, bold, clickable, with a subtle pulse. */
.rotation-warning {
  grid-column: 1 / -1;
  margin-top: 8px;
  padding: 10px 14px;
  border: 1px solid var(--epic-red, #ED1B24);
  border-radius: 8px;
  background: var(--epic-red-50, #FDE7E8);
  color: var(--epic-red, #ED1B24);
  font-weight: 700;
  cursor: pointer;
  animation: rotation-pulse 1s ease-in-out infinite alternate;
}
.rotation-warning:hover { filter: brightness(0.97); }
.rotation-warning:focus-visible { outline: 2px solid var(--epic-red, #ED1B24); outline-offset: 2px; }
@keyframes rotation-pulse { from { opacity: 1; } to { opacity: 0.7; } }
@media (prefers-reduced-motion: reduce) {
  .rotation-warning { animation: none; }
}

/* Rotation modal — one block per pending secret. */
.rotation-block { padding: 12px 0; border-bottom: 1px solid var(--line, #E5E7EB); }
.rotation-block:last-child { border-bottom: 0; }
.rotation-block h3 { margin: 0 0 4px; }
.rotation-due { margin: 0 0 8px; color: var(--epic-red, #ED1B24); font-weight: 600; }
.rotation-steps { margin: 0 0 8px; }
.rotation-steps code { background: var(--epic-gray-50, #F9FAFB); padding: 1px 5px; border-radius: 4px; }
.rotation-links a { margin-right: 12px; }

/* v27.3.0 — Compliance library shelves (Compliance detail page). */
.docs-section { border: 1px solid var(--line, #E5E7EB); border-radius: 8px; margin-bottom: 12px; }
.docs-section-summary {
  cursor: pointer; padding: 12px 16px; font-weight: 700; font-size: 16px;
  list-style: none; display: flex; align-items: center; gap: 8px;
}
.docs-section-summary::-webkit-details-marker { display: none; }
.docs-section-count {
  background: var(--epic-gray-200, #E5E7EB); color: var(--epic-gray-700, #374151);
  font-size: 12px; font-weight: 700; padding: 1px 9px; border-radius: 999px;
}
.docs-section-body { padding: 0 16px 16px; }

.doc-index-card {
  border: 1px solid var(--epic-blue-200, #99DEF7); background: var(--epic-blue-50, #E6F7FE);
  border-radius: 8px; padding: 16px;
}
.doc-index-head { font-size: 18px; font-weight: 800; margin-bottom: 4px; }
.doc-index-btn {
  display: inline-block; margin-top: 10px; padding: 10px 16px; border-radius: 8px;
  background: var(--epic-blue, #00ADEF); color: #fff; font-weight: 700; text-decoration: none;
}
.doc-index-btn:hover { filter: brightness(0.95); }

.doc-review-callout {
  background: var(--epic-gray-50, #F9FAFB); border-left: 3px solid var(--epic-amber, #D88E1C);
  padding: 8px 12px; margin: 8px 0; font-weight: 600;
}
.doc-ref-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.doc-ref-link { white-space: nowrap; }

/* v27.3.2 Feature 2 — persistent Compliance "Index" sidebar + scroll-to-highlight.
   Mobile-first: the sidebar is a collapsible <details> stacked above the shelves.
   At ≥901px it becomes a 280px sticky left column, permanently expanded. */
.compliance-layout { display: block; }
.compliance-index-sidebar { margin-bottom: 16px; }
.ci-collapse { border: 1px solid var(--line, #E5E7EB); border-radius: 8px; }
.ci-summary {
  cursor: pointer; padding: 10px 12px; font-weight: 800; font-size: 15px;
  list-style: none;
}
.ci-summary::-webkit-details-marker { display: none; }
.ci-nav { padding: 4px 10px 12px; font-size: 13px; line-height: 1.4; }
.ci-list { list-style: none; margin: 0; padding: 0; }
.ci-entry { margin: 0; }
.ci-heading {
  font-weight: 800; margin-top: 10px; padding: 4px 6px;
  border-bottom: 1px solid var(--line, #E5E7EB);
}
.ci-entry.ci-nested { padding-left: 14px; }
.ci-link {
  display: flex; gap: 6px; width: 100%; text-align: left; background: none;
  border: 0; padding: 4px 6px; border-radius: 6px; cursor: pointer;
  color: inherit; font: inherit;
}
button.ci-link:hover { background: var(--epic-blue-50, #E6F7FE); }
.ci-num {
  color: var(--epic-gray-500, #6B7280); font-variant-numeric: tabular-nums;
  min-width: 30px; flex: 0 0 auto;
}
.ci-title { flex: 1 1 auto; }
.ci-hs > .ci-link, .ci-hs.ci-heading { color: var(--epic-blue, #00ADEF); }
.ci-hs .ci-num { color: var(--epic-blue, #00ADEF); }
.ci-disabled { color: var(--epic-gray-400, #9CA3AF); cursor: default; }
.ci-nodoc-tag { font-size: 11px; font-style: italic; color: var(--epic-gray-400, #9CA3AF); }
.ci-pdf-link {
  display: inline-block; margin-top: 10px; padding: 6px;
  font-weight: 700; color: var(--epic-blue, #00ADEF);
}

/* Scroll-to target: leave room beneath the sticky topbar, then flash on arrival. */
.doc-card { scroll-margin-top: 80px; }
.doc-card.highlighted { animation: ci-flash 2.5s ease-out; }
@keyframes ci-flash {
  0%   { box-shadow: 0 0 0 3px var(--epic-blue, #00ADEF); background: var(--epic-blue-50, #E6F7FE); }
  100% { box-shadow: 0 0 0 0 rgba(0,173,239,0); background: transparent; }
}

@media (min-width: 901px) {
  .compliance-layout { display: flex; align-items: flex-start; gap: 20px; }
  .compliance-index-sidebar {
    flex: 0 0 280px; width: 280px; margin-bottom: 0;
    position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto;
  }
  .compliance-main { flex: 1 1 auto; min-width: 0; }
  /* Permanently expanded on desktop: hide the toggle, force the nav visible even
     if the user left it collapsed on a narrower viewport before resizing. */
  .compliance-index-sidebar .ci-summary { display: none; }
  .compliance-index-sidebar .ci-collapse > .ci-nav { display: block; }
}

/* Rows 2–4: 3×3 grid of summary tiles. */
.dashboard-top-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

/* Collapse both to a single column on narrow screens. */
@media (max-width: 800px) {
  .dashboard-header-pair,
  .dashboard-top-grid {
    grid-template-columns: 1fr;
  }
}

/* Reserved placeholder tiles — visually distinct, non-interactive. */
.tile-placeholder {
  background: var(--epic-gray-50, #F9FAFB);
  border: 1px dashed #D1D5DB !important;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  box-shadow: none;
}
.placeholder-label {
  color: #9CA3AF;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Detail pages (/detail/<slug>) — shared shell layout. */
.detail-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}
.topbar .back-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--epic-blue, #00ADEF);
  text-decoration: none;
  white-space: nowrap;
}
.topbar .back-link:hover { text-decoration: underline; }
#detail-title {
  flex: 1;
  margin: 0;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
}

/* v24 dark-mode parity */
@media (prefers-color-scheme: dark) {
  .tile-placeholder {
    background: #1C1C1C;
    border-color: #3A3A3A !important;
  }
  .placeholder-label { color: #6B6B6B; }
}

/* ============================================================ */
/* v25 — event drilldown / bar day / marketing window / tickets  */
/*       analytics workbench / staff docs + compliance matrix    */
/* ============================================================ */

/* ----- Marketing window picker (A3) — tile + detail page ----- */
/* Selector + trend share one flex row so the picker adds no net  */
/* vertical height to the summary tile (pitfall 4).               */
.mkt-window-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 6px 0 8px;
  font-size: 12px;
}
.mkt-window-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-weight: 600;
}
.mkt-window-select {
  font: inherit;
  font-size: 12px;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--epic-white);
  color: var(--ink);
}
.mkt-trend { font-size: 12px; }

/* ----- Tickets analytics workbench (D) ----- */
.an-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}
.an-toolbar label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.an-toolbar select,
.an-sort-label select {
  font: inherit;
  font-size: 13px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--epic-white);
  color: var(--ink);
}
.an-period-line { font-size: 13px; margin: 4px 0 12px; }
.an-hero {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 8px;
}
.an-kpi {
  background: var(--warm-grey);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
}
.an-kpi-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.an-kpi-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
  margin: 2px 0;
  font-variant-numeric: tabular-nums;
}
.an-kpi-delta { min-height: 20px; }
.an-pill {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 999px;
}
.an-pill-up   { background: #DCFCE7; color: #166534; }
.an-pill-down { background: #FEE2E2; color: #991B1B; }
.an-pill-flat { background: var(--epic-gray-200, #E5E7EB); color: var(--epic-gray-700, #374151); }
.an-revenue-note, .an-note { font-size: 12px; margin: 4px 0 0; }
.an-graph { margin-top: 24px; }
.an-graph-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.an-graph h4 { margin: 0 0 4px; font-size: 16px; }
.an-sort-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
/* Chart.js needs a sized, position:relative wrapper (maintainAspectRatio:false). */
.an-chart-wrap {
  position: relative;
  height: 300px;
  margin-top: 8px;
}
@media (max-width: 800px) {
  .an-hero { grid-template-columns: repeat(2, 1fr); }
}

/* ----- Staff documents (C) ----- */
.doc-card { margin-bottom: 12px; }
.doc-meta { font-size: 12px; margin: 2px 0 8px; }
.doc-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.doc-open-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--epic-blue, #00ADEF);
  text-decoration: none;
}
.doc-open-link:hover { text-decoration: underline; }
.doc-accept-btn {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border: 1px solid var(--epic-green, #8EC63F);
  border-radius: 8px;
  background: var(--epic-green, #8EC63F);
  color: #14361F;
  cursor: pointer;
}
.doc-accept-btn:disabled {
  background: var(--epic-gray-200, #E5E7EB);
  border-color: var(--epic-gray-200, #E5E7EB);
  color: var(--muted);
  cursor: not-allowed;
}

/* ----- Compliance matrix (C, admin) ----- */
.cmp-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  margin: 8px 0 12px;
}
.cmp-table-wrap { overflow-x: auto; }
.cmp-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
}
.cmp-table th, .cmp-table td {
  border: 1px solid var(--line);
  padding: 6px 8px;
  text-align: center;
}
.cmp-table th.cmp-user, .cmp-table td.cmp-user {
  text-align: left;
  white-space: nowrap;
  font-weight: 600;
}
.cmp-doc { font-weight: 600; }
.cmp-cell { font-weight: 700; }
.cmp-current { color: #166534; }
.cmp-stale   { color: #92400E; }
.cmp-unread  { color: #991B1B; }

/* ----- v25 dark-mode parity ----- */
@media (prefers-color-scheme: dark) {
  .mkt-window-select,
  .an-toolbar select,
  .an-sort-label select {
    background: #1C1C1C;
    color: #F4F4F4;
    border-color: #3A3A3A;
  }
  .an-kpi { background: #1C1C1C; border-color: #2A2A2A; }
  .an-pill-up   { background: #14361F; color: #6ED394; }
  .an-pill-down { background: #3A1313; color: #F18C8C; }
  .an-pill-flat { background: #2F2F2F; color: #C9C7C2; }
  .doc-accept-btn:disabled { background: #2F2F2F; border-color: #2F2F2F; }
  .cmp-table th, .cmp-table td { border-color: #2A2A2A; }
  .cmp-current { color: #6ED394; }
  .cmp-stale   { color: #F2C765; }
  .cmp-unread  { color: #F18C8C; }
}

/* ============================================================ */
/* v25.5 — Competitors tile + detail page                       */
/* ============================================================ */
.comp-hero { margin-bottom: 12px; }
.comp-hero-num { font-size: 40px; font-weight: 800; line-height: 1; }
.comp-hero-label { font-size: 13px; color: var(--muted, #6B7280); margin-top: 2px; }
.comp-event-row { font-size: 12px; color: var(--muted, #6B7280); padding: 3px 0; border-top: 1px solid var(--line, #E5E7EB); }
.comp-event-row:first-child { border-top: none; }
.comp-freshness { font-size: 11px; color: var(--muted, #6B7280); margin-top: 8px; }

/* Competitors detail page */
.comp-period-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.comp-period-btn { padding: 6px 14px; border: 1px solid var(--line, #E5E7EB); border-radius: 6px;
  background: none; cursor: pointer; font-size: 13px; font-weight: 500; }
.comp-period-btn.active { background: var(--epic-primary, #1a1a1a); color: #fff; border-color: var(--epic-primary, #1a1a1a); }
.comp-tabs { display: flex; gap: 0; border-bottom: 2px solid var(--line, #E5E7EB); margin-bottom: 20px; }
.comp-tab { padding: 10px 18px; border: none; background: none; cursor: pointer; font-size: 14px;
  font-weight: 500; color: var(--muted, #6B7280); border-bottom: 2px solid transparent; margin-bottom: -2px; }
.comp-tab.active { color: var(--epic-primary, #1a1a1a); border-bottom-color: var(--epic-primary, #1a1a1a); }
.comp-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.comp-table th { text-align: left; padding: 8px 10px; font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.4px; color: var(--muted, #6B7280);
  border-bottom: 1px solid var(--line, #E5E7EB); }
.comp-table td { padding: 8px 10px; border-bottom: 1px solid var(--line, #E5E7EB); }
.comp-table tr:hover td { background: var(--hover, rgba(0,0,0,0.03)); }
.comp-sold-out { background: #DCFCE7; color: #166534; font-size: 11px; font-weight: 700;
  padding: 1px 6px; border-radius: 99px; }
.comp-fit-pill { display: inline-block; min-width: 32px; text-align: center; font-size: 11px;
  font-weight: 700; padding: 2px 6px; border-radius: 99px; }
.comp-fit-high { background: #DCFCE7; color: #166534; }
.comp-fit-mid  { background: #FEF3C7; color: #92400E; }
.comp-fit-low  { background: #FEE2E2; color: #991B1B; }

/* Outreach pipeline kanban */
.outreach-kanban { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.outreach-col { background: var(--surface, #F9FAFB); border-radius: 8px; padding: 12px; min-height: 120px; }
.outreach-col-title { font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 10px; color: var(--muted, #6B7280); }
.outreach-card { background: #fff; border: 1px solid var(--line, #E5E7EB); border-radius: 6px;
  padding: 8px 10px; margin-bottom: 8px; font-size: 12px; }
.outreach-card strong { display: block; font-size: 13px; margin-bottom: 2px; }
.outreach-btn { font-size: 11px; padding: 3px 8px; border-radius: 4px; border: 1px solid var(--line, #E5E7EB);
  background: none; cursor: pointer; margin-top: 4px; margin-right: 4px; }
.outreach-btn-primary { background: var(--epic-primary, #1a1a1a); color: #fff; border-color: var(--epic-primary, #1a1a1a); }
.outreach-modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 1000;
  display: flex; align-items: center; justify-content: center; }
.outreach-modal { background: #fff; border-radius: 12px; padding: 24px; max-width: 600px; width: 90%;
  max-height: 80vh; overflow-y: auto; }
.outreach-modal h3 { margin: 0 0 16px; }
.outreach-modal textarea { width: 100%; min-height: 200px; padding: 10px; border: 1px solid var(--line, #E5E7EB);
  border-radius: 6px; font-family: inherit; font-size: 13px; resize: vertical; box-sizing: border-box; }
.outreach-modal-footer { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }

/* ============================================================ */
/* v25.5 — Accounts detail pages (YTD/MTD + YoY graphs)        */
/* ============================================================ */
.acct-kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 24px; }
.acct-kpi { background: var(--surface, #F9FAFB); border: 1px solid var(--line, #E5E7EB);
  border-radius: 8px; padding: 16px; }
.acct-kpi-value { font-size: 28px; font-weight: 800; line-height: 1; }
.acct-kpi-label { font-size: 12px; color: var(--muted, #6B7280); margin-top: 4px; font-weight: 500; }
.acct-yoy-pill { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px;
  border-radius: 99px; margin-top: 4px; }
.acct-yoy-up   { background: #DCFCE7; color: #166534; }
.acct-yoy-down { background: #FEE2E2; color: #991B1B; }
.acct-yoy-flat { background: #F3F4F6; color: #6B7280; }
.acct-chart-wrap { position: relative; height: 240px; margin-bottom: 24px; }
.acct-section-title { font-size: 16px; font-weight: 700; margin: 24px 0 12px; }
.acct-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.acct-table th { text-align: left; padding: 8px 10px; font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.4px; color: var(--muted, #6B7280);
  border-bottom: 1px solid var(--line, #E5E7EB); }
.acct-table td { padding: 8px 10px; border-bottom: 1px solid var(--line, #E5E7EB); }
.acct-table tr:hover td { background: var(--hover, rgba(0,0,0,0.03)); }
.acct-no-data { padding: 24px 0; text-align: center; color: var(--muted, #6B7280); font-size: 14px; }

@media (prefers-color-scheme: dark) {
  .comp-period-btn { border-color: #3A3A3A; }
  .comp-period-btn.active { background: #F4F4F4; color: #111; border-color: #F4F4F4; }
  .comp-tab.active { color: #F4F4F4; border-bottom-color: #F4F4F4; }
  .outreach-card { background: #1C1C1C; border-color: #2A2A2A; }
  .outreach-modal { background: #1C1C1C; }
  .acct-kpi { background: #1C1C1C; border-color: #2A2A2A; }
}

/* COMPETITORS v27.1.1 — local calendar: range bar, venue chips, social row */
.comp-range-bar { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 14px; }
.comp-range-btn { padding: 6px 14px; border: 1px solid var(--line, #E5E7EB); border-radius: 6px;
  background: none; cursor: pointer; font-size: 13px; font-weight: 500; }
.comp-range-btn.active { background: var(--epic-primary, #1a1a1a); color: #fff; border-color: var(--epic-primary, #1a1a1a); }
.comp-venue-chiprow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.comp-chip-tools { display: inline-flex; gap: 6px; }
.comp-chip-tool { font-size: 11px; padding: 3px 8px; border: 1px dashed var(--line, #E5E7EB);
  border-radius: 6px; background: none; cursor: pointer; color: var(--muted, #6B7280); }
.comp-venue-chip { font-size: 12px; padding: 4px 10px; border: 1px solid var(--line, #E5E7EB);
  border-radius: 99px; background: none; cursor: pointer; color: var(--muted, #6B7280); }
.comp-venue-chip.on { background: #EEF2FF; color: #3730A3; border-color: #C7D2FE; }
.comp-venue-chip.off { opacity: 0.55; text-decoration: line-through; }
.comp-venue-count { font-weight: 700; margin-left: 4px; }
.comp-cal-summary { font-size: 12px; margin-bottom: 10px; }
.comp-cal-soldout { background: #FEE2E2; color: #991B1B; font-size: 11px; font-weight: 700;
  padding: 1px 6px; border-radius: 99px; }
.comp-social-presence { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.comp-social-label { font-size: 12px; font-weight: 600; color: var(--muted, #6B7280); }
.comp-social-link { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 99px;
  background: #F3F4F6; color: #1a1a1a; text-decoration: none; }
.comp-social-link:hover { background: #E5E7EB; }
@media (prefers-color-scheme: dark) {
  .comp-range-btn { border-color: #3A3A3A; }
  .comp-range-btn.active { background: #F4F4F4; color: #111; border-color: #F4F4F4; }
  .comp-venue-chip { border-color: #3A3A3A; }
  .comp-venue-chip.on { background: #312E81; color: #E0E7FF; border-color: #4338CA; }
  .comp-social-link { background: #2A2A2A; color: #F4F4F4; }
  .comp-social-link:hover { background: #3A3A3A; }
}

/* ============================================================
   Severity ladder — event economics grading
   Use class `.sev-pill.<tier>` for inline labels,
   or `.sev-dot.<tier>` for the small status dot.
   Tiers: stellar / strong / healthy / watch / concern / poor / critical / info
   ============================================================ */
.sev-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border: 1px solid transparent;
  line-height: 1.4;
}
.sev-pill.stellar  { background: var(--sev-stellar-50);  color: var(--sev-stellar);  border-color: var(--sev-stellar); }
.sev-pill.strong   { background: var(--sev-strong-50);   color: #4D6E1F;             border-color: var(--sev-strong); }
.sev-pill.healthy  { background: var(--sev-healthy-50);  color: #5A7821;             border-color: var(--sev-healthy); }
.sev-pill.watch    { background: var(--sev-watch-50);    color: var(--sev-watch);    border-color: var(--sev-watch); }
.sev-pill.concern  { background: var(--sev-concern-50);  color: var(--sev-concern);  border-color: var(--sev-concern); }
.sev-pill.poor     { background: var(--sev-poor-50);     color: var(--sev-poor);     border-color: var(--sev-poor); }
.sev-pill.critical { background: var(--sev-critical-50); color: var(--sev-critical); border-color: var(--sev-critical); }
.sev-pill.info     { background: var(--sev-info-50);     color: var(--sev-info);     border-color: var(--sev-info); }

.sev-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--epic-gray-200);
}
.sev-dot.stellar  { background: var(--sev-stellar); }
.sev-dot.strong   { background: var(--sev-strong); }
.sev-dot.healthy  { background: var(--sev-healthy); }
.sev-dot.watch    { background: var(--sev-watch); }
.sev-dot.concern  { background: var(--sev-concern); }
.sev-dot.poor     { background: var(--sev-poor); }
.sev-dot.critical { background: var(--sev-critical); }
.sev-dot.info     { background: var(--sev-info); }

/* Severity stripe — full-width 4px bar at the top of a tile/card */
.sev-stripe {
  display: block;
  height: 4px;
  border-radius: 4px 4px 0 0;
  margin: -16px -16px 12px;
  background: var(--epic-gray-200);
}
.sev-stripe.stellar  { background: var(--sev-stellar); }
.sev-stripe.strong   { background: var(--sev-strong); }
.sev-stripe.healthy  { background: var(--sev-healthy); }
.sev-stripe.watch    { background: var(--sev-watch); }
.sev-stripe.concern  { background: var(--sev-concern); }
.sev-stripe.poor     { background: var(--sev-poor); }
.sev-stripe.critical { background: var(--sev-critical); }
.sev-stripe.info     { background: var(--sev-info); }

/* Numeric value coloured by severity (use on the big £profit number) */
.sev-value.stellar  { color: var(--sev-stellar); }
.sev-value.strong   { color: var(--sev-strong); }
.sev-value.healthy  { color: #5A7821; } /* darken pale-green for contrast on white */
.sev-value.watch    { color: var(--sev-watch); }
.sev-value.concern  { color: var(--sev-concern); }
.sev-value.poor     { color: var(--sev-poor); }
.sev-value.critical { color: var(--sev-critical); }
.sev-value.info     { color: var(--sev-info); }

@media (prefers-color-scheme: dark) {
  .sev-pill.strong  { color: #B8D680; }
  .sev-pill.healthy { color: #C9DD8E; }
  .sev-value.healthy { color: #C9DD8E; }
}

/* =========================================================
   v26.10c — Tile source links
   ========================================================= */
.tile-source-link {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
  font-size: 12px;
}
.tile-source-link a {
  color: var(--epic-blue);
  text-decoration: none;
  font-weight: 600;
}
.tile-source-link a:hover { text-decoration: underline; }

/* =========================================================
   v26.10b — Role override dropdown in role matrix
   ========================================================= */
.role-override-sel {
  font-size: 13px;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg-card);
  color: var(--text-main);
  cursor: pointer;
  transition: border-color 0.2s;
}
.role-override-sel:focus { outline: 2px solid var(--epic-blue); }

/* =========================================================
   v26.10a — Bar sparkline clickable columns
   ========================================================= */
.bar-spark-clickable:hover .bar-spark-fill {
  filter: brightness(1.15);
}
.bar-spark-clickable:hover {
  opacity: 0.85;
}

/* =========================================================
   v26.10e — Brevo campaign drawer
   ========================================================= */
.campaign-drawer {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 900;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 16px;
}
.campaign-drawer[hidden] { display: none; }
.campaign-drawer-inner {
  background: var(--bg-card);
  border-radius: 12px;
  width: min(680px, 96vw);
  max-height: 92vh;
  overflow-y: auto;
  padding: 24px;
  position: relative;
  box-shadow: 0 8px 40px rgba(0,0,0,0.25);
}
.campaign-drawer-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-secondary);
  line-height: 1;
}
.campaign-drawer-close:hover { color: var(--text-main); }
.brevo-drawer-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0;
}
.brevo-drawer-actions a {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--line);
  color: var(--epic-blue);
  transition: background 0.15s;
}
.brevo-drawer-actions a:hover { background: var(--bg-hover); }
.brevo-preview-text {
  font-size: 13px;
  color: var(--text-secondary);
  font-style: italic;
  margin: 4px 0 12px;
}

/* =========================================================
   v27.0 — Event Economics Checker form
   ========================================================= */
.econ-form {
  display: grid;
  gap: 10px;
  max-width: 460px;
  margin-top: 16px;
}
.econ-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}
.econ-form input, .econ-form select {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 14px;
}
.econ-result-grid {
  display: grid;
  grid-template-columns: 1fr span 2;
  gap: 12px;
  margin-top: 12px;
}
.econ-result-hero {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}
.econ-score-ratio {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
}
.econ-breakdown {
  font-size: 13px;
}

/* ===== v27.0.9 — Custom tooltip engine (data-tt) ===== */
/* Defaults BELOW the trigger; flips ABOVE when there's <80px below. Floats over
   every tile/header/modal (z-9999) and never blocks clicks (pointer-events). */
.tt-trigger { position: relative; }
.tt-pop {
  position: fixed;
  z-index: 9999;
  background: #1a1a1a;
  color: #fff;
  font-size: 12px;
  line-height: 1.4;
  padding: 6px 10px;
  border-radius: 6px;
  max-width: 280px;
  pointer-events: none;
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 120ms, transform 120ms;
}
.tt-pop.tt-show { opacity: 1; transform: translateY(0); }
.tt-pop::before {
  content: '';
  position: absolute;
  left: 12px;
  width: 0; height: 0;
  border: 5px solid transparent;
}
.tt-pop.tt-below::before {
  top: -10px;
  border-bottom-color: #1a1a1a;
}
.tt-pop.tt-above::before {
  bottom: -10px;
  border-top-color: #1a1a1a;
}

/* ===== v27.0.9 — Per-tile admin Refresh button ===== */
.tile-refresh-btn {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
  width: 24px;
  height: 24px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  color: var(--muted);
  margin-right: 6px;
}
.tile-refresh-btn:hover { background: var(--warm-grey); color: var(--ink); }
.tile-refresh-btn.spinning { animation: spin 0.8s linear infinite; }
@keyframes spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
.tile-refresh-btn[hidden] { display: none; }

/* Refresh-failure modal (NOT a browser alert) */
.tile-refresh-modal-backdrop {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
}
.tile-refresh-modal {
  background: #fff; border-radius: 10px; padding: 20px 22px;
  max-width: 420px; width: calc(100% - 40px);
  box-shadow: 0 10px 40px rgba(0,0,0,0.25);
}
.tile-refresh-modal h3 { margin: 0 0 8px; font-size: 16px; color: var(--ink); }
.tile-refresh-modal p { margin: 6px 0; font-size: 13px; color: var(--ink); }
.tile-refresh-modal .trm-hint { color: var(--muted); }
.tile-refresh-modal .trm-actions { margin-top: 14px; display: flex; gap: 8px; justify-content: flex-end; }
.tile-refresh-modal button {
  border: 1px solid var(--line); background: #fff; border-radius: 6px;
  padding: 6px 12px; cursor: pointer; font-size: 13px;
}
.tile-refresh-modal button.trm-primary { background: var(--epic-blue); color: #fff; border-color: var(--epic-blue); }

/* ===== v27.0.9 — Competitor data-provenance panel ===== */
.data-provenance { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 12px; }
.data-provenance > summary { cursor: pointer; font-weight: 600; color: var(--ink); font-size: 14px; }
.data-provenance table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 13px; }
.data-provenance th, .data-provenance td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.data-provenance .dp-status { font-size: 11px; padding: 2px 6px; border-radius: 4px; background: var(--warm-grey); color: var(--muted); }
.data-provenance .dp-status.manual { background: #FDECCB; color: #8a5a00; }
.data-provenance .dp-status.derived { background: #D6F0FB; color: #02607f; }
.data-provenance .dp-roadmap { margin-top: 10px; font-size: 12px; color: var(--muted); font-style: italic; }

/* ===== v27.0.9 — Staff doc Read & Accept buttons ===== */
.doc-accept-btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.doc-row.accepted { background: #EEF8E2; }
.doc-accepted-stamp { font-size: 12px; color: var(--sev-strong); font-weight: 600; }

/* ============================================================
   v27.1.4 — Marketing tile: "View email" CTA + email preview
   modal + social-presence cards.
   ============================================================ */

/* --- "View email ↗" CTA on each campaign card (detail) --- */
.brevo-campaign-card header { display: flex; align-items: center; gap: 10px; }
.brevo-campaign-card header h4 { margin: 0; flex: 1; }
.brevo-view-email {
  border: 1px solid var(--primary, #01696f);
  background: var(--primary, #01696f);
  color: #fff;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.brevo-view-email:hover { filter: brightness(1.08); }
.brevo-card-clickable { cursor: pointer; transition: border-color 0.12s, box-shadow 0.12s; }
.brevo-card-clickable:hover { border-color: var(--primary, #01696f); box-shadow: 0 2px 10px rgba(1,105,111,0.12); }

/* --- Email preview modal (sandboxed iframe; no allow-scripts) --- */
.mkt-email-meta { font-size: 0.85rem; line-height: 1.5; margin-bottom: 12px; }
.mkt-email-meta .mkt-email-preview { font-style: italic; color: var(--text-muted, #6b6b66); margin: 2px 0; }
.mkt-email-frame-wrap {
  border: 1px solid var(--border, #e6e6e2);
  border-radius: 8px;
  overflow: hidden;
  background: #fff; /* emails assume a white canvas, even in dark mode */
}
.mkt-email-frame { display: block; width: 100%; height: 62vh; border: 0; background: #fff; }
.mkt-email-footer {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px; border-top: 1px solid var(--border, #e6e6e2);
}
.mkt-email-footer .btn-secondary {
  margin-left: auto;
  border: 1px solid var(--border, #ccc);
  background: var(--surface-alt, #f5f4ee);
  color: var(--text, #28251d);
  border-radius: 6px; padding: 6px 12px; font-size: 0.85rem;
  text-decoration: none; cursor: pointer;
}
.mkt-email-footer .btn-secondary:hover { border-color: var(--primary, #01696f); }
.mkt-email-footer .btn-link { margin-left: 0; }

/* --- Social presence cards (detail page) --- */
.social-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}
.social-card {
  background: #FAFAF8;
  border: 1px solid #ECEAE6;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 6px;
}
.social-card-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.social-card-name { font-weight: 700; color: #1A1A1A; }
.social-card-handle { font-size: 0.8rem; color: var(--primary, #01696f); text-decoration: none; }
.social-card-handle:hover { text-decoration: underline; }
.social-card-followers { display: flex; align-items: baseline; gap: 6px; }
.social-card-count { font-size: 1.5rem; font-weight: 700; color: #1A1A1A; font-variant-numeric: tabular-nums lining-nums; }
.social-card-noun { font-size: 0.78rem; color: #7A7974; }
.social-card-delta { margin-left: 4px; font-weight: 600; }
.social-card-delta.up { color: var(--sev-strong, #4D7A1F); }
.social-card-delta.down { color: var(--error, #a12c7b); }
.social-card-metric { font-size: 0.78rem; color: #7A7974; }
.social-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 0.75rem; margin-top: 2px; }
.social-card-top { color: var(--primary, #01696f); text-decoration: none; font-weight: 600; }
.social-card-top:hover { text-decoration: underline; }
.social-badge {
  font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
  padding: 2px 7px; border-radius: 99px;
}
.social-badge-manual { background: #FDECCB; color: #8a5a00; }
.social-badge-pending { background: #E5E7EB; color: #4B5563; }

/* v27.1.4b — freshness dot on each social card (green <25h / amber 25–72h / red) */
.social-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
.social-dot-green { background: #4D7A1F; }
.social-dot-amber { background: #C98A00; }
.social-dot-red { background: #C0392B; }

/* v27.1.8 — multi-brand social: brand columns + clickable platform rows */
.social-brand-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.social-brand-grid-multi { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.social-brand-col { display: flex; flex-direction: column; gap: 8px; }
.social-brand-title { font-size: 0.85rem; font-weight: 700; color: #1A1A1A; margin: 2px 0; text-transform: uppercase; letter-spacing: 0.03em; }
/* v27.3.2 — sub-brand (e.g. The Green Room) nested under its parent brand column */
.social-subbrand { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; padding-left: 10px; border-left: 2px solid #ECEAE6; }
.social-subbrand-title { font-size: 0.72rem; font-weight: 600; color: #6B7280; margin: 2px 0; text-transform: uppercase; letter-spacing: 0.03em; }

.social-row {
  display: flex; align-items: flex-start; gap: 10px;
  background: #FAFAF8; border: 1px solid #ECEAE6; border-radius: 10px;
  padding: 10px 12px; cursor: pointer; transition: box-shadow 0.12s, border-color 0.12s;
}
.social-row:hover, .social-row:focus-visible { border-color: #00ADEF; box-shadow: 0 1px 8px rgba(0,0,0,0.07); outline: none; }
.social-row-icon {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.95rem; color: #FFFFFF; background: #6B7280;
}
.social-icon-facebook { background: #00ADEF; }
.social-icon-instagram { background: #ED1B24; }
.social-icon-tiktok { background: #000000; }
.social-icon-youtube { background: #ED1B24; }
.social-row-main { flex: 1 1 auto; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.social-row-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.social-row-name { font-weight: 700; color: #1A1A1A; }
.social-row-handle { font-size: 0.8rem; }
.social-row-metric { display: flex; align-items: baseline; gap: 5px; }
.social-row-count { font-size: 1.25rem; font-weight: 700; color: #1A1A1A; font-variant-numeric: tabular-nums lining-nums; }
.social-row-noun { font-size: 0.76rem; color: #7A7974; }
.social-row-deltas { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.social-row-eng { font-size: 0.76rem; color: #7A7974; }
.social-row-updated { flex: 0 0 auto; font-size: 0.72rem; }
.social-link { color: #00ADEF; text-decoration: none; font-weight: 600; }
.social-link:hover { text-decoration: underline; }

/* Delta chips — palette only: green up / red down / gray flat / muted unknown */
.sdelta {
  display: inline-flex; align-items: baseline; gap: 3px;
  font-size: 0.74rem; font-weight: 700; font-variant-numeric: tabular-nums lining-nums;
  padding: 1px 7px; border-radius: 99px; white-space: nowrap;
}
.sdelta-win { font-size: 0.64rem; font-weight: 600; opacity: 0.7; }
.sdelta-up { background: #8EC63F; color: #1A1A1A; }
.sdelta-down { background: #ED1B24; color: #FFFFFF; }
.sdelta-zero { background: #6B7280; color: #FFFFFF; }
.sdelta-none { background: transparent; color: #6B7280; }

/* v27.2.0 — generic KPI delta-chip wrappers, reused by the bar, events, social
   and finance tiles. The chips themselves are the .sdelta* set above (brand
   palette only); these are just layout. */
.kpi-delta-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.kpi-delta-line { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; margin-top: 3px; }
.kpi-delta-line-label { font-size: 0.76rem; font-weight: 600; color: #7A7974; min-width: 4.5rem; }
.bar-deltas-section { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border, #ECEAE6); }
.ev-kpi-banner { margin-bottom: 6px; }
/* Finance "Revenue vs prior year" section */
.fin-py-section { margin-top: 6px; }
.fin-py-chips { display: inline-flex; flex-wrap: wrap; gap: 5px; margin-left: 4px; }

/* Per-tile social detail page (/detail/social/:brand/:platform) */
.social-detail-header h3 { display: flex; align-items: center; gap: 8px; }
.social-detail-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.social-card-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: #7A7974; }
.social-card-value { font-size: 1.8rem; font-weight: 700; color: #1A1A1A; font-variant-numeric: tabular-nums lining-nums; }
.social-card-sub { font-size: 0.78rem; color: #7A7974; }
.social-card-deltas { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.social-top-post { display: flex; flex-direction: column; gap: 4px; }
.social-chart-wrap { width: 100%; overflow: hidden; }
.social-chart { display: block; width: 100%; height: 160px; }
/* v27.1.8b — YouTube category bar chart keeps its aspect ratio so the SVG labels
   stay legible (unlike .social-chart it is not squashed to a fixed height) + top-videos rank cell */
.social-cat-chart { display: block; width: 100%; height: auto; }
.social-cat-chart .social-cat-name { font-size: 14px; font-weight: 600; fill: #1A1A1A; }
.social-cat-chart .social-cat-count { font-size: 13px; fill: #7A7974; font-variant-numeric: tabular-nums lining-nums; }
.social-vid-rank { width: 2rem; text-align: right; color: #7A7974; font-variant-numeric: tabular-nums lining-nums; }

/* v27.1.4b — admin "Social API secrets" form */
.mkt-secrets { margin-top: 16px; border: 1px solid #ECEAE6; border-radius: 10px; padding: 4px 14px; background: #FAFAF8; }
.mkt-secrets > summary { cursor: pointer; font-weight: 700; color: #1A1A1A; padding: 8px 0; }
.mkt-secrets-body { padding: 8px 0 12px; display: flex; flex-direction: column; gap: 12px; }
.mkt-secret-row { display: flex; flex-direction: column; gap: 4px; }
.mkt-secret-label { font-size: 0.82rem; font-weight: 600; color: #1A1A1A; }
.mkt-secret-status { font-weight: 400; color: #7A7974; margin-left: 6px; }
.mkt-secret-controls { display: flex; gap: 8px; align-items: center; }
.mkt-secret-input { flex: 1 1 auto; min-width: 0; padding: 6px 8px; border: 1px solid #D8D6D1; border-radius: 6px; font-family: monospace; font-size: 0.82rem; }
.mkt-secret-controls .btn-secondary { padding: 6px 10px; border: 1px solid #D8D6D1; border-radius: 6px; background: #fff; color: #1A1A1A; font-size: 0.8rem; cursor: pointer; white-space: nowrap; }
.mkt-secret-controls .btn-secondary:hover { border-color: var(--primary, #01696f); }
.mkt-secret-test { font-size: 0.78rem; min-height: 1em; color: #7A7974; }
.mkt-secret-test.ok { color: #4D7A1F; }
.mkt-secret-test.err { color: #a12c7b; }
.mkt-secrets-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.mkt-secrets-msg { font-size: 0.8rem; }
.mkt-secrets-msg.ok { color: #4D7A1F; }
.mkt-secrets-msg.warn { color: #8a5a00; }
.mkt-secrets-msg.err { color: #a12c7b; }

/* --- Dashboard marketing tile: "View email" deep link + social one-liner --- */
.mkt-tile-viewrow { margin-top: 8px; }
.mkt-tile-view { font-size: 0.82rem; font-weight: 600; color: var(--primary, #01696f); text-decoration: none; }
.mkt-tile-view:hover { text-decoration: underline; }
.mkt-tile-social {
  margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border, #ECEAE6);
  font-size: 0.8rem; color: #4B5563; font-variant-numeric: tabular-nums lining-nums;
}
.mkt-tile-social-label { font-weight: 700; color: #1A1A1A; margin-right: 4px; }
.mkt-tile-social-line { margin-top: 4px; }
.mkt-tile-social-line:first-child { margin-top: 0; }
/* v27.3.2 — indented sub-brand line (Green Room under Epic Studios) */
.mkt-tile-social-subline { margin-top: 2px; padding-left: 12px; border-left: 2px solid var(--border, #ECEAE6); }
.mkt-tile-social-subline .mkt-tile-social-label { font-weight: 600; color: #6B7280; }
/* v27.2.0 — per-platform enrichment (follower Δ chips, engagement rate, reach Δ).
   Platforms wrap as flex groups so a brand with full data degrades gracefully. */
.mkt-social-row { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.mkt-social-plat { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 4px; }
.mkt-social-head { font-weight: 600; color: #1A1A1A; }
.mkt-social-eng { font-size: 0.74rem; color: #7A7974; }
.mkt-social-reach-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.03em; color: #7A7974; }

@media (prefers-color-scheme: dark) {
  .brevo-card-clickable:hover { box-shadow: 0 2px 10px rgba(0,0,0,0.4); }
  .mkt-email-meta .mkt-email-preview { color: #908C85; }
  .mkt-email-frame-wrap { border-color: #3A3934; }
  .mkt-email-footer { border-top-color: #3A3934; }
  .mkt-email-footer .btn-secondary { background: #2A2926; color: #F5F4F0; border-color: #3A3934; }

  .social-card { background: #222120; border-color: #3A3934; }
  .social-card-name { color: #F5F4F0; }
  .social-card-count { color: #F5F4F0; }
  .social-card-noun, .social-card-metric { color: #908C85; }
  .social-badge-manual { background: #4A3A18; color: #F5C97A; }
  .social-badge-pending { background: #2A2926; color: #B0ADA6; }

  .social-row { background: #222120; border-color: #3A3934; }
  .social-row-name, .social-row-count { color: #F5F4F0; }
  .social-row-noun, .social-row-eng { color: #908C85; }
  .social-brand-title { color: #F5F4F0; }
  .social-subbrand { border-left-color: #3A3934; }
  .social-subbrand-title { color: #B0ADA6; }
  .mkt-tile-social-subline { border-left-color: #3A3934; }
  .mkt-tile-social-subline .mkt-tile-social-label { color: #B0ADA6; }
  .social-card-label, .social-card-sub { color: #908C85; }
  .social-card-value { color: #F5F4F0; }
  .social-cat-chart .social-cat-name { fill: #F5F4F0; }
  .social-cat-chart .social-cat-count { fill: #908C85; }
  .sdelta-zero { background: #4B5563; }
  .sdelta-none { color: #908C85; }

  .mkt-secrets { background: #222120; border-color: #3A3934; }
  .mkt-secrets > summary { color: #F5F4F0; }
  .mkt-secret-label { color: #F5F4F0; }
  .mkt-secret-input { background: #1A1918; color: #F5F4F0; border-color: #3A3934; }
  .mkt-secret-controls .btn-secondary { background: #2A2926; color: #F5F4F0; border-color: #3A3934; }

  .mkt-tile-social { border-top-color: #3A3934; color: #B0ADA6; }
  .mkt-tile-social-label { color: #F5F4F0; }
  .mkt-social-head { color: #F5F4F0; }
  .kpi-delta-line-label, .mkt-social-eng, .mkt-social-reach-label { color: #908C85; }
}

/* v27.1.6 — events: epic-tv.com ↗ link on tile rows + full event detail view */
.ev-ext-link { color: var(--primary, #01696f); text-decoration: none; font-weight: 700; margin-left: 4px; }
.ev-ext-link:hover { text-decoration: underline; }
.ev-detail-header h3 { display: flex; align-items: center; gap: 8px; }
.ev-status-dot { width: 11px; height: 11px; }
.ev-detail-sub { color: #7A7974; font-size: 0.9rem; margin: 2px 0 8px; }
.ev-public-links { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 4px; }
.ev-public-link { color: var(--primary, #01696f); text-decoration: none; font-weight: 600; font-size: 0.88rem; }
.ev-public-link:hover { text-decoration: underline; }
.ev-detail-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; font-variant-numeric: tabular-nums lining-nums; }
.ev-detail-table th, .ev-detail-table td { text-align: left; padding: 6px 10px; border-bottom: 1px solid #ECEAE6; }
.ev-detail-table th { color: #7A7974; font-weight: 600; }
.ev-sparkline-wrap { color: var(--primary, #01696f); }
.ev-sparkline { display: block; max-width: 100%; }
.ev-stat-row { display: flex; flex-wrap: wrap; gap: 18px; }
.ev-stat { display: flex; flex-direction: column; }
.ev-stat-k { font-size: 0.78rem; color: #7A7974; }
.ev-stat-v { font-size: 1.1rem; font-weight: 700; color: #1A1A1A; font-variant-numeric: tabular-nums lining-nums; }

@media (prefers-color-scheme: dark) {
  .ev-detail-sub { color: #B0ADA6; }
  .ev-detail-table th, .ev-detail-table td { border-bottom-color: #3A3934; }
  .ev-detail-table th { color: #B0ADA6; }
  .ev-stat-k { color: #B0ADA6; }
  .ev-stat-v { color: #F5F4F0; }
}

/* ── v27.5.1 — Universe-shaped Tickets page ─────────────────────────────── */

/* Top-level tab nav */
.tk-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--epic-gray-200, #E5E7EB);
  margin-bottom: 24px;
}
.tk-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  padding: 8px 20px;
  font-size: 15px;
  font-weight: 500;
  color: var(--muted, #6B7280);
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s;
}
.tk-tab:hover { color: var(--epic-blue, #00ADEF); }
.tk-tab.tk-tab-active {
  color: var(--epic-blue, #00ADEF);
  border-bottom-color: var(--epic-blue, #00ADEF);
}

/* Section headings */
.tk-section-head {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 16px;
}

/* Card grid */
.tk-card-grid { display: grid; gap: 16px; margin-bottom: 16px; }
.tk-card-grid-3 { grid-template-columns: repeat(3, 1fr); }
.tk-card-grid-4 { grid-template-columns: repeat(4, 1fr); }

.tk-card {
  background: #fff;
  border: 1px solid var(--epic-gray-200, #E5E7EB);
  border-radius: 10px;
  padding: 20px 20px 16px;
  min-height: 120px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
}
.tk-card-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted, #6B7280);
  margin-bottom: 8px;
}
.tk-card-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--epic-text, #111827);
  line-height: 1.1;
}
.tk-kpi-lg { font-size: 36px; }
.tk-card-delta { margin: 6px 0 8px; min-height: 22px; }
.tk-spark { margin-top: auto; }
.tk-sparkline { display: block; }

/* v27.8.3 — Overview range chips + comparison pills.
   (--bg-2/3, --border, --ink-1/2 aren't defined as tokens in this repo; the
   codebase uses them with inline fallbacks, so we do the same here.) */
.range-chip-group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px; }
.range-chip {
  padding: 6px 12px; border-radius: 18px; background: var(--bg-2, #F3F4F6);
  border: 1px solid var(--border, #E5E7EB); cursor: pointer; font: inherit;
  font-size: 13px; color: var(--ink-1, #374151);
}
.range-chip:hover { background: var(--bg-3, #E5E7EB); }
.range-chip.active { background: var(--epic-red); color: #fff; border-color: var(--epic-red); }
.range-chip-custom { display: inline-flex; align-items: center; gap: 4px; }
.range-chip-custom input[type=date] { font-size: 12px; padding: 2px 4px; }
.comp-pill-up   { color: var(--epic-green); font-weight: 600; }
.comp-pill-down { color: var(--epic-red);   font-weight: 600; }
.comp-pill-flat { color: var(--ink-2, #6B7280); font-weight: 600; }
.comp-caption   { color: var(--epic-blue);  font-size: 11px; }

/* Breakdown table card */
.tk-card-table { min-height: auto; }
.tk-breakdown-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.tk-breakdown-table thead th {
  text-align: left;
  font-weight: 600;
  color: var(--muted, #6B7280);
  border-bottom: 1px solid var(--epic-gray-200, #E5E7EB);
  padding: 4px 8px 6px;
}
.tk-breakdown-table tbody td {
  padding: 5px 8px;
  border-bottom: 1px solid #F3F4F6;
}
.tk-breakdown-table .tk-right { text-align: right; }

/* Pie card */
.tk-card-pie { align-items: center; }

/* Inline bar for % columns */
.tk-bar-bg {
  display: inline-block;
  background: #F3F4F6;
  border-radius: 2px;
  width: 80px;
  height: 8px;
  vertical-align: middle;
  margin-right: 4px;
  position: relative;
}
.tk-bar-fill {
  display: inline-block;
  background: var(--epic-blue, #00ADEF);
  border-radius: 2px;
  height: 8px;
  position: absolute;
  left: 0; top: 0;
}

/* Table cell alignment */
.tk-right { text-align: right; }
.tk-pct-green { color: #166534; font-weight: 600; }
.tk-pct-amber { color: #92400E; font-weight: 600; }
.tk-pct-red   { color: #991B1B; font-weight: 600; }

/* Table scroll */
.tk-table-scroll { overflow-x: auto; }

/* Chart */
.tk-chart-scroll { overflow-x: auto; }
.tk-dual-chart { display: block; }
.tk-chart-wrap {
  width: 100%;
  min-height: 280px;
  margin-top: 8px;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  .tk-card {
    background: #1C1C1C;
    border-color: #2A2A2A;
    color: #E5E7EB;
  }
  .tk-card-value { color: #F9FAFB; }
  .tk-breakdown-table thead th { color: #9CA3AF; }
  .tk-breakdown-table tbody td { border-color: #2A2A2A; }
  .tk-bar-bg { background: #2A2A2A; }
  .tk-pct-green { color: #6ED394; }
  .tk-pct-amber { color: #FCD34D; }
  .tk-pct-red   { color: #F18C8C; }
}

/* Responsive */
@media (max-width: 900px) {
  .tk-card-grid-3 { grid-template-columns: 1fr; }
  .tk-card-grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .tk-card-grid-4 { grid-template-columns: 1fr; }
  .tk-tab { padding: 8px 12px; font-size: 13px; }
}

/* v27.5.6 — view-as chip + picker */
#viewas-chip { margin-top: 4px; display: inline-flex; align-items: center; gap: 6px; }
#viewas-chip .va-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; line-height: 1; padding: 4px 8px; border-radius: 999px;
  background: rgba(0,173,239,0.12); color: var(--epic-blue, #00ADEF);
  border: 1px solid rgba(0,173,239,0.4);
  cursor: pointer; user-select: none;
}
#viewas-chip .va-btn:hover { background: rgba(0,173,239,0.18); }
#viewas-chip .va-btn.va-active {
  background: rgba(216,142,28,0.14); color: var(--epic-amber, #D88E1C);
  border-color: rgba(216,142,28,0.5);
}
#viewas-chip .va-btn .va-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
#viewas-chip .va-clear {
  font-size: 11px; padding: 2px 6px; background: transparent;
  border: 1px solid rgba(255,255,255,0.2); border-radius: 6px;
  color: var(--epic-text-muted, #888); cursor: pointer;
}
#viewas-chip .va-clear:hover { color: var(--epic-red, #ED1B24); border-color: rgba(237,27,36,0.5); }

#viewas-modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 9999;
  display: flex; align-items: center; justify-content: center;
}
#viewas-modal {
  background: var(--epic-bg, #1a1a1a); color: var(--epic-text, #eee);
  border-radius: 14px; padding: 20px 22px;
  width: min(420px, 92vw); max-height: 80vh; overflow: auto;
  box-shadow: 0 12px 48px rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.08);
}
#viewas-modal h3 { margin: 0 0 6px; font-size: 16px; }
#viewas-modal .va-sub { font-size: 12px; color: var(--epic-text-muted, #999); margin-bottom: 16px; }
#viewas-modal .va-section-title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--epic-text-muted, #999); margin: 12px 0 6px; }
#viewas-modal .va-role-row { display: flex; gap: 6px; flex-wrap: wrap; }
#viewas-modal .va-role-chip {
  padding: 6px 12px; border-radius: 999px;
  background: rgba(255,255,255,0.06); color: var(--epic-text, #eee);
  border: 1px solid rgba(255,255,255,0.1);
  font-size: 13px; cursor: pointer;
}
#viewas-modal .va-role-chip.selected {
  background: var(--epic-blue, #00ADEF); color: #fff; border-color: var(--epic-blue, #00ADEF);
}
#viewas-modal select {
  width: 100%; padding: 8px 10px; border-radius: 8px;
  background: rgba(255,255,255,0.06); color: var(--epic-text, #eee);
  border: 1px solid rgba(255,255,255,0.1); font-size: 13px;
}
#viewas-modal .va-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
#viewas-modal .va-actions button {
  padding: 8px 14px; border-radius: 8px; font-size: 13px; cursor: pointer;
  border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.06);
  color: var(--epic-text, #eee);
}
#viewas-modal .va-actions .va-apply {
  background: var(--epic-blue, #00ADEF); border-color: var(--epic-blue, #00ADEF); color: #fff;
}
#viewas-modal .va-actions .va-cancel:hover { background: rgba(255,255,255,0.1); }

/* v27.6 — event-detail Sales summary header + Refresh-now button + Broken pill */
.ev-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ev-section-head h3 { margin: 0; }
.ev-section-head-actions { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.ev-tc-refreshed { font-size: 12px; }
.ev-tc-refresh-btn {
  appearance: none; border: 1px solid var(--epic-blue, #00ADEF); background: transparent;
  color: var(--epic-blue, #00ADEF); padding: 4px 10px; border-radius: 999px;
  font: inherit; font-size: 12px; cursor: pointer; line-height: 1.4;
}
.ev-tc-refresh-btn:hover:not(:disabled) { background: rgba(0,173,239,0.10); }
.ev-tc-refresh-btn:disabled { opacity: 0.6; cursor: progress; }

.ev-broken-pill {
  display: inline-block; padding: 1px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600; line-height: 1.5;
}
.ev-broken-yes { background: rgba(237,27,36,0.14); color: #991B1B; }
.ev-broken-no  { background: rgba(142,198,63,0.18); color: #166534; }
@media (prefers-color-scheme: dark) {
  .ev-broken-yes { color: #F18C8C; }
  .ev-broken-no  { color: #6ED394; }
}

/* ───────────────────────────────────────────────────────────────────────
   v27.7 — Staff-doc legal accept modal (openAcceptModal in detail.js)
   ─────────────────────────────────────────────────────────────────── */
.accept-modal { position: fixed; inset: 0; z-index: 1100; display: flex; align-items: center; justify-content: center; padding: 16px; }
.accept-modal-backdrop { position: absolute; inset: 0; background: rgba(15,18,22,0.6); }
.accept-modal-card {
  position: relative; background: var(--surface, #fff); width: min(96vw, 560px);
  max-height: 92vh; overflow-y: auto; border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3); padding: 22px 24px;
}
.accept-modal-card h3 { margin: 0 0 10px; font-size: 1.15rem; }
.accept-modal-reattest {
  background: rgba(216,142,28,0.12); border: 1px solid var(--epic-amber, #D88E1C);
  border-radius: 8px; padding: 10px 12px; margin: 0 0 14px; font-size: 0.9rem; color: #8a5a12;
}
.accept-modal-summary { margin: 0 0 6px; line-height: 1.5; }
.accept-modal-version { font-size: 0.8rem; margin: 0 0 16px; }
.accept-modal-row { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.accept-modal-row label { font-weight: 600; font-size: 0.9rem; }
.accept-modal-row input[type="text"] {
  padding: 9px 11px; border: 1px solid var(--border, #ddd); border-radius: 8px; font-size: 0.95rem;
}
.accept-modal-row small { font-size: 0.78rem; }
.accept-modal-attestation {
  display: flex; gap: 10px; align-items: flex-start; margin: 0 0 14px;
  font-size: 0.88rem; line-height: 1.5; cursor: pointer;
}
.accept-modal-attestation input[type="checkbox"] { margin-top: 3px; flex: 0 0 auto; width: 16px; height: 16px; }
.accept-modal-note { font-size: 0.82rem; margin: 0 0 12px; line-height: 1.45; }
.accept-modal-retention {
  font-size: 0.76rem; color: var(--text-muted, #6b6b66); line-height: 1.45;
  background: var(--surface-alt, #f5f4ee); border-radius: 8px; padding: 10px 12px; margin: 0 0 14px;
}
.accept-modal-status { font-size: 0.85rem; min-height: 1.2em; margin: 0 0 12px; color: var(--text, #28251d); }
.accept-modal-actions { display: flex; justify-content: flex-end; gap: 10px; }
.accept-modal-btn-secondary {
  background: none; border: 1px solid var(--border, #ddd); border-radius: 8px;
  padding: 9px 18px; cursor: pointer; font-size: 0.9rem; color: var(--text, #28251d);
}
.accept-modal-btn-secondary:hover { background: var(--surface-alt, #f5f4ee); }
.accept-modal-btn-primary {
  background: var(--epic-green, #8EC63F); border: 0; border-radius: 8px;
  padding: 9px 18px; cursor: pointer; font-size: 0.9rem; font-weight: 600; color: #14310a;
}
.accept-modal-btn-primary:hover:not(:disabled) { filter: brightness(0.96); }
.accept-modal-btn-primary:disabled { background: #c8ccc4; color: #6b6b66; cursor: not-allowed; }

/* v27.7 (section C) — admin compliance KPI strip on the Staff Documents page */
.compliance-kpi-strip {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: space-between;
}
.compliance-kpi-cells { display: flex; gap: 12px; flex-wrap: wrap; }
.compliance-kpi-cell {
  display: flex; flex-direction: column; gap: 4px; min-width: 120px;
  background: var(--surface-alt, #f5f4ee); border: 1px solid var(--border, #e6e6e2);
  border-radius: 8px; padding: 8px 12px;
}
.compliance-kpi-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted, #6b6b66); }
.compliance-kpi-chip { font-size: 0.95rem; }
.compliance-kpi-config-link { font-size: 0.85rem; white-space: nowrap; color: var(--epic-blue, #00ADEF); }

/* v27.8.0 — Context help system (?) buttons + modal */
.help-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; min-width: 22px; padding: 0;
  border-radius: 999px; border: 1px solid var(--border, #d8d8d2);
  background: transparent; color: var(--text-muted, #6b6b66);
  font-size: 0.78rem; font-weight: 700; line-height: 1; cursor: pointer;
  margin-left: 8px; flex-shrink: 0;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.help-btn:hover, .help-btn:focus-visible {
  background: var(--epic-blue, #00ADEF); color: #fff;
  border-color: var(--epic-blue, #00ADEF); outline: none;
}
.help-btn-section {
  width: 18px; height: 18px; min-width: 18px; font-size: 0.7rem;
  margin-left: 6px; vertical-align: middle;
}
.help-modal-panel { width: min(96vw, 640px) !important; }
.help-modal-title { margin: 0; font-size: 1.05rem; flex: 1; }
.help-modal-edit {
  background: transparent; border: 1px solid var(--border, #ddd);
  border-radius: 6px; padding: 4px 10px; font-size: 0.82rem; cursor: pointer;
  color: var(--text, #28251d);
}
.help-modal-edit:hover { background: var(--surface-alt, #f5f4ee); }
.help-modal-close {
  background: none; border: 0; font-size: 1.3rem; cursor: pointer;
  color: var(--text-muted, #6b6b66); padding: 0 4px; line-height: 1;
}
.help-modal-close:hover { color: var(--text, #28251d); }
.help-modal-body { padding: 18px 20px; font-size: 0.92rem; line-height: 1.5; }
.help-modal-body p { margin: 0 0 0.8em 0; }
.help-modal-body p:last-child { margin-bottom: 0; }
.help-modal-body code {
  background: var(--surface-alt, #f5f4ee); padding: 1px 5px;
  border-radius: 3px; font-size: 0.86em;
}
.help-modal-body strong { font-weight: 600; }
.help-modal-loading { color: var(--text-muted, #6b6b66); font-style: italic; padding: 8px 0; }
.help-source { font-size: 0.78rem; color: var(--text-muted, #6b6b66); font-style: italic; margin-top: 12px; }
.help-error { color: var(--epic-red, #ED1B24); }
.help-footer { font-size: 0.74rem; color: var(--text-muted, #6b6b66); margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--border, #ececea); }
.help-footer code { font-size: 0.86em; }
.help-generate-btn {
  background: var(--epic-blue, #00ADEF); color: #fff;
  border: 0; border-radius: 6px; padding: 7px 14px;
  font-size: 0.88rem; cursor: pointer;
}
.help-generate-btn:hover { filter: brightness(0.95); }

.help-edit-label {
  display: block; font-size: 0.78rem; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--text-muted, #6b6b66);
  margin: 10px 0 4px 0; font-weight: 600;
}
.help-edit-label:first-child { margin-top: 0; }
.help-edit-title {
  width: 100%; box-sizing: border-box;
  padding: 7px 10px; font-size: 0.95rem;
  border: 1px solid var(--border, #ddd); border-radius: 6px;
  font-family: inherit;
}
.help-edit-body {
  width: 100%; box-sizing: border-box;
  padding: 9px 11px; font-size: 0.86rem; line-height: 1.45;
  border: 1px solid var(--border, #ddd); border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  resize: vertical;
}
.help-edit-actions {
  display: flex; gap: 8px; justify-content: flex-end;
  margin-top: 12px; flex-wrap: wrap;
}
.help-edit-cancel, .help-edit-save, .help-edit-revert {
  border: 0; border-radius: 6px; padding: 7px 14px;
  font-size: 0.88rem; cursor: pointer; font-weight: 500;
}
.help-edit-cancel {
  background: none; border: 1px solid var(--border, #ddd); color: var(--text, #28251d);
}
.help-edit-cancel:hover { background: var(--surface-alt, #f5f4ee); }
.help-edit-save {
  background: var(--epic-green, #8EC63F); color: #14310a; font-weight: 600;
}
.help-edit-save:hover { filter: brightness(0.96); }
.help-edit-revert {
  background: none; border: 1px solid var(--border, #ddd); color: var(--text-muted, #6b6b66);
}
.help-edit-revert:hover { color: var(--epic-red, #ED1B24); border-color: var(--epic-red, #ED1B24); }
.help-edit-hint { font-size: 0.74rem; color: var(--text-muted, #6b6b66); margin-top: 8px; }

/* Admin help-content editor table */
.help-content-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.help-content-table th, .help-content-table td {
  text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border, #ececea);
  vertical-align: top;
}
.help-content-table th { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted, #6b6b66); }
.help-content-table code { background: var(--surface-alt, #f5f4ee); padding: 1px 5px; border-radius: 3px; font-size: 0.86em; }
.help-source-pill {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em;
}
.help-source-pill.seed { background: #e6e6e2; color: #555; }
.help-source-pill.authored { background: #e6e6e2; color: #555; }
.help-source-pill.admin { background: rgba(142,198,63,0.18); color: #3a5f1a; }
.help-source-pill.llm { background: rgba(0,173,239,0.15); color: #00708f; }
