/* Quantum Tracker desk. Flat, calm, data-dense. Teal = brand/primary, orange = the one urgent action, semantic colours for status. */
@font-face { font-family: "Plus Jakarta Sans"; src: url(fonts/pjs-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plus Jakarta Sans"; src: url(fonts/pjs-500.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plus Jakarta Sans"; src: url(fonts/pjs-600.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Plus Jakarta Sans"; src: url(fonts/pjs-700.woff2) format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --bg: #f4f7f8; --surface: #ffffff; --surface-2: #f0f4f5; --line: #dfe7ea; --line-2: #c9d6da;
  --text: #0f2a2e; --text-2: #48606a; --text-3: #6b8089;
  --primary: #0f766e; --primary-hi: #115e59; --primary-soft: #e3f4f1; --on-primary: #ffffff;
  --accent: #c2410c; --accent-soft: #fdeee6;
  --good: #15803d; --good-soft: #e5f6ea; --warn: #b45309; --warn-soft: #fdf3e2; --bad: #b91c1c; --bad-soft: #fde8e8; --info: #1d4ed8; --info-soft: #e6edfd;
  --idle: #a16207; --break: #6d28d9; --break-soft: #f0e9fd; --out: #64748b;
  --r: 12px; --r-s: 8px; --shadow: 0 1px 2px rgb(15 42 46 / 6%);
  --font: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1517; --surface: #111e21; --surface-2: #162629; --line: #22363a; --line-2: #2d464b;
    --text: #e3f0f1; --text-2: #a6bcc0; --text-3: #7f979c;
    --primary: #2dd4bf; --primary-hi: #5eead4; --primary-soft: #11332f; --on-primary: #04211e;
    --accent: #fb923c; --accent-soft: #3a2113;
    --good: #4ade80; --good-soft: #10291a; --warn: #fbbf24; --warn-soft: #33270e; --bad: #f87171; --bad-soft: #3a1515; --info: #93b4ff; --info-soft: #17223d;
    --idle: #facc15; --break: #c4b5fd; --break-soft: #261d3d; --out: #94a3b8;
    --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1517; --surface: #111e21; --surface-2: #162629; --line: #22363a; --line-2: #2d464b;
  --text: #e3f0f1; --text-2: #a6bcc0; --text-3: #7f979c;
  --primary: #2dd4bf; --primary-hi: #5eead4; --primary-soft: #11332f; --on-primary: #04211e;
  --accent: #fb923c; --accent-soft: #3a2113;
  --good: #4ade80; --good-soft: #10291a; --warn: #fbbf24; --warn-soft: #33270e; --bad: #f87171; --bad-soft: #3a1515; --info: #93b4ff; --info-soft: #17223d;
  --idle: #facc15; --break: #c4b5fd; --break-soft: #261d3d; --out: #94a3b8;
  --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--primary); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-2); } .dim { color: var(--text-3); font-size: 13px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* icons */
.i { width: 18px; height: 18px; flex: none; }
.i-s { width: 15px; height: 15px; flex: none; }

/* shell */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px; padding: 18px 12px; background: var(--surface); border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 10px; }
.brand b { display: block; font-size: 15px; letter-spacing: -.01em; }
.brand small { color: var(--text-3); font-size: 12px; }
.logo { width: 34px; height: 34px; flex: none; }
.nav { display: grid; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px; border-radius: var(--r-s); color: var(--text-2); text-decoration: none; font-weight: 500; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a[aria-current="page"] { background: var(--primary-soft); color: var(--primary); }
.side .foot { margin-top: auto; display: grid; gap: 10px; }
.me { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: var(--r); }
.me b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.main { min-width: 0; padding: 26px 32px 60px; }
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.top h1 { margin: 0; font-size: 24px; letter-spacing: -.02em; }
.top .sub { color: var(--text-2); font-size: 14px; margin-top: 2px; }
.top .right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* building blocks */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.pad { padding: 18px; }
.card h2 { margin: 0 0 12px; font-size: 15px; font-weight: 600; }
.grid { display: grid; gap: 14px; }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stack { display: grid; gap: 14px; }
.kpi { padding: 16px 18px; }
.kpi .v { font-size: 26px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .l { color: var(--text-2); font-size: 13px; }
.kpi .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 0 14px; border-radius: var(--r-s); border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, color .15s; }
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn.primary:hover { background: var(--primary-hi); border-color: var(--primary-hi); color: var(--on-primary); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.small { min-height: 32px; padding: 0 10px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.inp { width: 100%; min-height: 38px; padding: 7px 11px; border: 1px solid var(--line-2); border-radius: var(--r-s); background: var(--surface); }
.inp:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
select.inp { padding-right: 28px; }
.f { display: grid; gap: 5px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.f small { font-weight: 400; color: var(--text-3); }
.check { display: flex; gap: 9px; align-items: flex-start; font-size: 14px; }
.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--primary); }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.badge.working { background: var(--good-soft); color: var(--good); }
.badge.idle { background: var(--warn-soft); color: var(--warn); }
.badge.break { background: var(--break-soft); color: var(--break); }
.badge.offline { background: var(--bad-soft); color: var(--bad); }
.badge.out { background: var(--surface-2); color: var(--out); }
.badge .d { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.working .d { animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r-s); font-size: 14px; }
.alert.bad { background: var(--bad-soft); color: var(--bad); } .alert.warn { background: var(--warn-soft); color: var(--warn); } .alert.info { background: var(--info-soft); color: var(--info); } .alert.good { background: var(--good-soft); color: var(--good); }
.empty { padding: 30px; text-align: center; color: var(--text-3); }
.avatar { display: inline-grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 50%; color: #fff; font-size: 12px; font-weight: 700; }
.bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; display: flex; }
.bar > i { display: block; height: 100%; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }

/* tables */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); position: sticky; top: 0; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: color-mix(in srgb, var(--primary-soft) 50%, transparent); }
.tbl .r { text-align: right; }
.scroll { overflow-x: auto; }
.cell-day { min-width: 74px; }
.cell-day b { display: block; font-variant-numeric: tabular-nums; }
.cell-day .dim { font-size: 11.5px; }
.cell-day.low b { color: var(--warn); }

/* people board (overview) */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.person { display: grid; grid-template-columns: 1fr 112px; gap: 12px; padding: 14px; text-decoration: none; color: inherit; transition: border-color .15s; }
.person:hover { border-color: var(--primary); }
.person .who { display: flex; gap: 10px; align-items: center; min-width: 0; }
.person .who b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person .doing { margin-top: 10px; font-size: 13.5px; display: flex; gap: 6px; align-items: center; min-width: 0; }
.person .doing span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person .nums { display: flex; gap: 14px; margin-top: 10px; font-size: 13px; color: var(--text-2); }
.person .nums b { color: var(--text); font-variant-numeric: tabular-nums; }
.thumb { width: 112px; height: 70px; border-radius: 8px; background: var(--surface-2) center / cover no-repeat; border: 1px solid var(--line); display: grid; place-items: center; color: var(--text-3); font-size: 11px; text-align: center; }

/* day view */
.timeline { position: relative; height: 54px; border-radius: 8px; background: var(--surface-2); overflow: hidden; }
.timeline .seg { position: absolute; top: 0; bottom: 0; }
.timeline .hours { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-3); margin-top: 4px; }
.lanes { display: grid; gap: 6px; }
.lane { display: grid; grid-template-columns: 90px 1fr; align-items: center; gap: 10px; font-size: 12.5px; color: var(--text-2); }
.lane .track { position: relative; height: 18px; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.lane .track i { position: absolute; top: 0; bottom: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.shot { padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); cursor: zoom-in; text-align: left; }
.shot img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--surface-2); }
.shot div { padding: 6px 9px; font-size: 12.5px; display: flex; justify-content: space-between; gap: 6px; color: var(--text-2); }
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgb(3 10 12 / 88%); display: grid; place-items: center; padding: 24px; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 110px); border-radius: 10px; }
.lightbox .bar2 { display: flex; gap: 10px; align-items: center; justify-content: center; color: #e3f0f1; margin-top: 12px; }

/* dialogs */
dialog { border: 1px solid var(--line); border-radius: 14px; padding: 0; background: var(--surface); color: var(--text); width: min(520px, calc(100vw - 32px)); box-shadow: 0 24px 60px rgb(0 0 0 / 25%); }
dialog::backdrop { background: rgb(3 10 12 / 55%); }
dialog form { display: grid; gap: 12px; padding: 20px; }
dialog h2 { margin: 0; font-size: 18px; }
dialog .acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.code { font: 700 26px/1 ui-monospace, Consolas, monospace; letter-spacing: .14em; padding: 14px; text-align: center; border: 1px dashed var(--primary); border-radius: 10px; color: var(--primary); background: var(--primary-soft); }

/* login / install */
.login, body.install { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login form, .install-box { width: min(420px, 100%); display: grid; gap: 14px; padding: 28px; }
.install-box { width: min(520px, 100%); }
.install-box fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px 14px; display: grid; gap: 10px; margin: 0; }
.install-box legend { padding: 0 6px; font-weight: 600; color: var(--primary); }
.install-box h1 { margin: 0; font-size: 20px; } .good { color: var(--good); }
.login h1 { margin: 0; font-size: 20px; }
.err { color: var(--bad); font-size: 14px; }

/* toasts */
.toasts { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 8px; z-index: 60; }
.toast { padding: 11px 16px; border-radius: 10px; background: var(--text); color: var(--bg); font-size: 14px; box-shadow: 0 10px 30px rgb(0 0 0 / 20%); max-width: 420px; }
.toast.bad { background: var(--bad); color: #fff; }
.skeleton { height: 220px; border-radius: var(--r); background: linear-gradient(90deg, var(--surface-2), var(--surface), var(--surface-2)); background-size: 200% 100%; animation: sk 1.2s linear infinite; }
@keyframes sk { to { background-position: -200% 0; } }

@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, 1fr); } .g3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .nav { grid-auto-flow: column; overflow-x: auto; } .side .foot { display: none; }
  .main { padding: 18px 16px 40px; } .g2, .g3, .g4 { grid-template-columns: 1fr; }
}
