:root {
  --bg: #f4f5f7; --panel: #fff; --ink: #121826; --muted: #5f6878; --line: #e3e6eb; --soft: #f7f8fa;
  --side: #10172a; --side-ink: #c8cfdc; --accent: #2a62e8; --accent-soft: #e9efff;
  --work: #1a9c5c; --break: #e39b0b; --off: #9aa3b2; --idle: #f0b33d; --stale: #d9480f;
  --prod: #1a9c5c; --neutral: #8f9bb3; --unprod: #df3b44; --active: #3b6fe0;
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.45 Inter, system-ui, -apple-system, sans-serif; }
.hidden { display: none !important; }
.muted { color: var(--muted); } .small { font-size: 12px; } .err { color: var(--unprod); min-height: 1.2em; margin: 0; }
.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }
h1 { font-size: 22px; margin: 0 0 2px; letter-spacing: -.2px; } h2 { font-size: 15px; margin: 0 0 12px; } h3 { font-size: 13px; margin: 0 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; background: #fff; padding: 6px 10px; z-index: 99; }

.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--work); box-shadow: 0 0 0 4px rgba(26,156,92,.2); }

/* auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 30px; width: 100%; max-width: 400px; display: grid; gap: 14px; }
.auth-card .brand { font-size: 22px; }
.qr { justify-self: center; border: 1px solid var(--line); border-radius: 8px; padding: 6px; background: #fff; }

/* layout */
.shell { display: grid; grid-template-columns: 228px 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; overflow-y: auto; }
.side .brand { color: #fff; padding: 0 6px; }
.side nav { display: grid; gap: 1px; }
.side nav .grp { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: #7d879a; padding: 12px 10px 4px; }
.side nav a { color: var(--side-ink); padding: 8px 10px; border-radius: 7px; font-weight: 500; text-decoration: none; display: flex; justify-content: space-between; align-items: center; }
.side nav a:hover { background: rgba(255,255,255,.06); }
.side nav a.on { background: rgba(255,255,255,.11); color: #fff; }
.badge { background: var(--unprod); color: #fff; border-radius: 99px; font-size: 11px; padding: 0 7px; font-weight: 600; }
.side-foot { margin-top: auto; display: grid; gap: 8px; }
.side-foot #me { color: #aab2c2; overflow: hidden; text-overflow: ellipsis; }
.main { padding: 26px 30px 60px; min-width: 0; outline: none; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }

/* controls */
label { display: grid; gap: 5px; font-size: 12px; font-weight: 600; color: var(--muted); }
input, select, textarea { font: inherit; color: var(--ink); padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(42,98,232,.25); border-color: var(--accent); }
.btn { font: inherit; font-weight: 600; border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 8px 14px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: #c3c9d4; } .btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.go { background: var(--work); border-color: var(--work); color: #fff; }
.btn.warn { background: var(--break); border-color: var(--break); color: #fff; }
.btn.stop { background: #2b3445; border-color: #2b3445; color: #fff; }
.btn.danger { color: var(--unprod); }
.btn.ghost { background: transparent; color: var(--side-ink); border-color: rgba(255,255,255,.16); }
.btn.small { padding: 5px 10px; font-size: 12px; }
.btn.big { padding: 13px 22px; font-size: 15px; }
.row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; } .row.tight { gap: 6px; align-items: center; }
.chk { display: flex; flex-direction: row; align-items: center; gap: 8px; color: var(--ink); font-weight: 500; font-size: 13px; }
.chk input { width: 16px; height: 16px; }

/* panels */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.kpi .v { font-size: 22px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .l { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.sw { width: 9px; height: 9px; border-radius: 2px; display: inline-block; flex: none; }
.notice { background: #fff8e6; border: 1px solid #f2dc9f; border-radius: 8px; padding: 10px 14px; font-size: 13px; margin-bottom: 14px; }
.notice.info { background: var(--accent-soft); border-color: #cddafc; }

/* clock card */
.clock { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; }
.clock .state { font-size: 13px; font-weight: 600; display: inline-flex; gap: 8px; align-items: center; padding: 4px 10px; border-radius: 99px; }
.clock .big-time { font-size: 40px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -1px; margin: 6px 0 2px; }
.st-working { background: #e2f5ea; color: #116b3f; } .st-break { background: #fff1d6; color: #8c5a00; } .st-off { background: #eef0f4; color: var(--muted); } .st-stale { background: #ffe8dc; color: #9a3412; }

/* pills */
.pill { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 99px; white-space: nowrap; display: inline-block; }
.pill.working { background: #e2f5ea; color: #116b3f; } .pill.break { background: #fff1d6; color: #8c5a00; } .pill.off { background: #eef0f4; color: var(--muted); }
.pill.stale { background: #ffe8dc; color: #9a3412; } .pill.pending { background: #fff1d6; color: #8c5a00; } .pill.approved { background: #e2f5ea; color: #116b3f; } .pill.rejected { background: #fde6e7; color: #a21d26; }
.pill.on { background: var(--accent-soft); color: #1e48b4; }

/* cards (live) */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: grid; gap: 8px; }
.card .top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.card .name { font-weight: 600; }
.card .line { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .stats { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); } .card .stats b { color: var(--ink); font-variant-numeric: tabular-nums; }
button.card { text-align: left; font: inherit; color: inherit; cursor: pointer; } button.card:hover { border-color: #b8c1d1; }

/* bars, timeline */
.bar { height: 8px; border-radius: 99px; background: #e9ecf1; overflow: hidden; display: flex; } .bar i { display: block; height: 100%; }
.trend { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; align-items: end; height: 140px; }
.trend .c { display: grid; gap: 4px; align-items: end; height: 100%; grid-template-rows: 1fr auto; text-align: center; font-size: 11px; color: var(--muted); }
.trend .b { background: var(--accent); border-radius: 4px 4px 0 0; min-height: 2px; align-self: end; }
.timeline { position: relative; height: 32px; background: #eef0f4; border-radius: 6px; overflow: hidden; }
.timeline i { position: absolute; top: 0; bottom: 0; } .timeline i.att { top: 0; bottom: auto; height: 6px; }
.tl-axis { position: relative; height: 18px; font-size: 11px; color: var(--muted); margin-top: 4px; } .tl-axis span { position: absolute; transform: translateX(-50%); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 8px; } .legend span { display: inline-flex; align-items: center; gap: 5px; }
.hours { display: grid; grid-template-columns: repeat(24, 1fr); gap: 3px; align-items: end; height: 110px; }
.hours .h { display: flex; flex-direction: column-reverse; height: 100%; background: #f1f3f6; border-radius: 3px; overflow: hidden; }
.hours-axis { display: grid; grid-template-columns: repeat(24, 1fr); gap: 3px; font-size: 10px; color: var(--muted); text-align: center; margin-top: 4px; }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 8px 10px; border-bottom: 1px solid #eef0f3; vertical-align: middle; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.click { cursor: pointer; } tr.click:hover td { background: var(--soft); }
tr.void td { color: var(--muted); text-decoration: line-through; }
.kbar { height: 6px; border-radius: 99px; background: #e9ecf1; min-width: 60px; } .kbar i { display: block; height: 100%; border-radius: 99px; }
.actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: nowrap; }

/* screenshots */
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.shot { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; cursor: zoom-in; padding: 0; font: inherit; text-align: left; }
.shot img { width: 100%; aspect-ratio: 16/10; object-fit: cover; display: block; background: #eef0f4; }
.shot div { padding: 6px 8px; font-size: 12px; display: flex; justify-content: space-between; gap: 6px; }
.lightbox { position: fixed; inset: 0; background: rgba(8,12,20,.9); display: grid; place-items: center; z-index: 50; padding: 20px; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 86vh; border-radius: 6px; } .lb-cap { color: #fff; margin-top: 8px; text-align: center; }

/* modal, toast */
.modal { position: fixed; inset: 0; background: rgba(8,12,20,.45); display: grid; place-items: center; z-index: 40; padding: 16px; }
.modal-card { background: #fff; border-radius: 12px; padding: 22px; width: 100%; max-width: 460px; display: grid; gap: 12px; max-height: 90vh; overflow: auto; }
.toast { position: fixed; bottom: 20px; right: 20px; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 60; max-width: 360px; }
.empty { padding: 32px; text-align: center; color: var(--muted); }
.code { font-family: 'JetBrains Mono', monospace; font-size: 18px; background: var(--accent-soft); color: #1e48b4; padding: 6px 12px; border-radius: 8px; letter-spacing: 2px; display: inline-block; }
.copy { font-family: 'JetBrains Mono', monospace; font-size: 12px; background: var(--soft); border: 1px solid var(--line); border-radius: 6px; padding: 8px; word-break: break-all; }
.ai-out { white-space: pre-wrap; line-height: 1.55; }
details summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 13px; }
pre.json { background: var(--soft); border: 1px solid var(--line); border-radius: 8px; padding: 10px; font-size: 11px; overflow: auto; max-height: 300px; }

@media (max-width: 1000px) { .grid2 { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; padding: 12px 16px; gap: 10px; }
  .side nav { display: flex; flex-wrap: wrap; gap: 2px; } .side nav .grp { display: none; }
  .side-foot { flex-direction: row; display: flex; justify-content: space-between; align-items: center; }
  .main { padding: 18px 16px 40px; }
  .clock { grid-template-columns: 1fr; }
  .clock .big-time { font-size: 32px; }
}
