:root {
  /* Accel NOW: logo green #45CCA7, deep teal #0E3A3E, teal #2C7A80, ink #122B2E, orange #F2762E */
  --bg: #F6FAFA; --surface: #FFFFFF; --surface-2: #F1F7F7; --text: #122B2E; --muted: #5B7376; --line: #E2ECEC;
  --brand: #2C7A80; --brand-ink: #FFFFFF; --deep: #0E3A3E; --green: #45CCA7;
  --wait: #B4540F; --wait-bg: #FEF0E6; --wait-line: #F2762E;
  --go: #11745A; --go-bg: #DDF6EE; --go-line: #45CCA7;
  --bad: #C0262D; --bad-bg: #FDE8E8;
  --shadow: 0 4px 24px rgba(14,58,62,.08); --radius: 14px;
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0A2427; --surface: #0E3A3E; --surface-2: #123F44; --text: #EAF4F4; --muted: #9FBFC2; --line: #1D5257;
  --brand: #45CCA7; --brand-ink: #0A2427; --wait: #FFB27A; --wait-bg: #3D2210; --go: #7BE3C4; --go-bg: #12463F; --bad: #FF8A8F; --bad-bg: #4A1A1D;
  --shadow: 0 4px 24px rgba(0,0,0,.3); color-scheme: dark } }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 14px; }
[hidden] { display: none !important; }
code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; font-size: 12px; word-break: break-all; }
h2 { margin: 0; font-size: 17px; }
.hint { color: var(--muted); font-size: 12.5px; margin: 0; }
.center { text-align: center; }
.opt { color: var(--muted); font-weight: 500; font-size: 12px; }
.error { color: var(--bad); margin: 0; }

.btn { border: 1px solid var(--line); background: var(--surface); color: var(--text); padding: 8px 14px; border-radius: 10px; font: inherit; font-weight: 700; cursor: pointer; }
.btn:hover { filter: brightness(.97); }
.btn:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.go { background: #45CCA7; border-color: #45CCA7; color: #0A2427; }
.btn.danger { color: var(--bad); border-color: var(--bad); background: transparent; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn.lg { padding: 13px 18px; font-size: 15px; }
.btn:disabled { opacity: .5; cursor: default; }

label { display: flex; flex-direction: column; gap: 5px; font-weight: 700; font-size: 13px; color: var(--muted); }
input, select { font: inherit; font-weight: 500; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: 10px 11px; width: 100%; }
fieldset { border: 1px dashed var(--line); border-radius: 10px; padding: 10px 12px 12px; margin: 0; display: grid; gap: 10px; }
legend { font-weight: 700; font-size: 13px; padding: 0 4px; }

.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: linear-gradient(160deg, #0E3A3E, #122B2E 60%); }
.login-card { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 14px; }
.login-logo { height: 46px; width: auto; align-self: center; }
.login-logo.dark { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .login-logo.light { display: none; } :root:not([data-theme="light"]) .login-logo.dark { display: block; } }

.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 20px; padding: 10px 20px; background: #0E3A3E; color: #EAF4F4; border-bottom: 3px solid #45CCA7; flex-wrap: wrap; }
.brand-logo { height: 30px; width: auto; }
.tabs { display: flex; gap: 4px; flex: 1; }
.tabs button { border: 0; background: none; color: #9FBFC2; padding: 8px 12px; border-radius: 8px; font: inherit; font-weight: 700; cursor: pointer; }
.tabs button.active { background: rgba(69,204,167,.16); color: #45CCA7; }
.me { display: flex; align-items: center; gap: 10px; color: #9FBFC2; }
.topbar .btn.ghost { color: #EAF4F4; border-color: rgba(255,255,255,.25); }
.online-pill { background: rgba(69,204,167,.16); color: #45CCA7; font-weight: 800; padding: 4px 10px; border-radius: 20px; font-size: 12.5px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #E5373F; }
.dot.on { background: #45CCA7; }

main { padding: 20px; max-width: 1760px; margin: 0 auto; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }

/* Live dashboard */
.dash-wrap { display: grid; gap: 16px; }
.kpi-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.ks { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; display: grid; gap: 2px; min-width: 0; }
.ks .k { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ks .v { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.ks .s { color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ks.go { border-color: var(--go-line); background: var(--go-bg); } .ks.go .v { color: var(--go); }
.ks.wait .v { color: var(--wait); } .ks.bad.on { border-color: var(--bad); background: var(--bad-bg); } .ks.bad.on .v { color: var(--bad); }

.dash { display: grid; grid-template-columns: 290px minmax(0, 1fr) 270px; gap: 16px; align-items: start; }
.req { display: grid; gap: 11px; position: sticky; top: 76px; padding: 16px; }
.field-label { font-weight: 700; font-size: 13px; color: var(--muted); margin-bottom: -5px; }
.seg2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.seg2 label { flex-direction: row; }
.seg2 input { position: absolute; opacity: 0; width: 1px; }
.seg2 span { flex: 1; text-align: center; padding: 8px; border-radius: 9px; border: 1px solid var(--line); cursor: pointer; color: var(--text); }
.seg2 input:checked + span { background: var(--deep); border-color: var(--deep); color: #fff; }
.seg2 input[value=urgent]:checked + span { background: var(--bad); border-color: var(--bad); }
.seg2 input:focus-visible + span { outline: 2px solid var(--brand); }
.teams-hint code { font-size: 11px; }

.lanes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: start; min-width: 0; }
.lane { background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 10px; min-height: 260px; min-width: 0; }
.lane-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 2px 4px 10px; }
.lane-head h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.lane-go .lane-head h2 { color: var(--go); } .lane-wait .lane-head h2 { color: var(--wait); } .lane-bad .lane-head h2 { color: var(--bad); }
.count { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 0 9px; font-weight: 800; font-size: 12px; }
.lane-go { border-color: var(--go-line); }
.lane-body { display: grid; gap: 10px; }
.today { grid-column: 1 / -1; padding: 14px 16px; }
.today-table td, .today-table th { padding: 7px 6px; }
.res { font-size: 11.5px; font-weight: 800; padding: 2px 8px; border-radius: 20px; white-space: nowrap; }
.res.ok { background: var(--go-bg); color: var(--go); } .res.no { background: var(--surface-2); color: var(--muted); } .res.bad { background: var(--bad-bg); color: var(--bad); } .res.wait { background: var(--wait-bg); color: var(--wait); }

.jc { background: var(--surface); border: 1px solid var(--line); border-top: 5px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 6px; box-shadow: var(--shadow); min-width: 0; }
.jc .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.jc .where { font-size: 18px; font-weight: 800; line-height: 1.15; }
.jc .what { font-weight: 700; }
.jc .sub { color: var(--muted); font-size: 12px; }
.jc .clock { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.jc .eta-line { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; background: var(--surface); border: 1px solid var(--go-line); border-radius: 9px; padding: 6px 10px; }
.jc .eta-line span { color: var(--muted); font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.jc .eta-line b { font-size: 15px; text-align: right; }
.jc .eta-line small { display: block; font-size: 11.5px; color: var(--muted); font-weight: 700; }
body.wall .jc .eta-line b { font-size: 19px; }
.jc .who { font-weight: 800; color: var(--go); }
.jc .bar { height: 5px; border-radius: 5px; background: var(--line); overflow: hidden; }
.jc .bar i { display: block; height: 100%; transition: width 1s linear; }
.jc .actions { display: grid; gap: 6px; margin-top: 2px; }
.jc .actions.row { grid-template-columns: 1fr 1fr; }
.tag { font-size: 10.5px; font-weight: 800; padding: 2px 7px; border-radius: 20px; background: var(--bad); color: #fff; vertical-align: middle; margin-left: 4px; }
.src { font-size: 10.5px; font-weight: 800; padding: 2px 7px; border-radius: 20px; background: #E8E6F8; color: #4B44A8; }
.chip-app { font-size: 10.5px; font-weight: 800; padding: 2px 7px; border-radius: 20px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.jc.s-broadcasting { border-top-color: var(--wait-line); } .jc.s-broadcasting .clock { color: var(--wait); } .jc.s-broadcasting .bar i { background: var(--wait-line); }
.jc.s-accepted { border-top-color: #45CCA7; background: var(--go-bg); border-color: var(--go-line); }
.jc.s-accepted .clock { color: var(--go); } .jc.s-accepted .bar i { background: #45CCA7; }
.jc.s-accepted .callout { font-weight: 800; font-size: 12px; color: var(--go); text-transform: uppercase; letter-spacing: .04em; }
.jc.s-accepted.overdue { border-top-color: var(--bad); } .jc.s-accepted.overdue .clock, .jc.s-accepted.overdue .callout { color: var(--bad); }
.jc.s-expired { border-top-color: var(--bad); } .jc.s-expired .callout { color: var(--bad); font-weight: 800; font-size: 12px; text-transform: uppercase; }
.jc.s-cancelled { border-top-color: var(--bad); } .jc.s-cancelled .callout { color: var(--bad); font-weight: 800; font-size: 12px; }
.lane-empty { color: var(--muted); font-size: 12.5px; text-align: center; padding: 22px 8px; }

.rail { display: grid; gap: 12px; position: sticky; top: 76px; }
.rail-card { padding: 14px; }
.tech-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: 300px; overflow: auto; }
.tech-list li { display: grid; grid-template-columns: 10px 1fr auto; gap: 8px; align-items: center; padding: 6px 4px; border-bottom: 1px solid var(--line); font-size: 13px; }
.tech-list li:last-child { border-bottom: 0; }
.tech-list .d { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.tech-list .d.on { background: #45CCA7; } .tech-list .d.job { background: #F2762E; }
.tech-list small { color: var(--muted); font-size: 11.5px; }
.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; max-height: 340px; overflow: auto; }
.feed li { display: grid; grid-template-columns: 44px 1fr; gap: 8px; font-size: 12.5px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.feed li:last-child { border-bottom: 0; }
.feed time { color: var(--muted); font-variant-numeric: tabular-nums; }
.feed b { font-weight: 800; }
.feed .ev-accepted b, .feed .ev-confirmed b { color: var(--go); } .feed .ev-expired b, .feed .ev-cancelled b { color: var(--bad); } .feed .ev-sent b, .feed .ev-resent b { color: var(--wait); }

/* Wall display (office TV) */
body.wall .req, body.wall .tabs, body.wall #meName, body.wall #logout { display: none; }
body.wall .dash { grid-template-columns: minmax(0, 1fr) 280px; }
body.wall main { max-width: none; }
body.wall .jc .where { font-size: 24px; } body.wall .jc .clock { font-size: 34px; } body.wall .ks .v { font-size: 34px; }

/* Techs + tables */
.split { display: grid; grid-template-columns: 1fr 330px; gap: 16px; align-items: start; }
.form-stack { display: flex; flex-direction: column; gap: 12px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 10px; }
.table th { text-align: left; color: var(--muted); font-weight: 700; border-bottom: 1px solid var(--line); padding: 8px 6px; white-space: nowrap; }
.table td { border-bottom: 1px solid var(--line); padding: 9px 6px; vertical-align: middle; }
.table td .btn { margin: 2px 4px 2px 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.badge { font-size: 11.5px; font-weight: 800; padding: 3px 9px; border-radius: 20px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge.on { background: var(--go-bg); color: var(--go); }
.badge.off { background: var(--wait-bg); color: var(--wait); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }

/* Reports */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.spacer { flex: 1; }
.seg-ctl { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg-ctl button { border: 0; background: none; font: inherit; font-weight: 700; color: var(--muted); padding: 6px 12px; border-radius: 7px; cursor: pointer; }
.seg-ctl button.on { background: var(--deep); color: #fff; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.kpi .k-label { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.kpi .k-val { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; margin-top: 4px; }
.kpi .k-sub { color: var(--muted); font-size: 12px; }
.meter { display: inline-flex; align-items: center; gap: 6px; justify-content: flex-end; }
.meter i { width: 56px; height: 6px; border-radius: 4px; background: var(--line); position: relative; overflow: hidden; display: inline-block; }
.meter i b { position: absolute; inset: 0 auto 0 0; background: var(--brand); border-radius: 4px; }

dialog { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); width: calc(100% - 32px); max-width: 440px; }
dialog::backdrop { background: rgba(5,10,20,.5); }
.row-btns { display: flex; gap: 8px; }
.pin { font-size: 30px; font-weight: 800; letter-spacing: .2em; margin: 6px 0 12px; }

.toasts { position: fixed; bottom: 16px; right: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 50; max-width: calc(100% - 32px); }
.toast { background: var(--text); color: var(--bg); padding: 12px 16px; border-radius: 10px; box-shadow: var(--shadow); font-weight: 700; max-width: 400px; }
.toast.bad { background: #C0262D; color: #fff; }
.toast.ok { background: #45CCA7; color: #0A2427; }

@media (max-width: 1280px) { .dash { grid-template-columns: 280px minmax(0, 1fr); } .rail { grid-column: 1 / -1; position: static; grid-template-columns: 1fr 1fr; } .kpi-strip { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); } .ks .v { font-size: 22px; } }
@media (max-width: 960px) { .dash, .split, .rail { grid-template-columns: 1fr; } .req, .rail { position: static; } .lanes { grid-template-columns: 1fr; } .kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { main { padding: 16px; } .topbar { padding: 10px 16px; gap: 10px; } .me #meName, #wallBtn { display: none; } }
@media (prefers-reduced-motion: reduce) { .jc .bar i { transition: none; } }
