@font-face { font-family: "Instrument Sans"; src: url(/fonts/instrument-sans.woff2) format("woff2-variations"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url(/fonts/jetbrains-mono.woff2) format("woff2-variations"); font-weight: 400 700; font-display: swap; }

:root {
	--bg: #ffffff; --soft: #f3f6f6; --soft-2: #e8eeee; --raise: #ffffff; --hover: #eef3f3;
	--ink: #142321; --ink-2: #3d4d4a; --ink-3: #64736f; --line: #dfe6e5; --line-2: #c9d4d2;
	--teal: #0f766e; --teal-2: #0b5f58; --teal-t: #e2f2f0; --red: #d1432a; --red-t: #fbe9e5; --amber: #a86a00; --amber-t: #fbf0d9; --green: #1f7a3d; --green-t: #e3f3e8;
	--sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif; --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
	--r: 8px;
}
:root[data-theme=dark] { --bg: #0d1514; --soft: #121d1c; --soft-2: #182625; --raise: #121d1c; --hover: #1a2928; --ink: #e7efed; --ink-2: #b9c7c4; --ink-3: #8a9a96; --line: #22312f; --line-2: #2e403d;
	--teal: #3cc2b4; --teal-2: #5fd4c7; --teal-t: #13302d; --red: #f07a62; --red-t: #3a1d17; --amber: #e7b04a; --amber-t: #33270f; --green: #6fd08f; --green-t: #14301e; }
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) { --bg: #0d1514; --soft: #121d1c; --soft-2: #182625; --raise: #121d1c; --hover: #1a2928; --ink: #e7efed; --ink-2: #b9c7c4; --ink-3: #8a9a96; --line: #22312f; --line-2: #2e403d;
	--teal: #3cc2b4; --teal-2: #5fd4c7; --teal-t: #13302d; --red: #f07a62; --red-t: #3a1d17; --amber: #e7b04a; --amber-t: #33270f; --green: #6fd08f; --green-t: #14301e; } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--soft); color: var(--ink); font: 400 14.5px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--teal); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono, code { font-family: var(--mono); font-size: .92em; letter-spacing: -.01em; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

/* ---------- top bar ---------- */
.top { position: sticky; top: 0; z-index: 30; background: var(--bg); border-bottom: 1px solid var(--line); }
.top__in { display: flex; align-items: center; gap: 18px; height: 56px; padding: 0 20px; max-width: 1440px; margin: 0 auto; }
.logo { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 15.5px; text-decoration: none; color: var(--ink); white-space: nowrap; }
.logo img { width: 26px; height: 26px; }
.logo small { font-weight: 500; color: var(--ink-3); font-size: 13px; margin-left: 2px; }
.nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.nav::-webkit-scrollbar { display: none; }
.nav a { position: relative; display: flex; align-items: center; gap: 6px; height: 56px; padding: 0 11px; text-decoration: none; color: var(--ink-2); font-weight: 500; white-space: nowrap; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current=page] { color: var(--ink); }
.nav a[aria-current=page]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: var(--teal); border-radius: 2px; }
.count { min-width: 19px; height: 19px; padding: 0 6px; border-radius: 10px; background: var(--teal); color: #fff; font-size: 11.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.count--red { background: var(--red); }
.who { display: flex; align-items: center; gap: 10px; }
.who__btn { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px 0 4px; border: 1px solid var(--line); border-radius: 18px; background: var(--raise); cursor: pointer; }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--teal-t); color: var(--teal); font-weight: 700; font-size: 11.5px; display: inline-flex; align-items: center; justify-content: center; }
.menu { position: absolute; right: 20px; top: 52px; width: 240px; background: var(--raise); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 30px rgba(10,30,28,.12); padding: 6px; }
.menu p { margin: 6px 10px 8px; font-size: 13px; color: var(--ink-3); }
.menu button, .menu a { display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; background: none; border-radius: 6px; cursor: pointer; text-decoration: none; color: var(--ink); }
.menu button:hover, .menu a:hover { background: var(--hover); }
.demo-bar { background: var(--ink); color: #dfe8e6; font-size: 13px; text-align: center; padding: 7px 16px; }
.demo-bar b { color: #fff; } .demo-bar a { color: #8fe0d6; }

/* ---------- page ---------- */
main { max-width: 1440px; margin: 0 auto; padding: 22px 20px 70px; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.head h1 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
.head p { margin: 4px 0 0; color: var(--ink-3); }
.head__actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
h2 { font-size: 15.5px; margin: 0 0 12px; font-weight: 700; }
h2 small { font-weight: 500; color: var(--ink-3); margin-left: 6px; font-size: 13px; }
.card { background: var(--raise); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; }
.card + .card { margin-top: 14px; }
.card--flush { padding: 0; overflow: hidden; }
.card__head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card__head h2 { margin: 0; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: 1fr 1fr; } .g3 { grid-template-columns: repeat(3, 1fr); } .g4 { grid-template-columns: repeat(4, 1fr); } .g-main { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
.muted { color: var(--ink-3); } .small { font-size: 13px; }
.empty { padding: 26px 18px; color: var(--ink-3); text-align: center; }

/* ---------- buttons, forms, chips ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 13px; border: 1px solid var(--line-2); border-radius: 7px; background: var(--raise); color: var(--ink); font-weight: 600; font-size: 13.5px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--hover); }
.btn--primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn--primary:hover { background: var(--teal-2); border-color: var(--teal-2); }
.btn--danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, var(--line)); }
.btn--ghost { border-color: transparent; background: transparent; }
.btn--sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
label.f { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
.in, select.in, textarea.in { width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 7px; background: var(--bg); }
textarea.in { height: auto; min-height: 140px; padding: 9px 10px; line-height: 1.5; resize: vertical; }
.in:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-t); }
.field { margin-bottom: 12px; }
.row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.row > .field { flex: 1; min-width: 140px; }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 11px; font-size: 12px; font-weight: 600; background: var(--soft-2); color: var(--ink-2); white-space: nowrap; }
.chip--teal { background: var(--teal-t); color: var(--teal); } .chip--red { background: var(--red-t); color: var(--red); } .chip--amber { background: var(--amber-t); color: var(--amber); } .chip--green { background: var(--green-t); color: var(--green); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 7px; overflow: hidden; }
.seg a, .seg button { padding: 6px 11px; border: 0; background: var(--raise); text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: 13px; cursor: pointer; }
.seg a + a, .seg button + button { border-left: 1px solid var(--line); }
.seg [aria-current=true] { background: var(--teal-t); color: var(--teal); }

/* ---------- tables ---------- */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-3); padding: 9px 14px; border-bottom: 1px solid var(--line); background: var(--soft); white-space: nowrap; }
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr.link { cursor: pointer; } .tbl tbody tr.link:hover td { background: var(--hover); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl-wrap { overflow-x: auto; }

/* ---------- today ---------- */
.brief { background: var(--ink); color: #e6efed; border-radius: var(--r); padding: 20px 22px; border: 0; }
.brief h2 { color: #fff; font-size: 13px; font-weight: 600; margin-bottom: 10px; color: #9fe3da; }
.brief p { margin: 0 0 8px; font-size: 15.5px; line-height: 1.55; } .brief p:last-child { margin: 0; }
.brief small { display: block; margin-top: 12px; font-size: 12px; color: #93a6a2; }
.kpi { background: var(--raise); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.kpi small { display: block; font-size: 12.5px; color: var(--ink-3); font-weight: 500; }
.kpi b { display: block; font-size: 25px; letter-spacing: -.02em; margin: 2px 0 1px; font-variant-numeric: tabular-nums; }
.kpi span { font-size: 12.5px; color: var(--ink-3); }
.alert { display: flex; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.alert:last-child { border-bottom: 0; }
.alert__bar { width: 4px; border-radius: 2px; flex: none; background: var(--line-2); }
.alert--high .alert__bar { background: var(--red); } .alert--medium .alert__bar { background: var(--amber); } .alert--low .alert__bar { background: var(--teal); }
.alert b { display: block; font-weight: 600; } .alert p { margin: 2px 0 0; color: var(--ink-2); font-size: 13.5px; }
.alert__act { margin-left: auto; display: flex; gap: 6px; align-items: flex-start; }
.run { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--line); }
.run:last-child { border-bottom: 0; }
.bar { flex: 1; height: 7px; border-radius: 4px; background: var(--soft-2); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--teal); border-radius: 4px; }
canvas.chart { width: 100%; height: 190px; display: block; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-3); margin-top: 8px; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { padding: 9px 18px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.feed li:last-child { border-bottom: 0; }
.feed small { color: var(--ink-3); margin-left: 6px; }

/* ---------- inbox ---------- */
.inbox { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 14px; align-items: start; }
.msgs { max-height: calc(100vh - 170px); overflow-y: auto; }
.msg { display: block; padding: 12px 16px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.msg:hover { background: var(--hover); }
.msg[aria-current=true] { background: var(--teal-t); box-shadow: inset 3px 0 0 var(--teal); }
.msg b { display: block; font-weight: 600; } .msg .s { display: block; font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg .m { display: flex; gap: 6px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.mail { white-space: pre-wrap; font-size: 13.5px; line-height: 1.55; background: var(--soft); border: 1px solid var(--line); border-radius: 7px; padding: 12px 14px; max-height: 300px; overflow-y: auto; }
.mail mark { background: color-mix(in srgb, var(--teal) 22%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.flags { list-style: none; margin: 0 0 14px; padding: 0; }
.flags li { display: flex; gap: 8px; padding: 7px 10px; border-radius: 6px; font-size: 13.5px; margin-bottom: 5px; }
.flags li.warn { background: var(--amber-t); color: var(--amber); } .flags li.check { background: var(--teal-t); color: var(--teal); } .flags li.info { background: var(--soft); color: var(--ink-2); }
.lines td .in { height: 32px; }
.conf { font-size: 12px; font-weight: 600; }
.conf--hi { color: var(--green); } .conf--mid { color: var(--amber); } .conf--lo { color: var(--red); }
.said { font-size: 12px; color: var(--ink-3); }
.reader { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 7px; background: var(--teal-t); color: var(--teal); font-size: 13.5px; margin-bottom: 14px; }

/* ---------- dispatch, trace, leads ---------- */
.stops { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.stops li { counter-increment: s; display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px; padding: 11px 18px; border-bottom: 1px solid var(--line); }
.stops li:last-child { border-bottom: 0; }
.stops li::before { content: counter(s); width: 24px; height: 24px; border-radius: 50%; background: var(--soft-2); font-weight: 700; font-size: 12px; display: flex; align-items: center; justify-content: center; }
.stops li.done::before { background: var(--green); color: #fff; content: "✓"; }
.stops .items { font-size: 12.5px; color: var(--ink-3); }
.trace { display: grid; grid-template-columns: 1fr 1.1fr 1.3fr; gap: 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--raise); overflow: hidden; }
.trace > div { padding: 16px 18px; border-right: 1px solid var(--line); }
.trace > div:last-child { border-right: 0; }
.trace h3 { margin: 0 0 10px; font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.trace .node { padding: 10px 12px; border: 1px solid var(--line); border-radius: 7px; margin-bottom: 8px; font-size: 13.5px; background: var(--bg); }
.trace .node b { display: block; }
.trace .node--focus { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-t); }
.kanban { display: grid; grid-template-columns: repeat(6, minmax(190px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.col { background: var(--soft-2); border-radius: var(--r); padding: 10px; min-height: 140px; }
.col h3 { margin: 2px 4px 10px; font-size: 13px; display: flex; justify-content: space-between; }
.lead { display: block; background: var(--raise); border: 1px solid var(--line); border-radius: 7px; padding: 10px 11px; margin-bottom: 8px; cursor: pointer; text-align: left; width: 100%; }
.lead:hover { border-color: var(--line-2); }
.lead b { display: block; font-size: 13.5px; } .lead small { display: block; color: var(--ink-3); font-size: 12px; }
.modal-back { position: fixed; inset: 0; background: rgba(8,20,18,.45); z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 60px 16px; overflow-y: auto; }
.modal { width: 100%; max-width: 560px; background: var(--raise); border-radius: 10px; padding: 20px 22px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal h2 { font-size: 18px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 60; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.err { color: var(--red); font-size: 13px; margin-top: 6px; min-height: 1em; }

/* ---------- sign in ---------- */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 30px 16px; }
.gate__box { width: 100%; max-width: 440px; }
.gate__box .card { padding: 26px; }
.roles { display: grid; gap: 8px; margin: 14px 0 4px; }
.roles button { display: flex; gap: 12px; align-items: center; text-align: left; padding: 11px 13px; border: 1px solid var(--line); border-radius: 8px; background: var(--raise); cursor: pointer; }
.roles button:hover { border-color: var(--teal); background: var(--teal-t); }
.roles b { display: block; } .roles small { display: block; color: var(--ink-3); font-size: 12.5px; }

@media (max-width: 1100px) { .g-main, .inbox { grid-template-columns: 1fr; } .g4 { grid-template-columns: 1fr 1fr; } .trace { grid-template-columns: 1fr; } .trace > div { border-right: 0; border-bottom: 1px solid var(--line); } .msgs { max-height: 340px; } }
@media (max-width: 720px) { main { padding: 16px 12px 60px; } .g2, .g3 { grid-template-columns: 1fr; } .top__in { padding: 0 12px; gap: 10px; } .logo small { display: none; } .who__name { display: none; } .head h1 { font-size: 21px; } .tbl th, .tbl td { padding: 9px 10px; } .hide-sm { display: none; } }
