/* Invergo Design Studio (Platform B). Same structure as the outreach portal, teal accent so the two are never confused. */
:root {
  --bg: #f4f5f8; --panel: #ffffff; --panel-2: #f8f9fb; --ink: #111827; --ink-2: #374151; --muted: #6b7280;
  --line: #e5e7eb; --line-2: #eef0f3;
  --accent: #0f766e; --accent-ink: #ffffff; --accent-soft: #e6f4f2; --accent-strong: #115e59;
  --good: #047857; --good-bg: #ecfdf5; --warn: #b45309; --warn-bg: #fffbeb; --bad: #b91c1c; --bad-bg: #fef2f2;
  --side: #0f172a; --side-ink: #cbd5e1; --side-active: #1e293b;
  --radius: 12px; --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f17; --panel: #121826; --panel-2: #161d2d; --ink: #f3f4f6; --ink-2: #d1d5db; --muted: #9ca3af;
    --line: #232b3b; --line-2: #1c2433;
    --accent: #2dd4bf; --accent-ink: #04201d; --accent-soft: #0f2e2b; --accent-strong: #5eead4;
    --good: #34d399; --good-bg: #0f2a22; --warn: #fbbf24; --warn-bg: #2b2210; --bad: #f87171; --bad-bg: #2d1414;
    --side: #070a10; --side-ink: #94a3b8; --side-active: #151b28;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14.5px/1.55 "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font: 12.5px ui-monospace, "SF Mono", Menlo, Consolas, monospace; word-break: break-all; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-ink); padding: 20px 14px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 16px; padding: 0 8px; }
.brand:hover { text-decoration: none; }
.brand .logo { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, #0d9488, #0e7490); display: grid; place-items: center; font-size: 15px; color: #fff; }
.brand small { display: block; font-weight: 500; font-size: 11.5px; color: var(--side-ink); letter-spacing: .02em; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--side-ink); font-weight: 500; }
.side nav a:hover { background: var(--side-active); color: #fff; text-decoration: none; }
.side nav a.active { background: var(--side-active); color: #fff; box-shadow: inset 3px 0 0 #2dd4bf; }
.side nav .badge { margin-left: auto; background: #0d9488; color: #fff; border-radius: 999px; font-size: 11px; padding: 0 7px; line-height: 18px; }
.side .foot { margin-top: auto; border-top: 1px solid #1e293b; padding-top: 14px; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; }
.side .foot form { margin: 0; }
.side .foot button { background: none; border: 1px solid #334155; color: var(--side-ink); padding: 4px 10px; font-size: 12.5px; }
.side .foot button:hover { color: #fff; border-color: #64748b; }
.content { min-width: 0; }
main { max-width: 1160px; margin: 0 auto; padding: 28px 32px 64px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.page-head h1 { font-size: 24px; letter-spacing: -.01em; margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--muted); max-width: 720px; }
h2 { font-size: 16px; margin: 30px 0 12px; display: flex; align-items: baseline; gap: 8px; }
h2 small { color: var(--muted); font-weight: 400; font-size: 13px; }

/* ---------- surfaces ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; margin: 0 0 16px; }
.card h3 { margin: 0 0 10px; font-size: 15px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; display: block; color: inherit; }
a.stat:hover { border-color: var(--accent); text-decoration: none; }
.stat .k { color: var(--muted); font-size: 12.5px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.stat .v { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin-top: 4px; }
.stat .s { color: var(--muted); font-size: 12.5px; }
.tw { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
th { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; background: var(--panel-2); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--panel-2); }
table.compact td, table.compact th { padding: 8px 12px; font-size: 13.5px; }
.empty { color: var(--muted); }
td.empty { text-align: center; padding: 28px; }
.empty-state { text-align: center; padding: 36px 20px; color: var(--muted); }
.empty-state strong { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }

/* ---------- feedback ---------- */
.flash { display: flex; gap: 10px; align-items: center; background: var(--accent-soft); color: var(--ink); border: 1px solid transparent; padding: 10px 14px; border-radius: 10px; margin-bottom: 18px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }
.pill.good { background: var(--good-bg); color: var(--good); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.plain::before { display: none; }
.note { color: var(--muted); font-size: 13px; }
.alert { padding: 12px 14px; border-radius: 10px; background: var(--bad-bg); color: var(--bad); margin: 0 0 16px; }

/* ---------- forms ---------- */
button, .button { font: inherit; font-weight: 600; font-size: 14px; padding: 8px 16px; border-radius: 8px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); cursor: pointer; display: inline-flex; align-items: center; gap: 8px; justify-content: center; }
button:hover, .button:hover { background: var(--accent-strong); border-color: var(--accent-strong); text-decoration: none; }
button.secondary, .button.secondary { background: var(--panel); color: var(--ink); border-color: var(--line); }
button.secondary:hover, .button.secondary:hover { border-color: var(--muted); background: var(--panel); }
button.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
button.danger:hover { filter: brightness(.92); background: var(--bad); }
button.link { background: none; border: none; color: var(--accent); padding: 0; font-weight: 500; }
button:disabled { opacity: .45; cursor: not-allowed; }
button.big { padding: 11px 18px; width: 100%; }
input, select, textarea { font: inherit; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); width: 100%; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; }
label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); }
label input, label select, label textarea { margin-top: 6px; font-weight: 400; }
label .help, .help { display: block; font-weight: 400; color: var(--muted); font-size: 12.5px; margin-top: 5px; }
label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
label.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line-2); }
form.inline { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0; }
form.inline input, form.inline select { width: auto; flex: 1 1 200px; }
.actions { display: flex; gap: 14px; align-items: center; }
.actions form { margin: 0; }
.days { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.days label { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-weight: 500; cursor: pointer; }
.days input { width: auto; margin: 0; accent-color: var(--accent); }
.pair { display: flex; gap: 10px; align-items: center; }
.pair input, .pair select { margin-top: 6px; }
.pair span { color: var(--muted); padding-top: 6px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.active { color: var(--accent); border-color: var(--accent); }
.meta-line { color: var(--muted); font-size: 12.5px; margin-top: 4px; }

/* ---------- switches ---------- */
.switches { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.switch { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; display: flex; flex-direction: column; gap: 10px; margin: 0; }
.switch .label { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 600; }
.switch .desc { color: var(--muted); font-size: 12.5px; flex: 1; }
.switch .state { font-size: 12px; font-weight: 700; letter-spacing: .05em; padding: 2px 9px; border-radius: 999px; background: var(--line-2); color: var(--muted); }
.switch.on { border-color: color-mix(in srgb, var(--good) 40%, var(--line)); }
.switch.on .state { background: var(--good-bg); color: var(--good); }
.switch .controls { display: flex; gap: 8px; }
.switch .controls input { flex: 1; min-width: 0; }
.switch.stop { background: var(--bad-bg); border-color: color-mix(in srgb, var(--bad) 30%, var(--line)); }
.switch.stop .label { color: var(--bad); }

/* ---------- queue and replies ---------- */
.draft-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 12px; }
.draft-head strong { font-size: 15.5px; }
.draft-cols { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; }
.evidence { background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 12px 14px; font-size: 13px; align-self: start; }
.evidence h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.evidence ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.evidence li.used { color: var(--ink); }
.evidence li .id { font-weight: 700; color: var(--muted); margin-right: 4px; }
.evidence li.used .id { color: var(--accent); }
pre.mail { white-space: pre-wrap; font: 14px/1.6 "Inter", ui-sans-serif, system-ui, sans-serif; background: var(--panel-2); border: 1px solid var(--line-2); padding: 12px 14px; border-radius: 10px; margin: 8px 0; }
details summary { cursor: pointer; font-weight: 600; color: var(--ink-2); }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(1200px 600px at 10% -10%, #ccfbf1 0, transparent 60%), radial-gradient(900px 500px at 110% 110%, #e0f2fe 0, transparent 55%), var(--bg); }
@media (prefers-color-scheme: dark) { .login-wrap { background: radial-gradient(1200px 600px at 10% -10%, #042f2e 0, transparent 60%), var(--bg); } }
.login { width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 20px 50px -12px rgba(4, 47, 46, .25); padding: 32px 30px; }
.login .brand { color: var(--ink); padding: 0; margin-bottom: 22px; }
.login .brand small { color: var(--muted); }
.login h1 { font-size: 21px; margin: 0 0 4px; }
.login p { color: var(--muted); margin: 0 0 22px; }
.login form { display: flex; flex-direction: column; gap: 16px; }

/* ---------- responsive ---------- */
@media (max-width: 1020px) {
  .grid-4, .switches { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .draft-cols { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .side { position: sticky; top: 0; z-index: 5; height: auto; flex-direction: row; align-items: center; padding: 10px 12px; gap: 10px; overflow-x: auto; }
  .brand small, .side .foot .who { display: none; }
  .side nav { flex-direction: row; gap: 2px; }
  .side nav a { padding: 7px 9px; white-space: nowrap; }
  .side nav a span.t { display: none; }
  .side nav a.active span.t { display: inline; }
  .side nav a.active { box-shadow: none; }
  .side .foot { margin: 0 0 0 auto; border: 0; padding: 0; }
  main { padding: 20px 16px 48px; }
  .grid-3, .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) { .switches { grid-template-columns: 1fr; } .stat .v { font-size: 22px; } }
.flash.bad { background: var(--bad-bg); color: var(--bad); }

/* ---------- studio ---------- */
.shots { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.shot { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.shot img { display: block; width: 100%; height: auto; }
.shot .cap { font-size: 12px; color: var(--muted); padding: 6px 10px; border-top: 1px solid var(--line-2); }
.scroll { max-height: 560px; overflow-y: auto; }
.gate-fail td:first-child { color: var(--bad); font-weight: 600; }
.score { display: inline-block; min-width: 28px; text-align: center; font-weight: 700; border-radius: 6px; padding: 1px 6px; background: var(--line-2); }
.score.hi { background: var(--good-bg); color: var(--good); } .score.lo { background: var(--bad-bg); color: var(--bad); }
pre.code { white-space: pre-wrap; font: 12.5px/1.5 ui-monospace, "SF Mono", Menlo, Consolas, monospace; background: var(--panel-2); border: 1px solid var(--line-2); padding: 12px 14px; border-radius: 10px; max-height: 420px; overflow: auto; margin: 8px 0; }
.swatch { display: inline-block; width: 18px; height: 18px; border-radius: 4px; border: 1px solid var(--line); vertical-align: middle; margin-right: 4px; }
@media (max-width: 760px) { .shots { grid-template-columns: 1fr; } }
