/* Convoi Admin. One look, Convoi's own dark: orange = the brand, blue = support, green = live, red = reports. */
:root {
  --bg: #0B0D0F; --side: #101317; --card: #1A1D22; --card2: #22262C; --ink: #FFFFFF; --ink2: rgba(255,255,255,.82);
  --dim: #99A1AD; --line: rgba(255,255,255,.07); --orange: #FF6B00; --blue: #64AAFF; --blue-ink: #9CCBFF;
  --green: #30D158; --red: #FF3B30; --red-ink: #FF8A82; --amber: #FFB340;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --sans: -apple-system, "SF Pro Text", BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.4 var(--sans); -webkit-text-size-adjust: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.booting { color: var(--dim); padding: 40px 24px; margin: 0; }
.dim { color: var(--dim); }
.mono { font-family: var(--mono); font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; }

/* ── signing in ── */
.authwrap { min-height: 100vh; display: grid; place-items: center; padding: 32px 20px; }
.auth { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 10px; }
.auth h1 { font-size: 24px; font-weight: 800; margin: 4px 0 2px; }
.auth label { font-size: 12px; color: var(--dim); margin-top: 4px; }
.auth input { background: var(--card); border: 1px solid rgba(255,255,255,.1); border-radius: 10px; padding: 11px 12px; font-size: 15px; }
.auth input.code { font-size: 26px; font-weight: 800; letter-spacing: .32em; text-align: center; font-variant-numeric: tabular-nums; }
.auth .qr { width: 196px; height: 196px; background: #fff; border-radius: 12px; padding: 8px; align-self: center; margin: 6px 0; }
.auth p { margin: 0; font-size: 13px; color: var(--ink2); }
.auth .fine { font-size: 12px; color: var(--dim); }
.auth code { font-family: var(--mono); font-size: 12px; word-break: break-all; background: var(--card); padding: 2px 6px; border-radius: 6px; }
.err { color: var(--red-ink); font-size: 13px; min-height: 18px; margin: 0; }
.lock { color: var(--dim); font-size: 12px; border-left: 2px solid var(--green); padding-left: 10px; }
.alarm { color: #fff; background: rgba(255,59,48,.18); border: 1px solid rgba(255,59,48,.5); border-radius: 10px; padding: 12px; font-weight: 700; }
.steps { margin: 0; padding-left: 18px; color: var(--ink2); font-size: 13px; }
.steps li { margin: 4px 0; }

.brand { display: flex; align-items: center; gap: 9px; font-weight: 900; font-size: 16px; text-decoration: none; }
.brand i { width: 26px; height: 26px; border-radius: 8px; background: var(--orange); display: grid; place-items: center; font-style: normal; font-size: 14px; color: #fff; }
.brand small { font-weight: 600; font-size: 11.5px; color: var(--dim); }

.btn { border: 0; border-radius: 10px; padding: 9px 15px; font-weight: 800; font-size: 13px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
.btn.wide { width: 100%; padding: 12px; font-size: 14px; }
.btn.o { background: var(--orange); color: #fff; }
.btn.q { background: rgba(255,255,255,.08); color: #fff; }
.btn:disabled { opacity: .5; cursor: default; }
.link { background: none; border: 0; padding: 0; color: var(--dim); text-decoration: underline; cursor: pointer; font-size: 12px; }

/* ── the frame ── */
.layout { display: grid; grid-template-columns: 212px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--side); border-right: 1px solid var(--line); padding: 18px 12px 14px; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 0; height: 100vh; }
.side .brand { margin: 0 6px; }
.navs { display: flex; flex-direction: column; gap: 3px; }
.nv { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; color: rgba(255,255,255,.72); font-weight: 600; text-decoration: none; }
.nv:hover { background: rgba(255,255,255,.04); }
.nv.on { background: rgba(255,107,0,.13); color: #fff; }
.nv svg { width: 16px; height: 16px; flex: none; }
.nv .n { margin-left: auto; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: rgba(100,170,255,.18); color: var(--blue-ink); }
.who { margin-top: auto; border-top: 1px solid var(--line); padding: 12px 6px 0; font-size: 11.5px; color: var(--dim); display: flex; flex-direction: column; gap: 3px; }
.who b { color: #fff; font-weight: 600; word-break: break-all; }
.who .g { color: var(--green); font-weight: 800; }
.main { padding: 22px 26px 40px; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 14px; max-width: 1180px; }
.mh { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.mh h1 { font-size: 24px; font-weight: 900; margin: 0; }
.card { background: var(--card); border-radius: 14px; padding: 14px 16px; min-width: 0; }
.lbl { font-size: 10.5px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--dim); margin: 0 0 10px; }
.hint { font-size: 12px; color: var(--dim); margin: 0; }
.hint b { color: var(--ink2); font-weight: 600; }
.errbox b { display: block; margin-bottom: 4px; }
.errbox p { color: var(--ink2); margin: 0 0 10px; }
.empty { color: var(--dim); padding: 22px 12px; margin: 0; text-align: center; }

/* ── home ── */
.needs { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.need { border-radius: 12px; padding: 12px 14px; display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: center; text-decoration: none; }
.need .ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-weight: 900; }
.need b { display: block; font-size: 14.5px; }
.need i { display: block; font-style: normal; font-size: 12px; color: var(--dim); margin-top: 2px; }
.need .go { font-weight: 800; font-size: 12.5px; }
.need.s { background: rgba(100,170,255,.09); border: 1px solid rgba(100,170,255,.25); }
.need.s .ic { background: rgba(100,170,255,.18); color: var(--blue-ink); } .need.s .go { color: var(--blue-ink); }
.need.m { background: rgba(255,59,48,.08); border: 1px solid rgba(255,59,48,.25); }
.need.m .ic { background: rgba(255,59,48,.18); color: var(--red-ink); }
.need.ok { background: rgba(48,209,88,.07); border: 1px solid rgba(48,209,88,.22); }
.need.ok .ic { background: rgba(48,209,88,.16); color: #6FDB9B; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.kpi { background: var(--card); border-radius: 12px; padding: 12px 14px; }
.kpi b { display: block; font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kpi span { color: var(--dim); font-size: 12px; }
.kpi.live b { color: var(--green); }
.two { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 12px; }
.col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.chart { width: 100%; height: auto; display: block; }
.chart .gl { stroke: rgba(255,255,255,.07); }
.chart text { fill: #8A919C; font-size: 10px; font-family: var(--sans); }
.chart .bar { fill: #64AAFF; opacity: .5; }
.chart .line { fill: none; stroke: #FF6B00; stroke-width: 2; stroke-linejoin: round; }
.key { display: flex; gap: 14px; font-size: 11.5px; color: var(--dim); margin-top: 6px; flex-wrap: wrap; }
.key i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.stat { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.stat:first-of-type { border-top: 0; }
.stat span { color: var(--ink2); }
.stat b { font-variant-numeric: tabular-nums; font-size: 14.5px; white-space: nowrap; }
.week { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px 16px; }
.week div { font-size: 12px; color: var(--dim); }
.week b { display: block; color: #fff; font-size: 18px; font-variant-numeric: tabular-nums; }

/* ── lists ── */
.chip { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.chip.b { background: rgba(100,170,255,.16); color: var(--blue-ink); }
.chip.k { background: rgba(255,255,255,.08); color: rgba(255,255,255,.78); }
.chip.g { background: rgba(48,209,88,.14); color: #6FDB9B; }
.chip.a { background: rgba(255,179,64,.16); color: var(--amber); }
.tabs { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tab { padding: 7px 13px; border-radius: 9px; font-weight: 700; font-size: 12.5px; color: rgba(255,255,255,.72); background: rgba(255,255,255,.05); text-decoration: none; }
.tab.on { background: #fff; color: #0B0D0F; }
.search { margin-left: auto; background: var(--card); border: 1px solid rgba(255,255,255,.06); border-radius: 9px; padding: 8px 12px; width: 260px; max-width: 100%; }
.rows { background: var(--card); border-radius: 14px; overflow: hidden; }
.row { display: grid; grid-template-columns: 96px 118px minmax(0, 1fr) 140px 48px 150px 78px; gap: 12px; align-items: center; padding: 12px 14px; border-top: 1px solid var(--line); text-decoration: none; }
.row:first-child { border-top: 0; }
.row:hover { background: rgba(255,255,255,.03); }
.row .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .when { text-align: right; }
.late { color: var(--amber); font-weight: 800; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { font-size: 10px; letter-spacing: .09em; text-transform: uppercase; color: var(--dim); text-align: left; padding: 0 10px 8px; font-weight: 800; }
.tbl td { padding: 10px; border-top: 1px solid var(--line); vertical-align: top; }

/* ── one report ── */
.rh { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.rh h1 { font-size: 21px; font-weight: 900; margin: 2px 0 0; overflow-wrap: anywhere; }
.rh .ref { font-family: var(--mono); font-size: 12.5px; color: var(--dim); display: flex; gap: 8px; align-items: center; }
.acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.acts select { background: var(--card); border: 1px solid rgba(255,255,255,.1); border-radius: 10px; padding: 8px 10px; font-size: 13px; }
.rd { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.msg { font-size: 14.5px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px 16px; margin-top: 14px; }
.facts div { font-size: 13px; overflow-wrap: anywhere; }
.facts i { display: block; font-style: normal; color: var(--dim); font-size: 11px; }
.logbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.logbar input { background: #0F1215; border: 1px solid rgba(255,255,255,.08); border-radius: 8px; padding: 6px 10px; font-size: 12px; width: 220px; max-width: 100%; }
.logv { background: #07090B; border-radius: 10px; padding: 10px 12px; font-family: var(--mono); font-size: 11.5px; line-height: 1.6; color: #B3BAC4; max-height: 420px; overflow: auto; white-space: pre; margin: 0; }
.shots { display: flex; gap: 10px; flex-wrap: wrap; }
.shots a { display: block; width: 110px; height: 196px; border-radius: 10px; overflow: hidden; background: #22262C; border: 1px solid rgba(255,255,255,.08); }
.shots img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thread { display: flex; flex-direction: column; gap: 9px; }
.bub { border-radius: 13px; padding: 10px 12px; font-size: 13.5px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.bub i { display: block; font-style: normal; font-size: 10px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; margin-bottom: 3px; }
.bub.them { background: rgba(255,107,0,.1); border: 1px solid rgba(255,107,0,.28); }
.bub.them i { color: #FFB27F; }
.bub.us { background: var(--card2); border: 1px solid rgba(255,255,255,.08); }
.bub.us i { color: var(--dim); }
.reply { background: #0F1215; border: 1.5px solid rgba(255,107,0,.55); border-radius: 12px; padding: 10px 12px; font-size: 14px; line-height: 1.5; min-height: 130px; width: 100%; resize: vertical; }
.count { font-size: 11px; color: var(--dim); text-align: right; }

/* ── the toast ── */
.toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 30px); opacity: 0; background: #F2F4F7; color: #0B0D0F; font-weight: 700; font-size: 13px; padding: 10px 16px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.4); transition: opacity .2s, transform .2s; pointer-events: none; max-width: calc(100vw - 32px); z-index: 10; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--red); color: #fff; }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }

/* ── on a phone ── */
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .side { position: sticky; top: 0; z-index: 5; height: auto; flex-direction: row; align-items: center; gap: 10px; padding: 10px 12px; padding-top: calc(10px + env(safe-area-inset-top, 0px)); border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .side .brand small, .who b, .who span { display: none; }
  .navs { flex-direction: row; }
  .nv { padding: 7px 10px; }
  .nv .t { display: none; }
  .who { margin: 0 0 0 auto; border: 0; padding: 0; }
  .main { padding: 16px 16px 40px; }
  .two, .rd { grid-template-columns: 1fr; }
  .row { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; }
  .row > :nth-child(1) { grid-column: 1; }
  .row > :nth-child(2) { display: none; }
  .row > :nth-child(3) { grid-column: 1 / -1; grid-row: 2; white-space: normal; }
  .row > :nth-child(4) { grid-column: 1; grid-row: 3; font-size: 12px; }
  .row > :nth-child(5) { display: none; }
  .row > :nth-child(6) { grid-column: 2; grid-row: 3; font-size: 12px; text-align: right; }
  .row > :nth-child(7) { grid-column: 2; grid-row: 1; }
  .search { width: 100%; margin-left: 0; }
}
.key i.kl { background: #FF6B00; }
.key i.kb { background: #64AAFF; opacity: .6; }
.who .link { align-self: flex-start; }
.thread + .lbl { margin-top: 16px; }
