/* ==========================================================================
   FRB Executive Dashboard — design system
   Fundraiser Blankets® · Birdy Boutique LLC
   ========================================================================== */

:root {
  --bg: #070b14;
  --bg-elev: #0d1322;
  --surface: rgba(20, 28, 46, 0.72);
  --surface-solid: #141c2e;
  --surface-hover: rgba(30, 41, 66, 0.85);
  --border: rgba(148, 163, 184, 0.12);
  --border-strong: rgba(148, 163, 184, 0.22);
  --text: #f1f5f9;
  --text-2: #a5b1c4;
  --text-3: #6b7a93;

  --gold: #f5a524;
  --gold-2: #ffcb6b;
  --gold-glow: rgba(245, 165, 36, 0.18);
  --teal: #2dd4bf;
  --violet: #a78bfa;
  --sky: #38bdf8;
  --rose: #fb7185;
  --green: #34d399;
  --amber: #fbbf24;
  --red: #f87171;
  --grey: #64748b;

  --green-bg: rgba(52, 211, 153, 0.12);
  --amber-bg: rgba(251, 191, 36, 0.12);
  --red-bg: rgba(248, 113, 113, 0.12);
  --grey-bg: rgba(100, 116, 139, 0.14);
  --sky-bg: rgba(56, 189, 248, 0.12);
  --violet-bg: rgba(167, 139, 250, 0.12);

  --google: #4f8ff7;
  --meta: #a78bfa;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.55);
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Outfit', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="light"] {
  --bg: #f4f6fb;
  --bg-elev: #ffffff;
  --surface: rgba(255, 255, 255, 0.86);
  --surface-solid: #ffffff;
  --surface-hover: #f8fafc;
  --border: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.16);
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #8391a7;
  --gold: #d98a06;
  --gold-2: #b86f00;
  --gold-glow: rgba(217, 138, 6, 0.12);
  --shadow: 0 10px 30px -18px rgba(15, 23, 42, 0.25);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
code, .mono { font-family: var(--font-mono); font-size: 0.88em; }
code { background: var(--grey-bg); padding: 1px 6px; border-radius: 5px; }

/* Ambient background */
.bg-orbs { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.bg-orbs span { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.35; animation: drift 24s ease-in-out infinite alternate; }
.bg-orbs span:nth-child(1) { width: 520px; height: 520px; background: radial-gradient(circle, rgba(245, 165, 36, 0.35), transparent 70%); top: -180px; left: -120px; }
.bg-orbs span:nth-child(2) { width: 600px; height: 600px; background: radial-gradient(circle, rgba(56, 189, 248, 0.22), transparent 70%); top: 20%; right: -220px; animation-delay: -8s; }
.bg-orbs span:nth-child(3) { width: 480px; height: 480px; background: radial-gradient(circle, rgba(167, 139, 250, 0.2), transparent 70%); bottom: -200px; left: 30%; animation-delay: -16s; }
[data-theme="light"] .bg-orbs span { opacity: 0.18; }
@keyframes drift { to { transform: translate(60px, 40px) scale(1.08); } }

/* ---------------------------------- Header ---------------------------------- */
.app-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid var(--border);
}
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 8px 28px; max-width: 1600px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand img { height: 48px; width: auto; border-radius: 10px; object-fit: contain; filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3)); transition: transform 0.2s var(--ease); }
.brand img:hover { transform: scale(1.02); }
.brand-text h1 { font-family: var(--font-display); font-size: 20px; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; line-height: 1.2; }
.brand-text h1 em { font-style: normal; background: linear-gradient(90deg, var(--gold), var(--gold-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-text p { font-size: 12.5px; color: var(--text-2); white-space: nowrap; margin-top: 2px; }

.header-actions { display: flex; align-items: center; gap: 10px; }
.portal-switch-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text);
  text-decoration: none;
  transition: all 0.2s var(--ease);
}
.portal-switch-pill:hover {
  border-color: var(--gold);
  background: var(--surface-hover);
  transform: translateY(-1px);
}
.portal-switch-ico {
  font-size: 15px;
  line-height: 1;
}
.portal-switch-txt {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
}
.portal-switch-lbl {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}
.portal-switch-sub {
  font-size: 10px;
  font-weight: 500;
  color: var(--gold-2);
  white-space: nowrap;
}
.segmented { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 3px; }
.segmented button { border: 0; background: transparent; color: var(--text-2); padding: 6px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; transition: all 0.2s var(--ease); }
.segmented button:hover { color: var(--text); }
.segmented button.active { background: linear-gradient(135deg, var(--gold), #f08c1a); color: #1a1205; box-shadow: 0 4px 14px -4px var(--gold-glow); }
.segmented.disabled { opacity: 0.4; pointer-events: none; }

.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 50%; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font-size: 16px; transition: all 0.2s var(--ease);
}
.icon-btn:hover { border-color: var(--gold); transform: translateY(-1px); }
.icon-btn.spinning span { display: inline-block; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Tabs — Zero-Scrollbar 13-Tab Executive Bar (`smart-menu-architect`) */
.tabs, .tab-bar {
  display: grid;
  grid-template-columns: repeat(13, minmax(0, 1fr));
  align-items: stretch;
  gap: 2px;
  padding: 0 20px;
  max-width: 1600px;
  margin: 0 auto;
  overflow: visible;
}
@media (max-width: 1080px) {
  .tabs, .tab-bar {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    row-gap: 2px;
    padding-bottom: 4px;
  }
}
@media (max-width: 680px) {
  .tabs, .tab-bar {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.tab {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 6px 9px;
  border: 0;
  background: none;
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  transition: color 0.18s, background 0.18s;
  min-width: 0;
  border-radius: 8px 8px 0 0;
}
.tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.tab .ico, .tab .tab-ico { font-size: 14px; line-height: 1; flex-shrink: 0; }
.tab .txt { display: flex; flex-direction: column; align-items: flex-start; text-align: left; line-height: 1.15; min-width: 0; overflow: hidden; }
.tab .txt .t { font-size: clamp(10.5px, 0.72vw, 12px); font-weight: 700; color: inherit; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tab .txt .s { font-size: 9.5px; font-weight: 500; color: var(--text-3); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
@media (max-width: 1420px) {
  .tab .txt .s { display: none; }
}
.tab .tab-num { font-family: var(--font-mono); font-size: 10px; color: var(--text-3); }
.tab::after { content: ''; position: absolute; left: 6px; right: 6px; bottom: 0; height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--gold), var(--gold-2)); transform: scaleX(0); transition: transform 0.25s var(--ease); }
.tab.active { color: var(--text); background: rgba(245, 165, 36, 0.08); }
.tab.active .txt .t { color: var(--gold-2); }
.tab.active::after { transform: scaleX(1); }
.tab .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--grey); flex-shrink: 0; }
.tab .dot.on { background: var(--green); box-shadow: 0 0 6px var(--green); }
.tab .dot.off { background: var(--amber); }

/* Floating Secondary Portal Pill (`smart-menu-architect` Law 3) */
.frb-floating-pill {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 490;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  color: var(--text);
  text-decoration: none;
  transition: all 0.2s var(--ease);
}
.frb-floating-pill:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(245, 165, 36, 0.22);
}

/* ---------------------------------- Layout ---------------------------------- */
main { position: relative; z-index: 1; max-width: 1600px; margin: 0 auto; padding: 28px 32px 60px; }
.panel-view { display: none; animation: rise 0.45s var(--ease); }
.panel-view.active { display: block; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.view-head h2 { font-family: var(--font-display); font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.view-head p { color: var(--text-2); font-size: 13.5px; margin-top: 2px; }
.view-meta { display: flex; align-items: center; gap: 10px; color: var(--text-3); font-size: 12px; flex-wrap: wrap; }

.grid { display: grid; gap: 16px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: 16px; }
.cols-3-1 { grid-template-columns: 2fr 1fr; }
.cols-2 { grid-template-columns: 1fr 1fr; }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.mb { margin-bottom: 16px; }
@media (max-width: 1100px) { .cols-3-1, .cols-2, .cols-3 { grid-template-columns: 1fr; } }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  min-width: 0;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h3 { font-family: var(--font-display); font-size: 15.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card-head .sub { color: var(--text-3); font-size: 12px; }

.kpi { position: relative; overflow: hidden; transition: transform 0.25s var(--ease), border-color 0.25s; }
.kpi:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.kpi::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 2px; background: var(--accent, var(--gold)); opacity: 0.85; }
.kpi .label { color: var(--text-2); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; display: flex; align-items: center; gap: 6px; }
.kpi .value { font-family: var(--font-display); font-size: 30px; font-weight: 700; letter-spacing: -0.02em; margin: 6px 0 4px; line-height: 1.1; }
.kpi .foot { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-3); flex-wrap: wrap; }

.delta { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; font-size: 11.5px; padding: 2px 7px; border-radius: 999px; }
.delta.up { color: var(--green); background: var(--green-bg); }
.delta.down { color: var(--red); background: var(--red-bg); }
.delta.flat { color: var(--text-2); background: var(--grey-bg); }

/* Pills / badges */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.pill.green { color: var(--green); background: var(--green-bg); }
.pill.amber { color: var(--amber); background: var(--amber-bg); }
.pill.red { color: var(--red); background: var(--red-bg); }
.pill.grey { color: var(--text-2); background: var(--grey-bg); }
.pill.sky { color: var(--sky); background: var(--sky-bg); }
.pill.violet { color: var(--violet); background: var(--violet-bg); }
.pill .d { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.live .d { animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 currentColor; } 70% { box-shadow: 0 0 0 6px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

.btn {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); padding: 7px 13px; border-radius: 10px;
  font-size: 12.5px; font-weight: 600; transition: all 0.2s var(--ease);
}
.btn:hover { border-color: var(--gold); color: var(--gold-2); }
.btn.primary { background: linear-gradient(135deg, var(--gold), #f08c1a); border-color: transparent; color: #1a1205; }
.btn.primary:hover { filter: brightness(1.08); color: #1a1205; }
.btn.sm { padding: 4px 10px; font-size: 11.5px; border-radius: 8px; }

select.select {
  background: var(--surface-solid); color: var(--text); border: 1px solid var(--border-strong);
  border-radius: 10px; padding: 6px 10px; font-size: 12.5px; font-family: inherit;
}
input.search {
  width: 100%; background: var(--surface-solid); color: var(--text); border: 1px solid var(--border-strong);
  border-radius: 10px; padding: 9px 12px 9px 34px; font-size: 13px; font-family: inherit;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236b7a93' stroke-width='2'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m11 11 3 3'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 11px center;
}
input.search:focus, select.select:focus { outline: none; border-color: var(--gold); }

/* Tables */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th { text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.t td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr { transition: background 0.15s; }
table.t tbody tr:hover { background: var(--surface-hover); }
table.t td.num, table.t th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.t tr.warn td { background: var(--red-bg); }
.cell-main { font-weight: 600; }
.cell-sub { color: var(--text-3); font-size: 11.5px; }
.rank { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--grey-bg); font-size: 11px; font-weight: 700; color: var(--text-2); }
.rank.r1 { background: linear-gradient(135deg, var(--gold), #f08c1a); color: #1a1205; }

.minibar { height: 6px; border-radius: 4px; background: var(--grey-bg); overflow: hidden; min-width: 60px; }
.minibar > i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--teal), var(--sky)); }

/* Charts */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .axis text { fill: var(--text-3); font-size: 10.5px; font-family: var(--font); }
.chart .grid-line { stroke: var(--border); stroke-dasharray: 3 4; }
.chart-tip {
  position: absolute; pointer-events: none; z-index: 5; transform: translate(-50%, -110%);
  background: var(--surface-solid); border: 1px solid var(--border-strong); border-radius: 10px;
  padding: 7px 10px; font-size: 12px; white-space: nowrap; box-shadow: var(--shadow); opacity: 0; transition: opacity 0.15s;
}
.chart-tip b { display: block; font-family: var(--font-display); font-size: 14px; }
.chart-tip.show { opacity: 1; }

.barlist { display: flex; flex-direction: column; gap: 12px; }
.barlist .row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; }
.barlist .lbl { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barlist .val { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.barlist .track { grid-column: 1 / -1; height: 8px; background: var(--grey-bg); border-radius: 6px; overflow: hidden; }
.barlist .track i { display: block; height: 100%; border-radius: 6px; background: var(--bar, linear-gradient(90deg, var(--gold), var(--gold-2))); transform-origin: left; animation: grow 0.8s var(--ease) both; }
.barlist .meta { grid-column: 1 / -1; font-size: 11.5px; color: var(--text-3); margin-top: -2px; }
@keyframes grow { from { transform: scaleX(0); } }

.funnel { display: flex; flex-direction: column; gap: 8px; }
.funnel .stage { display: grid; grid-template-columns: 170px 1fr 120px; gap: 12px; align-items: center; font-size: 12.5px; }
.funnel .stage .nm { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.funnel .stage .bar { height: 26px; border-radius: 7px; background: var(--grey-bg); position: relative; overflow: hidden; }
.funnel .stage .bar i { position: absolute; inset: 0 auto 0 0; border-radius: 7px; background: linear-gradient(90deg, rgba(245, 165, 36, 0.85), rgba(255, 203, 107, 0.65)); animation: grow 0.8s var(--ease) both; }
.funnel .stage .bar span { position: relative; z-index: 1; padding: 0 9px; line-height: 26px; font-weight: 700; font-size: 12px; color: var(--text); }
.funnel .stage .v { text-align: right; font-variant-numeric: tabular-nums; }
.funnel .stage .v small { display: block; color: var(--text-3); font-size: 10.5px; }
@media (max-width: 700px) { .funnel .stage { grid-template-columns: 110px 1fr 80px; } }

.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut-wrap svg { width: 170px; height: 170px; flex-shrink: 0; }
.legend { display: flex; flex-direction: column; gap: 7px; flex: 1; min-width: 160px; }
.legend .li { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.legend .sw { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.legend .li .n { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.legend .li .p { color: var(--text-3); width: 42px; text-align: right; font-size: 11.5px; }

/* Lists */
.feed { display: flex; flex-direction: column; }
.feed .item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.feed .item:last-child { border-bottom: 0; }
.feed .ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--green-bg); color: var(--green); font-size: 15px; flex-shrink: 0; }
.feed .body { flex: 1; min-width: 0; }
.feed .body .t1 { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed .body .t2 { color: var(--text-3); font-size: 11.5px; }
.feed .amt { font-weight: 700; font-variant-numeric: tabular-nums; }

/* Mini stats */
.ministats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.ministat { padding: 14px; border-radius: var(--r-md); background: var(--grey-bg); }
.ministat .n { font-family: var(--font-display); font-size: 22px; font-weight: 700; }
.ministat .l { font-size: 12px; color: var(--text-2); }

/* Health cards (Tab 3) */
.health-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.hcard { padding: 16px; display: flex; flex-direction: column; gap: 10px; transition: transform 0.2s var(--ease), border-color 0.2s; }
.hcard:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.hcard .top { display: flex; align-items: center; gap: 12px; }
.hcard .em { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 19px; background: var(--grey-bg); flex-shrink: 0; }
.hcard .nm { font-weight: 700; font-size: 14px; line-height: 1.25; }
.hcard .cat { font-size: 11.5px; color: var(--text-3); }
.hcard .msg { font-size: 12.5px; color: var(--text-2); min-height: 36px; }
.hcard .bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--text-3); }
.status-dot { width: 10px; height: 10px; border-radius: 50%; margin-left: auto; flex-shrink: 0; }
.status-dot.healthy { background: var(--green); box-shadow: 0 0 0 4px var(--green-bg), 0 0 12px var(--green); }
.status-dot.degraded { background: var(--amber); box-shadow: 0 0 0 4px var(--amber-bg); }
.status-dot.offline { background: var(--red); box-shadow: 0 0 0 4px var(--red-bg); }
.status-dot.unconfigured, .status-dot.pending { background: var(--grey); box-shadow: 0 0 0 4px var(--grey-bg); }
.hcard.unconfigured { opacity: 0.72; }
.spark { height: 26px; width: 110px; }
.spark path { fill: none; stroke: var(--teal); stroke-width: 1.6; }

details.tech { margin-top: 20px; }
details.tech > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--border);
  font-weight: 600; color: var(--text-2);
}
details.tech > summary::-webkit-details-marker { display: none; }
details.tech > summary::before { content: '▸'; transition: transform 0.2s; }
details.tech[open] > summary::before { transform: rotate(90deg); }
details.tech > .tech-body { padding-top: 16px; }

/* Vercel project cards */
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.proj { display: flex; flex-direction: column; gap: 12px; transition: transform 0.25s var(--ease), border-color 0.25s; }
.proj:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.proj .ph { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.proj .pn { font-family: var(--font-display); font-weight: 700; font-size: 16.5px; }
.proj .pu { color: var(--sky); font-size: 12.5px; word-break: break-all; }
.proj .pu:hover { text-decoration: underline; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 11px; padding: 3px 8px; border-radius: 6px; background: var(--grey-bg); color: var(--text-2); font-family: var(--font-mono); }
.proj .deploy { font-size: 12.5px; color: var(--text-2); padding: 10px 12px; border-radius: 10px; background: var(--grey-bg); }
.proj .deploy .cm { color: var(--text); font-weight: 500; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dots { display: flex; gap: 4px; align-items: center; }
.dots i { width: 9px; height: 9px; border-radius: 3px; background: var(--grey); }
.dots i.READY { background: var(--green); }
.dots i.ERROR { background: var(--red); }
.dots i.BUILDING, .dots i.QUEUED, .dots i.INITIALIZING { background: var(--amber); }
.proj .pf { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }

/* SOP / Monday (Tab 5) */
.sop-layout { display: grid; grid-template-columns: 380px 1fr; gap: 16px; align-items: start; }
@media (max-width: 1000px) { .sop-layout { grid-template-columns: 1fr; } }
.group-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.gchip { border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); border-radius: 999px; padding: 6px 12px; font-size: 12px; font-weight: 600; transition: all 0.2s; }
.gchip:hover { color: var(--text); }
.gchip.active { background: var(--gold-glow); border-color: var(--gold); color: var(--gold-2); }
.gchip .c { font-family: var(--font-mono); font-size: 10.5px; opacity: 0.75; margin-left: 4px; }
.sop-list { display: flex; flex-direction: column; gap: 6px; max-height: 70vh; overflow-y: auto; padding-right: 4px; margin-top: 12px; }
.sop-item { padding: 11px 13px; border-radius: 11px; border: 1px solid transparent; cursor: pointer; transition: all 0.15s; }
.sop-item:hover { background: var(--surface-hover); }
.sop-item.active { background: var(--gold-glow); border-color: rgba(245, 165, 36, 0.35); }
.sop-item .st { font-weight: 600; font-size: 13px; line-height: 1.35; }
.sop-item .sm { display: flex; gap: 6px; align-items: center; margin-top: 5px; flex-wrap: wrap; font-size: 11px; color: var(--text-3); }
.sop-viewer { min-height: 60vh; }
.sop-viewer .doc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--border); margin-bottom: 18px; flex-wrap: wrap; }
.sop-viewer .doc-head h3 { font-family: var(--font-display); font-size: 21px; line-height: 1.3; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 18px; }
.fact { padding: 10px 12px; border-radius: 10px; background: var(--grey-bg); }
.fact .k { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; }
.fact .v { font-weight: 600; margin-top: 2px; font-size: 13px; }
.update { padding: 12px 14px; border-left: 3px solid var(--gold); background: var(--grey-bg); border-radius: 0 10px 10px 0; margin-bottom: 10px; font-size: 13px; white-space: pre-wrap; }
.update .by { font-size: 11.5px; color: var(--text-3); margin-bottom: 4px; }

.md { font-size: 14px; line-height: 1.7; color: var(--text-2); }
.md h1, .md h2, .md h3, .md h4 { font-family: var(--font-display); color: var(--text); line-height: 1.3; margin: 22px 0 10px; }
.md h1 { font-size: 22px; margin-top: 0; }
.md h2 { font-size: 18px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.md h3 { font-size: 15.5px; color: var(--gold-2); }
.md p { margin: 8px 0; }
.md ul, .md ol { margin: 8px 0 8px 22px; }
.md li { margin: 3px 0; }
.md strong { color: var(--text); }
.md a { color: var(--sky); text-decoration: underline; }
.md hr { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }
.md blockquote { border-left: 3px solid var(--gold); padding: 6px 14px; background: var(--grey-bg); border-radius: 0 8px 8px 0; margin: 10px 0; }
.md table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 12.5px; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--border); padding: 7px 10px; text-align: left; vertical-align: top; }
.md th { background: var(--grey-bg); color: var(--text); }
.md pre { background: var(--bg-elev); border: 1px solid var(--border); border-radius: 10px; padding: 12px; overflow-x: auto; font-size: 12px; margin: 10px 0; }
.md pre code { background: none; padding: 0; }

/* Ads (Tab 6) */
.platforms { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-bottom: 16px; }
.platform { display: flex; align-items: center; gap: 14px; }
.platform .logo { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; font-weight: 800; font-family: var(--font-display); font-size: 20px; color: #fff; flex-shrink: 0; }
.platform .logo.g { background: linear-gradient(135deg, #4285f4, #34a853 60%, #fbbc05); }
.platform .logo.m { background: linear-gradient(135deg, #0866ff, #a033ff 70%, #ff5c87); }
.platform .info { flex: 1; min-width: 0; }
.platform .info .n { font-weight: 700; }
.platform .info .s { font-size: 12px; color: var(--text-3); }
.legend-inline { display: flex; gap: 14px; font-size: 12px; color: var(--text-2); }
.legend-inline span::before { content: ''; display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; background: var(--c); vertical-align: -1px; }

/* Setup / empty / loading */
.setup {
  position: relative; overflow: hidden; text-align: left;
  border: 1px dashed rgba(245, 165, 36, 0.4); background: linear-gradient(135deg, var(--gold-glow), transparent 60%), var(--surface);
}
.setup .si { font-size: 34px; margin-bottom: 8px; }
.setup h3 { font-family: var(--font-display); font-size: 19px; margin-bottom: 6px; }
.setup p { color: var(--text-2); max-width: 720px; }
.setup ol { margin: 14px 0 0 20px; color: var(--text-2); display: flex; flex-direction: column; gap: 6px; }
.setup .envbox { margin-top: 14px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; font-family: var(--font-mono); font-size: 12px; color: var(--text); white-space: pre; overflow-x: auto; }
.setup .preview { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; }

.loading { display: grid; gap: 16px; }
.skel { border-radius: var(--r-lg); background: linear-gradient(90deg, var(--surface) 0%, var(--surface-hover) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border: 1px solid var(--border); }
@keyframes shimmer { to { background-position: -200% 0; } }
.loading-note { text-align: center; color: var(--text-3); font-size: 12.5px; }
.empty { padding: 28px; text-align: center; color: var(--text-3); font-size: 13px; }
.error-card { border-color: rgba(248, 113, 113, 0.4); background: linear-gradient(135deg, var(--red-bg), transparent), var(--surface); }

.footer, .app-footer { position: relative; z-index: 1; max-width: 1600px; margin: 0 auto; padding: 18px 32px 30px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--text-3); font-size: 12px; flex-wrap: wrap; border-top: 1px solid var(--border); }
.footer a:hover, .app-footer a:hover { color: var(--gold-2); }

/* Legacy Buckets Fold (Hubstaff / Overseas Team) */
.legacy-fold {
  margin-top: 16px;
  border-top: 1px dashed var(--border-strong);
  padding-top: 12px;
}
.legacy-fold-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  padding: 8px 12px;
  border-radius: var(--r-sm);
  background: rgba(148, 163, 184, 0.05);
  border: 1px solid var(--border);
  transition: all 0.2s var(--ease);
  list-style: none;
}
.legacy-fold-summary::-webkit-details-marker { display: none; }
.legacy-fold-summary:hover {
  color: var(--text);
  background: var(--surface-hover);
  border-color: var(--border-strong);
}
.legacy-fold-summary .legacy-badge {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--grey-bg);
  color: var(--text-3);
  font-weight: 700;
}
.legacy-fold-summary .legacy-hrs {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-2);
  font-weight: 600;
}
.legacy-fold-summary .legacy-arrow {
  font-size: 10px;
  color: var(--text-3);
  transition: transform 0.2s var(--ease);
  display: inline-block;
}
details[open] .legacy-fold-summary .legacy-arrow {
  transform: rotate(180deg);
}
.legacy-fold-content {
  padding-top: 12px;
  animation: rise 0.25s var(--ease);
}
.legacy-note {
  font-size: 11.5px;
  color: var(--text-3);
  margin-bottom: 10px;
  font-style: italic;
}
.legacy-barlist .track i {
  background: linear-gradient(90deg, #64748b, #475569) !important;
}
.legacy-barlist .lbl {
  color: var(--text-2);
}
.legacy-barlist .val {
  color: var(--text-3);
}

/* Office LAN pill in footer */
.lan-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  padding: 4px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.lan-pill:hover {
  color: var(--text);
  border-color: var(--gold);
  background: var(--surface-hover);
}
.lan-pill .lan-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
}
.lan-pill code {
  color: var(--teal);
  background: transparent;
  padding: 0;
  font-weight: 500;
}
.lan-pill .copy-lbl {
  font-size: 10.5px;
  color: var(--text-3);
  margin-left: 2px;
}
.lan-pill.copied {
  border-color: var(--green);
  color: var(--green);
}

/* ==========================================================================
   US Staff Productivity & Focus (Tab 3)
   ========================================================================== */
.us-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 20px;
}
@media (max-width: 1200px) {
  .us-cards-grid {
    grid-template-columns: 1fr;
  }
}

.us-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  transition: transform 0.25s var(--ease), border-color 0.25s;
}
.us-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
}

.us-person-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}
.us-avatar {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 24px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(167, 139, 250, 0.15));
  border: 1px solid var(--border-strong);
  flex-shrink: 0;
}
.us-person-meta {
  flex: 1;
  min-width: 0;
}
.us-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
}
.us-title {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 2px;
}
.us-tag {
  display: inline-block;
  margin-top: 6px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--sky-bg);
  color: var(--sky);
}

.us-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
  background: var(--surface-solid);
  padding: 10px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
}
.us-stat-item {
  text-align: center;
}
.us-stat-val {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--gold-2);
}
.us-stat-lbl {
  font-size: 10.5px;
  color: var(--text-3);
  margin-top: 2px;
}

.us-focus-box {
  margin-bottom: 16px;
}
.us-box-title {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.us-focus-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.us-focus-list li {
  font-size: 12.5px;
  color: var(--text-2);
  display: flex;
  align-items: baseline;
  gap: 8px;
  line-height: 1.35;
}
.us-focus-list li::before {
  content: '▸';
  color: var(--gold);
  font-size: 12px;
  flex-shrink: 0;
}

.us-items-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-bottom: 16px;
}
.us-items-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.us-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 12.5px;
  transition: border-color 0.15s;
}
.us-item-row:hover {
  border-color: var(--border-strong);
}
.us-item-main {
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.us-item-sub {
  font-size: 11px;
  color: var(--text-3);
  white-space: nowrap;
}

.us-card-action {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.us-callout {
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: linear-gradient(135deg, rgba(245, 165, 36, 0.1), rgba(245, 165, 36, 0.03));
  border: 1px solid rgba(245, 165, 36, 0.25);
  font-size: 11.5px;
  color: var(--text-2);
  margin-bottom: 14px;
  line-height: 1.4;
}

/* Cross-Team Handoff Flow */
.handoff-flow-card {
  margin-bottom: 20px;
}
.handoff-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 14px;
  position: relative;
}
@media (max-width: 900px) {
  .handoff-steps {
    grid-template-columns: 1fr;
  }
}
.handoff-step {
  padding: 16px;
  border-radius: var(--r-md);
  background: var(--surface-solid);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}
.handoff-step-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--teal);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.handoff-step-title {
  font-weight: 700;
  font-size: 13.5px;
  color: var(--text);
}
.handoff-step-owner {
  font-size: 11.5px;
  color: var(--gold-2);
  font-weight: 600;
}
.handoff-step-desc {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.35;
}

@media (max-width: 860px) {
  .header-row { flex-wrap: wrap; padding: 12px 16px; }
  .brand img { height: 64px; }
  .tabs { padding: 0 12px; }
  main { padding: 20px 16px 50px; }
  .brand-text p { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ==========================================================================
   Compact Hero & High-Density Tab 1 Styles
   ========================================================================== */
#view-hubspot {
  margin-top: -10px;
}
.mb-sm {
  margin-bottom: 10px;
}
.card.card-compact {
  padding: 12px 16px;
}
.card.card-compact .card-head {
  margin-bottom: 8px;
}
.card.card-compact .card-head h3 {
  font-size: 14px;
}
.kpis.kpis-compact {
  gap: 10px;
  margin-bottom: 10px;
}
.kpis.kpis-compact .kpi {
  padding: 10px 14px;
}
.kpis.kpis-compact .kpi .label {
  font-size: 10.5px;
}
.kpis.kpis-compact .kpi .value {
  font-size: 22px;
  margin: 2px 0;
}
.kpis.kpis-compact .kpi .foot {
  font-size: 11px;
}
.hero-cohort-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.hpill {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 4px 9px;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}
.hpill.active {
  border-color: rgba(248, 113, 113, 0.55);
  background: rgba(248, 113, 113, 0.08);
}
.hpill small {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-3);
}
.hpill b {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
}
.hpill em {
  font-style: normal;
  font-size: 10.5px;
  color: var(--text-3);
}
.hero-impact-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.25);
  font-size: 12px;
  color: var(--text-2);
}
.barlist.compact-bars {
  gap: 6px;
}
.barlist.compact-bars .row {
  gap: 2px 8px;
}
.barlist.compact-bars .lbl,
.barlist.compact-bars .val {
  font-size: 11.5px;
}
.barlist.compact-bars .track {
  height: 6px;
}
.compact-mini-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--text-2);
}
.card-compact table.t th {
  padding: 6px 8px;
  font-size: 10.5px;
}
.card-compact table.t td {
  padding: 6px 8px;
  font-size: 12px;
}
.funnel.funnel-compact {
  gap: 5px;
}
.funnel.funnel-compact .stage {
  grid-template-columns: 160px 1fr 90px;
  gap: 8px;
  font-size: 11.5px;
}
.funnel.funnel-compact .stage .bar {
  height: 20px;
}
.funnel.funnel-compact .stage .bar span {
  line-height: 20px;
  font-size: 11px;
}

/* ==========================================================================
   Zero-Leak Authentication Gate (`zero-leak-signon`)
   ========================================================================== */
.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(7, 11, 20, 0.96);
  backdrop-filter: blur(22px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.auth-gate[hidden] {
  display: none !important;
}
.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  padding: 32px 28px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
}
.auth-logo {
  font-size: 36px;
  margin-bottom: 12px;
}
.auth-card h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
}
.auth-card p {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 18px;
}
.auth-sso-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}
.btn-google-sso {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 11px 16px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-strong);
  background: #ffffff;
  color: #1f2937;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.btn-google-sso:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
}
.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 14px;
  color: var(--text-3);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-strong);
}
.auth-card input {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-elev);
  color: var(--text);
  font-size: 14px;
  text-align: center;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
  outline: none;
}
.auth-card input:focus {
  border-color: var(--gold);
}
.auth-error {
  color: var(--red);
  font-size: 12.5px;
  margin-bottom: 10px;
}
.auth-submit {
  width: 100%;
  justify-content: center;
  padding: 11px 16px;
  font-weight: 700;
}


