/* Ops panel. Two quiet colours (chalk, ink) + one loud accent (acid green) on what needs the founder. */
:root {
  --chalk: #F3F2EE;
  --ink: #0B0B0C;
  --accent: #B6FF2E;           /* only: waiting count, Approve */
  --surface: #FFFFFF;
  --text: var(--ink);
  --muted: oklch(0.45 0.005 90);
  --line: oklch(0 0 0 / 0.09);
  --ok: oklch(0.58 0.09 150);
  --warn: oklch(0.70 0.13 75);
  --bad: oklch(0.56 0.19 28);
  --radius: 14px;
  --pad: 16px;
  --shadow: 0 1px 1px oklch(0.4 0.01 90 / 0.05), 0 4px 14px oklch(0.4 0.01 90 / 0.06);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Archivo Narrow", "Roboto Condensed", "Arial Narrow", var(--font);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --chalk: #0E0E10; --surface: #18181B; --text: #F3F2EE;
    --muted: oklch(0.72 0.005 90); --line: oklch(1 0 0 / 0.09);
    --shadow: 0 1px 0 oklch(1 0 0 / 0.04) inset;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--chalk); color: var(--text); font: 15px/1.5 var(--font); }
main { max-width: 760px; margin: 0 auto; padding: 20px var(--pad) 64px; display: grid; gap: 16px; }
h1 { font: 700 clamp(26px, 6vw, 34px)/1.1 var(--display); margin: 4px 0; letter-spacing: -0.01em; }
h2 { font-size: 15px; margin: 0 0 8px; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; text-underline-offset: 0.2em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.num { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* top bar */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 10px var(--pad);
  background: color-mix(in oklch, var(--chalk) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { font: 700 18px/1 var(--display); text-decoration: none; letter-spacing: 0.02em; }
.top nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.top nav a { padding: 10px 10px; border-radius: 10px; text-decoration: none; color: var(--muted); white-space: nowrap; min-height: 44px; display: inline-flex; align-items: center; gap: 6px; }
.top nav a[aria-current] { color: var(--text); background: var(--surface); box-shadow: var(--shadow); }
.count { background: var(--accent); color: var(--ink); border-radius: 999px; padding: 0 7px; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* cards */
.card { background: var(--surface); border-radius: var(--radius); padding: var(--pad); box-shadow: var(--shadow); border: 1px solid var(--line); }
.row-link { display: flex; justify-content: space-between; align-items: center; text-decoration: none; min-height: 52px; }

/* hero: the one thing that matters */
.hero { display: grid; gap: 10px; }
.need, .calm { display: flex; align-items: baseline; gap: 12px; text-decoration: none; padding: 18px 20px; border-radius: 20px; }
.need { background: var(--accent); color: var(--ink); transition: transform 150ms var(--ease); }
.need:active { transform: scale(0.98); }
.calm { background: var(--surface); border: 1px solid var(--line); }
.big { font: 800 clamp(44px, 14vw, 72px)/0.9 var(--display); }
.need span:last-child, .calm span:last-child { font-size: 18px; font-weight: 600; }
.urgent { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.urgent li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; background: var(--surface); border-radius: 12px; border: 1px solid var(--line); }
.urgent a { text-decoration: none; }

/* lights */
.lights { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 640px) { .lights { grid-template-columns: repeat(4, 1fr); } }
.light { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 2px; }
.light .label { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.light .label::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.light.warn .label::before { background: var(--warn); }
.light.bad .label::before { background: var(--bad); }
.light .value { font-weight: 650; }
.light.bad { border-color: color-mix(in oklch, var(--bad) 45%, transparent); }

.warn-card { border-color: color-mix(in oklch, var(--warn) 60%, transparent); }
.qr { display: block; margin-top: 10px; border-radius: 8px; background: #fff; padding: 8px; }

.alerts { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.alerts li { display: flex; gap: 12px; justify-content: space-between; align-items: start; padding-top: 10px; border-top: 1px solid var(--line); }
.alerts li:first-child { border-top: 0; padding-top: 0; }

/* buttons: one system */
.btn { font: inherit; font-weight: 600; min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); cursor: pointer; transition: transform 150ms var(--ease), background 150ms; }
.btn:active { transform: scale(0.97); }
.btn:focus-visible, a:focus-visible, select:focus-visible, textarea:focus-visible, input:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.btn.primary { background: var(--accent); color: var(--ink); border-color: transparent; }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn.link, button.link { background: none; border: 0; text-decoration: underline; text-underline-offset: 0.2em; color: var(--muted); font: inherit; cursor: pointer; min-height: 44px; }
.btn.danger { background: var(--bad); color: #fff; border-color: transparent; }
.btn.danger-outline { color: var(--bad); border-color: color-mix(in oklch, var(--bad) 50%, transparent); }
.btn:disabled { opacity: 0.6; }
.kill p { margin-bottom: 12px; color: var(--muted); }
.kill-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.logout { text-align: center; }

/* plans */
.plan { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--pad); box-shadow: var(--shadow); display: grid; gap: 10px; scroll-margin-top: 80px; }
.plan.u-now { border-left: 4px solid var(--bad); }
.plan header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; }
.plan .code { font-weight: 700; font-variant-numeric: tabular-nums; }
.plan h2 { font-size: 18px; margin: 0; text-wrap: balance; }
.chip { border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; font-size: 12px; }
.chip.warn { border-color: var(--warn); }
.context { color: var(--muted); }
.note { font-size: 13px; padding: 8px 10px; border-radius: 8px; background: color-mix(in oklch, var(--warn) 14%, transparent); }
.steps { margin: 0; padding-left: 22px; display: grid; gap: 12px; }
.step-head { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; margin-bottom: 4px; }
.kind { font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; font-size: 11px; color: var(--muted); }
.role { font-size: 11px; padding: 0 6px; border-radius: 999px; border: 1px solid var(--line); }
.role.r-client, .role.r-partner { border-color: var(--warn); }
textarea, input[type=text], input[type=password], select { font: inherit; color: inherit; width: 100%; background: var(--chalk);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
textarea { resize: vertical; line-height: 1.45; field-sizing: content; min-height: 3lh; }
.hint { font-size: 12px; color: var(--warn); margin-top: 4px; }
.plan form { display: grid; gap: 12px; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.actions .primary { grid-column: 1 / -1; }
.actions .link { grid-column: 1 / -1; justify-self: start; }
@media (min-width: 640px) { .actions { grid-template-columns: 1fr auto auto auto; } .actions .btn { white-space: nowrap; } .actions .primary, .actions .link { grid-column: auto; } }
.flash { padding: 10px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.recent { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: 14px; }
.recent li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; }
.status { color: var(--muted); font-size: 12px; }
.s-rejected { color: var(--bad); }
.empty { text-align: center; padding: 40px 0; }
.empty .big { font-size: 40px; }

/* contacts */
.filters { display: flex; gap: 6px; overflow-x: auto; }
.filters a { padding: 8px 12px; border-radius: 999px; text-decoration: none; border: 1px solid var(--line); white-space: nowrap; text-transform: capitalize; min-height: 40px; display: inline-flex; align-items: center; gap: 6px; }
.filters a[aria-current] { background: var(--text); color: var(--chalk); }
.contacts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.contact { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; grid-template-columns: 1fr 150px; gap: 4px 12px; align-items: center; }
.contact .who { display: grid; min-width: 0; }
.contact .who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact .help { grid-column: 1 / -1; }

/* login */
.login main { min-height: 100dvh; display: grid; place-items: center; }
.login-card { width: min(360px, 100%); display: grid; gap: 10px; }
.error { color: var(--bad); }

.shake { animation: shake 300ms var(--ease); }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
