/* zeus-app theme (UI trial, palette P0 + slate): royal blue for the current thing, slate for structure.
   Shared by zeus-app and zeus-admin (Sprint 42; it lives in frontend-common), loaded after pages.css. zeus-platform and the data room keep the older look.
   Tokens first (the tab bar and sidebar read these), then the few shapes that tokens cannot change.
   To roll back: remove the <link> to theme.css from the app templates (or revert the commit). */
:root {
  /* tab bar tokens (the data room portal's rail still reads these; the page tab bar is restyled below and no longer uses them) */
  --tab-rail-bg: var(--slate);  --tab-idle-bg: #475569;  --tab-idle-text: #ffffff;
  --tab-hover-bg: var(--slate-hover);  --tab-hover-text: #0f172a;
  --tab-active-bg: var(--surface);  --tab-active-text: var(--royal-ink);
  /* left menu: slate instead of the indigo-black, royal blue for the page you are on */
  --sidebar-bg: var(--slate-deep);  --sidebar-hover: var(--slate);  --sidebar-active: #475569;
  --sidebar-text: var(--hairline);  --sidebar-text-active: #ffffff;  --sidebar-accent: var(--sky);
}

/* ---------- the accent, app-wide (Sprint 39 step 4) ---------- */
/* Royal blue for every button, link, focus ring and chip in zeus-app; the logo mark and the avatar keep the indigo gradient (they use --brand-grad, not --accent). */
:root { --accent: var(--royal);  --accent-hover: var(--royal-ink);  --accent-soft: var(--royal-soft);  --text: var(--royal-ink);  --text-2: #475569;  --line: var(--hairline);  --surface-2: var(--slate-soft);  --ring: 0 0 0 3px rgba(180, 83, 9, .45); }

/* ---------- components (Sprint 39 step 5): soft 4px controls, 6px panels with a slate header bar, dense tables with tabular figures ---------- */
.btn, .chip, .stagechip, .select, body input:not([type="checkbox"]):not([type="radio"]), body textarea { border-radius: 4px; }
.panel, .card { border-radius: 6px; box-shadow: none; }
.modal, .drawer { border-radius: 6px; }
.panel-hd { background: var(--slate); color: #ffffff; border-bottom: 0; padding: var(--s-2) var(--s-3); font-size: var(--fs-sm); font-weight: 600; }
.panel-hd a { color: var(--sky); font-size: var(--fs-sm); }
.panel-hd .hint { color: var(--hairline); font-weight: 400; }
.panel-hd .muted { color: var(--hairline); font-weight: 400; }
.panel-hd .link-btn { color: var(--sky); font-size: var(--fs-sm); }
.panel-body { padding: var(--s-3); }
.table th { background: var(--surface-2); padding: 6px var(--s-3); }
.table td { padding: var(--s-2) var(--s-3); }
.table .num { font-family: var(--font-mono); }
.stat-num { font-family: var(--font-mono); }
/* the count strip: cells in one row (Home, and any summary that wants it) */
.stat-grid.strip { grid-template-columns: repeat(4, 1fr); gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; margin-bottom: var(--s-4); }
.stat-grid.strip .stat { border: 0; border-right: 1px solid var(--line); border-radius: 0; box-shadow: none; padding: var(--s-3) var(--s-4); align-items: center; }
.stat-grid.strip .stat:last-child { border-right: 0; }
@media (max-width: 860px) { .stat-grid.strip { grid-template-columns: repeat(2, 1fr); } .stat-grid.strip .stat:nth-child(2) { border-right: 0; } .stat-grid.strip .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); } }

/* ---------- tab bar (final design, Sprint 39 step 2) ---------- */
/* Light folder tabs. Each tab is a 32px face plus a 2px anchor line that is its own bottom border (no tail), 1px between tabs.
   The open tab is solid slate with a white label and the SAME height. Rows wrap (6px between rows) and never scroll sideways;
   the panel's 2px top edge is pulled up so it is the last row's anchor line. No cap anywhere. */
body .ztabs { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px 1px; padding: 0; background: none; border-radius: 0; box-shadow: none; overflow: visible; margin-bottom: 0; }
body .ztabs.is-sticky { background: var(--canvas); }
body .ztab { box-sizing: border-box; height: 34px; padding: 0 var(--s-3); border: 1px solid var(--hairline); border-bottom: 2px solid var(--anchor); border-radius: 6px 6px 0 0; background: var(--slate-soft); color: var(--slate); font-size: var(--fs-sm); font-weight: 600; }
body .ztab:hover { background: var(--slate-hover); color: var(--ink-900); }
body .ztab.active { height: 34px; background: var(--slate); color: #ffffff; border-color: var(--slate); border-bottom-color: var(--anchor); font-weight: 600; }
body .ztab:focus-visible { outline: 2px solid var(--royal); outline-offset: -2px; box-shadow: none; }
body .ztab.active:focus-visible { outline-color: #ffffff; }
body .ztab .tab-count { padding: 0 6px; background: #ffffff; color: var(--slate); font-weight: 600; }
body .ztab .tab-dot { box-shadow: none; }
body .ztabs-panel { background: var(--surface); border: 1px solid var(--hairline); border-top: 2px solid var(--anchor); border-radius: 0 0 6px 6px; margin-top: -2px; }
/* small tabs (inside a panel): light pills that wrap, a blue open pill */
body .ztabs[data-size="sm"] { gap: var(--s-1); }
body .ztabs[data-size="sm"] .ztab { height: 32px; border: 0; border-radius: 4px; background: var(--slate-soft); color: var(--slate); }
body .ztabs[data-size="sm"] .ztab:hover { background: var(--slate-hover); }
body .ztabs[data-size="sm"] .ztab.active { height: 32px; background: var(--royal); color: #ffffff; }
body .ztabs[data-size="sm"] .ztab.active .tab-count { background: #ffffff; color: var(--royal-ink); }
/* ---------- left menu ---------- */
.sb-section { color: var(--anchor); opacity: 1; }
.sb-item:hover { background: rgba(255, 255, 255, .08); }
.sb-item.active { background: var(--royal); color: #ffffff; }
.sb-item.active::before { background: var(--sky); }
.sb-item { border-radius: 4px; }

/* ---------- title bar ---------- */
.dealtitle { font-size: 20px; }
