/* ops.css — standalone token set.
   Uses the same --ds-* vocabulary as the platform design system, but does NOT
   depend on branding-css.ejs: this console has no per-org branding. */

:root {
  color-scheme: light dark;
  --ds-bg:          #eef2f2;
  --ds-surface:     #fbfcfc;
  --ds-surface-2:   #f3f6f6;
  --ds-text:        #0b1518;
  --ds-text-2:      #47585c;
  --ds-text-muted:  #78888c;
  --ds-border:      #dde5e5;
  --ds-rule:        #c6d2d3;
  --ds-accent:      #b26a00;
  --ds-accent-ink:  #7d4a00;
  --ds-accent-wash: #fdf3e2;
  --ds-good:        #056105;
  --ds-warn:        #b8801a;
  --ds-crit:        #d03b3b;
  --ds-radius:      3px;
  --ds-mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
  --ds-sans: system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ds-bg:          #070e11;
    --ds-surface:     #0f1a1f;
    --ds-surface-2:   #16242a;
    --ds-text:        #eef5f6;
    --ds-text-2:      #a9babe;
    --ds-text-muted:  #7d8c90;
    --ds-border:      #1e2f36;
    --ds-rule:        #2a3d45;
    --ds-accent:      #f0a11e;
    --ds-accent-ink:  #f6bf62;
    --ds-accent-wash: #1f1a0d;
    --ds-good:        #35c035;
    --ds-warn:        #fab219;
    --ds-crit:        #e66767;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--ds-bg); color: var(--ds-text);
  font-family: var(--ds-sans); font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ds-accent-ink); }

/* ---------- chrome ---------- */
.ds-topbar {
  display: flex; align-items: center; gap: 24px;
  padding: 0 22px; height: 54px;
  background: var(--ds-surface); border-bottom: 1px solid var(--ds-rule);
}
.ds-brand { font-weight: 640; letter-spacing: -0.02em; text-decoration: none; color: var(--ds-text); }
.ds-brand span { color: var(--ds-accent-ink); }
.ds-nav { display: flex; gap: 4px; flex: 1; }
.ds-nav a {
  padding: 6px 12px; border-radius: var(--ds-radius); text-decoration: none;
  color: var(--ds-text-2); font-size: 14px;
}
.ds-nav a:hover { background: var(--ds-surface-2); color: var(--ds-text); }
.ds-nav a.on { background: var(--ds-accent-wash); color: var(--ds-accent-ink); font-weight: 600; }
.ds-signout { display: flex; align-items: center; gap: 12px; margin: 0; }
.ds-signout span { font-size: 12.5px; color: var(--ds-text-muted); }
.ds-main { max-width: 1180px; margin: 0 auto; padding: 28px 22px 80px; }

/* ---------- type ---------- */
h1 { font-size: 25px; font-weight: 620; letter-spacing: -0.02em; margin: 0 0 4px; }
h2 { font-size: 17px; font-weight: 600; margin: 0 0 12px; }
.ds-sub { color: var(--ds-text-2); font-size: 14px; margin: 0 0 22px; }
.ds-eyebrow {
  font-family: var(--ds-mono); font-size: 10.5px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ds-text-muted);
}

/* ---------- tiles ---------- */
.ds-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 26px; }
.ds-tile {
  background: var(--ds-surface); border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius); padding: 15px 17px;
  display: flex; flex-direction: column; gap: 4px;
}
.ds-tile.accent { border-left: 2px solid var(--ds-accent); }
.ds-tile .v { font-size: 26px; font-weight: 620; letter-spacing: -0.025em; line-height: 1.1; }
.ds-tile .n { font-size: 12.5px; color: var(--ds-text-2); }

/* ---------- panels + tables ---------- */
.ds-panel {
  background: var(--ds-surface); border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius); margin-bottom: 22px; overflow: hidden;
}
.ds-panel-head {
  padding: 13px 17px; border-bottom: 1px solid var(--ds-border);
  background: var(--ds-surface-2); display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.ds-panel-head h2 { margin: 0; }
.ds-table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 17px; border-bottom: 1px solid var(--ds-border); }
thead th {
  font-family: var(--ds-mono); font-size: 10.5px; letter-spacing: .09em;
  text-transform: uppercase; color: var(--ds-text-muted); font-weight: 500;
  background: var(--ds-surface-2); white-space: nowrap;
}
tbody tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-family: var(--ds-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ds-empty { padding: 26px 17px; color: var(--ds-text-muted); font-size: 14px; }

/* ---------- pills ---------- */
.ds-pill {
  display: inline-block; font-family: var(--ds-mono); font-size: 10px;
  letter-spacing: .08em; text-transform: uppercase; padding: 3px 7px;
  border-radius: 2px; border: 1px solid var(--ds-border); color: var(--ds-text-2);
}
.ds-pill.live { border-color: var(--ds-good); color: var(--ds-good); }
.ds-pill.onboarding { border-color: var(--ds-accent); color: var(--ds-accent-ink); }
.ds-pill.at_risk { border-color: var(--ds-warn); color: var(--ds-warn); }
.ds-pill.churned { border-color: var(--ds-crit); color: var(--ds-crit); }
.ds-pill.free { border-color: var(--ds-accent); color: var(--ds-accent-ink); background: var(--ds-accent-wash); }

/* page header row: title block + action on the right */
.ds-page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ds-panel-body { padding: 15px 17px; margin: 0; color: var(--ds-text-2); }

/* ---------- forms + buttons ---------- */
.ds-form { padding: 17px; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px 16px; align-items: end; }
.ds-field { display: flex; flex-direction: column; gap: 5px; }
.ds-field label { font-family: var(--ds-mono); font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--ds-text-muted); }
input[type=text], input[type=number], input[type=date], select, textarea {
  font-family: var(--ds-sans); font-size: 14px; padding: 7px 9px;
  border: 1px solid var(--ds-rule); border-radius: var(--ds-radius);
  background: var(--ds-surface); color: var(--ds-text); width: 100%;
}
textarea { min-height: 76px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--ds-accent); outline-offset: 1px; }
.ds-check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ds-text-2); }
.ds-check input { accent-color: var(--ds-accent); width: 15px; height: 15px; }
.ds-btn {
  font-family: var(--ds-sans); font-size: 14px; font-weight: 500;
  padding: 8px 15px; border-radius: var(--ds-radius); cursor: pointer;
  border: 1px solid var(--ds-accent); background: var(--ds-accent); color: #fff;
}
.ds-btn:hover { filter: brightness(1.06); }
.ds-btn-ghost { background: transparent; color: var(--ds-text-2); border-color: var(--ds-rule); }
.ds-btn-ghost:hover { color: var(--ds-text); border-color: var(--ds-accent); }
.ds-btn-sm { padding: 4px 9px; font-size: 12.5px; }
.ds-actions { display: flex; gap: 9px; align-items: center; }

/* ---------- filters ---------- */
.ds-filters { display: flex; gap: 7px; flex-wrap: wrap; }
.ds-filters a {
  font-size: 13px; padding: 5px 11px; border-radius: var(--ds-radius);
  border: 1px solid var(--ds-border); text-decoration: none; color: var(--ds-text-2);
}
.ds-filters a.on { background: var(--ds-accent-wash); border-color: var(--ds-accent); color: var(--ds-accent-ink); font-weight: 600; }

/* ---------- login ---------- */
.ds-login { max-width: 380px; margin: 14vh auto; padding: 0 22px; text-align: center; }
.ds-login .ds-panel { padding: 30px 26px; }
.ds-login h1 { margin-bottom: 8px; }
.ds-note { font-size: 13px; color: var(--ds-text-muted); margin-top: 14px; }
.ds-alert { padding: 10px 13px; border-radius: var(--ds-radius); font-size: 13.5px; margin-bottom: 16px; border: 1px solid var(--ds-crit); color: var(--ds-crit); }

/* profit / loss emphasis */
.num.pos { color: var(--ds-good); }
.num.neg, .v.neg, td.neg { color: var(--ds-crit); }

/* ---------- gates / verdict ---------- */
.ds-verdict { padding: 18px 20px; border-radius: var(--ds-radius); margin-bottom: 22px;
  border: 1px solid var(--ds-border); display: flex; flex-direction: column; gap: 4px; }
.ds-verdict.ok { background: var(--ds-accent-wash); border-color: var(--ds-good); }
.ds-verdict.no { background: var(--ds-surface); }
.ds-verdict .big { font-size: 21px; font-weight: 640; letter-spacing: -0.02em; }
.ds-verdict .sm { font-size: 14px; color: var(--ds-text-2); }
.mark { font-family: var(--ds-mono); font-size: 15px; font-weight: 700; }
.mark.p { color: var(--ds-good); }
.mark.f { color: var(--ds-crit); }
tr.row-pass td { background: color-mix(in srgb, var(--ds-good) 6%, transparent); }
tr.row-fail td { background: color-mix(in srgb, var(--ds-crit) 5%, transparent); }

/* ---------- progress bar ---------- */
.ds-bar { height: 6px; background: var(--ds-surface-2); border-radius: 3px; overflow: hidden; min-width: 90px; }
.ds-bar-fill { height: 100%; background: var(--ds-accent); }

/* ---------- misc ---------- */
.ds-muted-sm { font-size: 12px; color: var(--ds-text-muted); }
.ds-notice { padding: 10px 14px; border-radius: var(--ds-radius); font-size: 13.5px;
  margin-bottom: 16px; border: 1px solid var(--ds-good); color: var(--ds-good); }

.ds-tile.warn { border-left: 2px solid var(--ds-warn); }
p.pos { color: var(--ds-good); }
p.neg { color: var(--ds-crit); }
