/* PS Desk. Tokens carried over from the earlier "Punkaj's Desk" artifact so it looks like the
   same product. System fonts only: no external requests. Light and dark follow the device. */
:root {
  color-scheme: light dark;
  --ground: #f3f4f1; --panel: #ffffff; --ink: #18201d; --muted: #5e6863; --line: #dde1dc;
  --accent: #2b3fa0; --accent-soft: #e6e9f7;
  --hot: #b42318; --hot-soft: #fdecea; --warn: #9a6700; --warn-soft: #fff4d6; --ok: #1f7a4d; --ok-soft: #e3f4ea;
  --display: ui-rounded, "Avenir Next", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #111513; --panel: #181d1b; --ink: #e8ece9; --muted: #9aa39e; --line: #2a312e;
    --accent: #9aa8f0; --accent-soft: #232a4d;
    --hot: #f97066; --hot-soft: #3a1d1b; --warn: #f5c451; --warn-soft: #352b12; --ok: #6cd49a; --ok-soft: #15301f;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 14px/1.45 var(--body); }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 20px 16px 48px; display: flex; flex-direction: column; gap: 18px; }
h1 { font: 700 clamp(26px, 4vw, 36px)/1.05 var(--display); letter-spacing: -.02em; margin: 0; }
h2 { font: 600 19px/1.2 var(--display); letter-spacing: -.01em; margin: 0; }
.sub { color: var(--muted); margin-top: 4px; }
.mono { font-family: var(--mono); font-size: 12px; color: var(--muted); }

.top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
nav.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
nav.tabs a { text-decoration: none; border: 1px solid var(--line); border-radius: 999px; padding: 4px 14px; background: var(--panel); }
nav.tabs a[aria-current="page"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

.btn { border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 8px 14px; cursor: pointer; }
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--ground); }
.btn.primary:hover { color: var(--ground); filter: brightness(1.08); }
.btn[disabled] { opacity: .55; cursor: wait; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; min-width: 0; }
.ph { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.empty { padding: 20px 16px; color: var(--muted); }
.grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 900px) { .grid { grid-template-columns: 1fr; } }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.kpi { background: var(--panel); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.kpi .n { font: 700 30px/1.1 var(--display); font-variant-numeric: tabular-nums; }
.kpi .l { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.kpi.hot .n { color: var(--hot); }
@media (max-width: 700px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

ul.list { list-style: none; margin: 0; padding: 0; }
ul.list li { border-bottom: 1px solid var(--line); padding: 10px 16px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
ul.list li:last-child { border-bottom: 0; }
.row-title { font-weight: 500; overflow-wrap: anywhere; }
.row-meta { color: var(--muted); font-size: 12.5px; margin-top: 1px; }
.right { text-align: right; white-space: nowrap; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.right.late { color: var(--hot); }
.pill { font-size: 10.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; border-radius: 4px; padding: 1px 6px; background: var(--accent-soft); color: var(--accent); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.hot { background: var(--hot-soft); color: var(--hot); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }

/* login / enrol */
.card { max-width: 420px; margin: 12vh auto 0; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 28px 24px; display: flex; flex-direction: column; gap: 16px; }
.card .fields { display: flex; flex-direction: column; gap: 12px; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); }
input[type="text"], input[type="password"] { border: 1px solid var(--line); background: var(--ground); border-radius: 8px; padding: 9px 11px; }
.msg { min-height: 1.4em; font-size: 13px; }
.msg.err { color: var(--hot); }
.msg.ok { color: var(--ok); }

/* alive: progress bar, dimming while loading, fade-in, refresh stamp */
.bar { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--accent); opacity: 0; z-index: 10; pointer-events: none; }
.bar.on { opacity: 1; animation: load 12s cubic-bezier(.1, .7, .2, 1) forwards; }
@keyframes load { from { width: 0; } to { width: 92%; } }
#content { display: flex; flex-direction: column; gap: 18px; transition: opacity .15s ease; }
#content.busy { opacity: .55; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.panel, .kpis { animation: rise .35s ease both; }
.panel:nth-child(2) { animation-delay: .05s; }
.stamp { font-size: 12px; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .panel, .kpis, .bar.on { animation: none; } #content { transition: none; } .bar.on { width: 92%; } }
