/* CallDesk design system: navy for structure, green for the next action, amber for attention. */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
:root {
  --bg:#F4F6F8; --card:#fff; --ink:#18212F; --ink2:#3D4757; --muted:#5B6576; --line:#E2E6EB; --line2:#EEF1F5;
  --navy:#1F3A5F; --navy-dk:#172B45; --green:#2E6B4F; --green-dk:#1E5139; --green-bg:#EAF4EE; --say:#F1F8F4;
  --amber-bg:#FFF6E5; --amber-line:#F5D9A8; --amber:#8A4B00; --fill:#FFF1C7; --red:#B42318; --red-bg:#FDECEA;
  --brand:var(--navy); --accent:var(--green); --warn:var(--red);
}
* { box-sizing:border-box; }
html { -webkit-text-size-adjust:100%; }
body { margin:0; font:15px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background:var(--bg); color:var(--ink); }
body.center { display:flex; min-height:100vh; align-items:center; justify-content:center; padding:16px; }
a { color:var(--navy); } a:hover { color:#0F2440; }
h1 { font-size:26px; margin:0; line-height:1.25; } h2 { font-size:17px; margin:0; } h3 { font-size:15px; margin:0; }
p { margin:.4rem 0; }
code { font-size:.9em; background:var(--line2); padding:1px 5px; border-radius:4px; }

/* ---------- buttons, chips, form controls ---------- */
button, .button, .btn { font:inherit; font-size:14px; font-weight:600; display:inline-flex; align-items:center; justify-content:center; gap:8px;
  min-height:40px; padding:8px 14px; border-radius:8px; border:1px solid #CBD2DB; background:#fff; color:var(--ink); cursor:pointer; text-decoration:none; white-space:nowrap; }
button:hover, .button:hover, .btn:hover { border-color:#9AA5B5; color:var(--ink); }
button.primary, .button.primary, .btn.primary { background:var(--green); border-color:var(--green); color:#fff; }
button.primary:hover, .button.primary:hover { background:var(--green-dk); color:#fff; }
button.danger, .button.danger { color:var(--red); border-color:#E6B0AA; }
button.big, .button.big { min-height:52px; padding:12px 22px; font-size:16px; }
button.small, .button.small { min-height:32px; padding:4px 10px; font-size:13px; }
button.link { border:0; background:none; padding:0; min-height:0; font-weight:500; color:inherit; }
button:disabled, .button[aria-disabled=true] { opacity:.5; cursor:not-allowed; }
form.inline { display:inline; }
.chip { display:inline-flex; align-items:center; gap:6px; font-size:12px; font-weight:600; border-radius:999px; padding:3px 10px; background:var(--line2); color:var(--ink2); white-space:nowrap; }
.chip.green { background:var(--green-bg); color:var(--green-dk); } .chip.amber { background:#FFF1D6; color:var(--amber); }
.chip.navy { background:var(--navy); color:#fff; } .chip.red { background:var(--red-bg); color:var(--red); }
button.chip { border:0; min-height:30px; cursor:pointer; } button.chip:hover { background:#DDE3EA; }
label { display:block; font-weight:500; margin-bottom:12px; }
.lbl { font-size:12px; font-weight:600; color:var(--muted); text-transform:uppercase; letter-spacing:.04em; }
input, select, textarea { font:inherit; font-size:14px; padding:9px 11px; border:1px solid #CBD2DB; border-radius:8px; background:#fff; color:var(--ink); }
input:focus, select:focus, textarea:focus { outline:2px solid #9DB8D9; outline-offset:0; border-color:var(--navy); }
label input, label select, label textarea, .full { display:block; width:100%; margin-top:5px; }
input[type=checkbox], input[type=radio] { width:auto; display:inline; margin:0 6px 0 0; vertical-align:middle; }
textarea.mono { font-family:ui-monospace, Consolas, monospace; font-size:13px; }
.card > textarea, .card textarea.mono { display:block; width:100%; }

/* ---------- layout ---------- */
.card { background:var(--card); border:1px solid var(--line); border-radius:12px; padding:18px; margin-bottom:14px; }
.card.flat { padding:0; overflow:hidden; } .card.narrow { max-width:420px; width:100%; }
.row { display:flex; gap:10px; align-items:center; flex-wrap:wrap; } .between { justify-content:space-between; } .grow { flex:1; }
.stack { display:flex; flex-direction:column; gap:14px; }
.two { display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:12px; }
.split { display:flex; flex-wrap:wrap; gap:18px; align-items:flex-start; } .split > .main { flex:999 1 560px; min-width:0; } .split > .side { flex:1 1 360px; min-width:0; }
.muted { color:var(--muted); } .small { font-size:13px; } .pre { white-space:pre-wrap; } .num { text-align:right; font-variant-numeric:tabular-nums; }
.filters { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:12px; }
.flash { padding:10px 14px; border-radius:8px; margin-bottom:14px; font-size:14px; }
.flash.ok { background:#E7F5EC; color:#14532D; } .flash.error { background:var(--red-bg); color:var(--red); } .flash ul { margin:0; padding-left:18px; }
.tier { display:inline-flex; align-items:center; justify-content:center; min-width:24px; height:22px; font-weight:700; background:var(--navy); color:#fff; border-radius:5px; padding:0 6px; font-size:12px; }
.empty { padding:28px; text-align:center; color:var(--muted); }

/* ---------- tables ---------- */
.scroll { overflow-x:auto; }
table.list { width:100%; border-collapse:collapse; background:var(--card); font-size:14px; }
.card > table.list, .card.flat table.list { border:0; }
table.list th { text-align:left; font-size:12px; color:var(--muted); font-weight:600; padding:10px 12px; border-bottom:1px solid var(--line); white-space:nowrap; background:#FAFBFC; }
table.list td { padding:11px 12px; border-bottom:1px solid var(--line2); vertical-align:middle; }
table.list tr:last-child td { border-bottom:0; }
td.actions { white-space:nowrap; text-align:right; } td.clip { max-width:300px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
tr.due td { background:#FFFBF2; }

/* ---------- tabs ---------- */
.tablist { display:flex; gap:2px; border-bottom:1px solid var(--line); margin:0 0 14px; flex-wrap:wrap; }
.tablist [role=tab] { border:0; border-bottom:3px solid transparent; border-radius:0; background:none; padding:12px 14px; margin-bottom:-1px; color:var(--muted); font-weight:500; min-height:44px; }
.tablist [role=tab][aria-selected=true] { color:var(--navy); border-bottom-color:var(--navy); font-weight:600; }
.tablist .count { display:inline-block; min-width:20px; padding:0 6px; margin-left:4px; border-radius:10px; background:var(--line2); font-size:12px; text-align:center; color:var(--ink2); }
.count.warn { background:var(--red-bg); color:var(--red); font-weight:700; }
.segmented { display:inline-flex; background:#E7EBF0; border-radius:10px; padding:3px; flex-wrap:wrap; }
.segmented a { font-size:13px; padding:7px 14px; border-radius:8px; text-decoration:none; color:var(--ink2); }
.segmented a[aria-current=page] { background:#fff; color:var(--ink); font-weight:600; box-shadow:0 1px 2px rgba(0,0,0,.06); }

/* ---------- caller shell ---------- */
.topbar { display:flex; flex-wrap:wrap; align-items:center; gap:14px; padding:8px 24px; background:var(--navy); color:#fff; }
.topbar a, .topbar .link { color:#fff; text-decoration:none; }
.topbar .brand { font-weight:700; font-size:16px; }
.topbar select { font-size:13px; border:0; border-radius:6px; padding:6px 8px; max-width:260px; }
.topbar nav { display:flex; gap:2px; flex-wrap:wrap; }
.topbar nav a { font-size:14px; padding:8px 12px; border-radius:6px; } .topbar nav a:hover { background:rgba(255,255,255,.08); }
.topbar nav a[aria-current=page] { background:rgba(255,255,255,.16); }
.topbar .right { margin-left:auto; display:flex; align-items:center; gap:14px; font-size:13px; }
.avatar { width:32px; height:32px; border-radius:50%; background:var(--green); display:inline-flex; align-items:center; justify-content:center; font-size:12px; font-weight:700; color:#fff; }
.page { max-width:1240px; margin:0 auto; padding:24px; } .page.wide { max-width:1480px; }

/* ---------- admin shell ---------- */
.shell { display:flex; flex-wrap:wrap; min-height:100vh; }
.sidebar { flex:1 1 230px; max-width:250px; background:var(--navy-dk); color:#fff; padding:16px 12px; display:flex; flex-direction:column; gap:2px; }
.sidebar .brand { font-weight:700; font-size:17px; padding:4px 12px 14px; color:#fff; text-decoration:none; }
.sidebar .lbl { color:#9FB0C6; padding:12px 12px 4px; }
.sidebar a { display:flex; align-items:center; gap:8px; padding:8px 12px; border-radius:8px; color:#D5DDE8; text-decoration:none; font-size:14px; }
.sidebar a:hover { background:rgba(255,255,255,.08); color:#fff; }
.sidebar a.camp { color:#fff; font-weight:600; }
.sidebar a.sub { padding-left:24px; }
.sidebar a[aria-current=page] { background:rgba(255,255,255,.15); color:#fff; }
.sidebar .badge { margin-left:auto; background:#FFE1B3; color:#6B3A00; border-radius:999px; font-size:11px; font-weight:700; padding:1px 7px; }
.sidebar .foot { margin-top:auto; padding-top:16px; border-top:1px solid rgba(255,255,255,.1); }
.content { flex:999 1 640px; min-width:0; padding:24px 28px; }
.pagehead { display:flex; flex-wrap:wrap; gap:12px; align-items:center; margin-bottom:18px; }
.pagehead .grow { min-width:260px; }

/* ---------- stats ---------- */
.kpis { display:grid; grid-template-columns:repeat(auto-fit, minmax(170px, 1fr)); gap:12px; margin-bottom:14px; }
.kpi { background:var(--card); border:1px solid var(--line); border-radius:12px; padding:16px; }
.kpi b { display:block; font-size:28px; line-height:1.2; margin-top:2px; } .kpi .muted { font-size:13px; }
.kpi.accent { border-color:var(--green); } .kpi.accent b { color:var(--green); }
.kpi.amber { background:var(--amber-bg); border-color:var(--amber-line); } .kpi.amber b, .kpi.amber .lbl { color:var(--amber); }
.bar { height:8px; background:var(--line2); border-radius:4px; overflow:hidden; } .bar > i { display:block; height:100%; background:var(--green); border-radius:4px; }
.bar.amber > i { background:#B54708; }
.attention { background:var(--amber-bg); border:1px solid var(--amber-line); border-radius:12px; padding:12px 18px; display:flex; flex-wrap:wrap; gap:8px 22px; align-items:center; font-size:14px; margin-bottom:14px; }
.attention strong { color:#6B3A00; }
.funnel { display:grid; grid-template-columns:150px minmax(0,1fr) 48px; gap:10px 12px; align-items:center; font-size:14px; }
.funnel .fbar { height:22px; background:var(--navy); border-radius:4px; min-width:3px; } .funnel .fbar.last { background:var(--green); }

/* ---------- setup checklist ---------- */
.checklist { list-style:none; margin:0; padding:8px; background:#fff; border:1px solid var(--line); border-radius:12px; flex:1 1 280px; max-width:340px; }
.checklist a, .checklist span.step { display:flex; gap:12px; align-items:flex-start; padding:12px; border-radius:10px; text-decoration:none; color:var(--ink); }
.checklist a:hover { background:#F6F8FA; } .checklist a[aria-current=step] { background:#EEF3F9; }
.checklist .sum { font-size:13px; color:var(--muted); } .checklist .warn .sum { color:var(--amber); }
.dot { flex:none; width:28px; height:28px; border-radius:50%; display:inline-flex; align-items:center; justify-content:center; font-size:13px; font-weight:700; background:var(--line2); color:var(--muted); }
.dot.done { background:#E3F2E9; color:var(--green-dk); } .dot.warn { background:#FFE1B3; color:#6B3A00; } .dot.cur { background:var(--navy); color:#fff; }
.tierrow { display:grid; grid-template-columns:70px minmax(140px,1fr) minmax(200px,2fr) 50px; gap:8px; align-items:center; }
.tierrow input { width:100%; }

/* ---------- call workspace ---------- */
.leadhead { background:#fff; border-bottom:1px solid var(--line); padding:14px 24px; display:flex; flex-wrap:wrap; gap:18px; align-items:center; }
.leadhead h1 { font-size:24px; }
.timer { display:flex; flex-direction:column; align-items:center; padding:2px 16px; border-left:1px solid var(--line); }
.timer b { font-size:22px; font-variant-numeric:tabular-nums; }
.progress { list-style:none; margin:0 0 12px; padding:0; display:flex; flex-wrap:wrap; gap:6px; }
.flow .step { background:#fff; border:1px solid var(--line); border-radius:12px; padding:22px; }
.flow .stephead { display:flex; justify-content:space-between; gap:10px; flex-wrap:wrap; align-items:center; margin-bottom:10px; }
.flow .step h3 { font-size:19px; margin:2px 0 10px; }
.flow blockquote.say, .script blockquote.say { margin:0 0 12px; padding:16px 18px; background:var(--say); border-radius:10px; font-size:19px; line-height:1.55; }
.flow .guide { color:var(--muted); font-size:14px; } .flow .guide ul { margin:.2rem 0 .4rem; padding-left:18px; }
.fill { background:var(--fill); border-radius:3px; padding:0 3px; } .fill.live { background:#E3F2E9; }
.auto { border-bottom:2px solid var(--green); }
.answers { display:grid; grid-template-columns:repeat(auto-fit, minmax(240px, 1fr)); gap:10px; margin-top:14px; }
.ans { justify-content:flex-start; width:100%; text-align:left; font-size:16px; color:var(--navy); border:2px solid var(--navy); border-radius:10px; padding:12px 14px; min-height:56px; white-space:normal; }
.ans:hover { background:var(--navy); color:#fff; border-color:var(--navy); }
.ans.end { border-color:#8A94A6; color:var(--ink2); } .ans.end:hover { background:#5B6576; border-color:#5B6576; color:#fff; }
.ans .key { display:inline-flex; align-items:center; justify-content:center; width:26px; height:26px; border-radius:6px; background:var(--line2); color:var(--ink2); font-size:13px; font-weight:700; flex:none; }
.ans .tail { margin-left:auto; font-size:12px; font-weight:500; opacity:.8; }
.asks { background:#fff; border:1px solid var(--line); border-radius:12px; padding:14px 18px; margin-top:14px; }
.asks .row { margin-top:8px; }
.backto { background:var(--amber-bg); border:1px solid var(--amber-line); border-radius:8px; padding:8px 12px; font-size:14px; margin-bottom:12px; display:flex; justify-content:space-between; gap:10px; align-items:center; flex-wrap:wrap; }
.endcard { border-left:4px solid var(--green) !important; }
.log { list-style:none; margin:0 0 10px; padding:0; display:flex; flex-direction:column; gap:6px; font-size:14px; max-height:220px; overflow:auto; }
.log li { display:flex; gap:10px; } .log .t { color:var(--muted); font-variant-numeric:tabular-nums; flex:none; }
.wrapup { border:2px dashed #CBD2DB; } .wrapup.open { border:2px solid var(--green); }
.grade { display:flex; gap:6px; flex-wrap:wrap; border:0; padding:0; margin:0 0 12px; }
.grade legend { font-weight:500; margin-bottom:6px; width:100%; }
.grade label { margin:0; } .grade input { position:absolute; opacity:0; width:1px; height:1px; }
.grade label > span { display:inline-flex; align-items:center; justify-content:center; width:44px; height:40px; border:1px solid #CBD2DB; border-radius:8px; font-weight:600; cursor:pointer; background:#fff; }
.grade input:checked + span { background:var(--navy); color:#fff; border-color:var(--navy); }
.grade input:focus-visible + span { outline:2px solid #9DB8D9; }
.flash-field { outline:3px solid var(--green) !important; transition:outline .3s; }
.callpage { display:flex; flex-wrap:wrap; gap:20px; padding:20px 24px; align-items:flex-start; }
.callpage > .main { flex:999 1 560px; min-width:0; } .callpage > .side { flex:1 1 380px; min-width:0; }
.script .card blockquote.say { font-size:16px; }

/* ---------- script editor ---------- */
.steplist { flex:1 1 240px; max-width:290px; background:#fff; border:1px solid var(--line); border-radius:12px; padding:8px; }
.steplist a { display:flex; align-items:center; gap:8px; padding:8px 10px; border-radius:8px; font-size:14px; color:var(--ink); text-decoration:none; }
.steplist a:hover { background:#F6F8FA; } .steplist a[aria-current=true] { background:#EEF3F9; font-weight:600; }
.steplist a.inherited { color:var(--muted); }
.steplist .n { display:inline-flex; min-width:24px; height:22px; align-items:center; justify-content:center; border-radius:11px; background:var(--line2); font-size:12px; font-weight:700; color:var(--ink2); }
.steplist a[aria-current=true] .n { background:var(--navy); color:#fff; }
.answerrows { display:grid; grid-template-columns:minmax(0,1.1fr) minmax(0,1.4fr) auto; gap:8px; align-items:center; }
.answerrows .rowtools { display:flex; gap:4px; }
.preview { flex:1 1 300px; max-width:380px; }
.preview .step { border-left:4px solid var(--green); }
.preview .pans { border:2px solid var(--navy); color:var(--navy); border-radius:8px; padding:8px 12px; font-weight:600; font-size:14px; margin-top:6px; }
.preview .pans.end { border-color:#8A94A6; color:var(--ink2); }
.help pre { background:#F6F8FA; padding:10px; border-radius:6px; overflow:auto; } .help summary { cursor:pointer; }

/* ---------- misc ---------- */
dl.facts { display:grid; grid-template-columns:190px 1fr; gap:6px 12px; margin:0; } dl.facts dt { color:var(--muted); font-weight:500; margin:0; } dl.facts dd { margin:0; }
dt { font-weight:600; margin-top:6px; } dd { margin:2px 0 6px; }
.call-entry p { margin:.25rem 0; }

@media (max-width:760px) {
  .two { grid-template-columns:1fr; } dl.facts { grid-template-columns:1fr; }
  .topbar, .page, .content, .callpage, .leadhead { padding-left:16px; padding-right:16px; }
  .sidebar { max-width:none; flex-basis:100%; } .sidebar .foot { margin-top:8px; }
  .timer { border-left:0; padding-left:0; } .funnel { grid-template-columns:110px minmax(0,1fr) 40px; }
  .answerrows { grid-template-columns:1fr; }
}
.preview .flow blockquote.say { font-size:15px; padding:10px 12px; margin-bottom:8px; }
