/* DIP Tracker admin, light theme (same palette as the employee app) */
:root {
  --ink: #F1F0FA;          /* page background */
  --panel: #FFFFFF;        /* cards */
  --panel-2: #F6F5FC;      /* subtle fills, hovers */
  --line: #E8E6F4;
  --text: #1D1A38;
  --muted: #6E6B8C;
  --faint: #A6A3BF;

  --accent: #6D5DF6;
  --productive: #1FAF6E;
  --neutral: #B9B6D3;
  --distraction: #E5484D;
  --idle: #F97316;
  --paused: #F2A31B;
  --offline: #3B82F6;
  --net: #3B82F6;
  --hatch: #CFCBE6;
  --focus: #6D5DF6;

  --radius-s: 8px;
  --radius-m: 14px;
  --gutter: 24px;
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  font-variant-numeric: tabular-nums;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: linear-gradient(165deg, #ECEBFF 0%, #F3F1FB 45%, #F7F2FD 100%) fixed; color: var(--text);
       font-size: 14px; line-height: 1.45; min-height: 100vh; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- top bar ---------- */
.top { display: flex; align-items: center; gap: 28px; padding: 12px var(--gutter); border-bottom: 1px solid var(--line);
       position: sticky; top: 0; background: rgba(255,255,255,.88); backdrop-filter: blur(8px); z-index: 20; }
.brand { font-weight: 700; font-size: 15px; text-decoration: none; display: flex; align-items: center; gap: 10px; }
.brand .moon { width: 22px; height: 22px; border-radius: 7px; background: var(--accent); position: relative; overflow: hidden; }
.brand .moon::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: #fff; }
.brand .moon::after { content: ""; position: absolute; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); top: 3px; left: 9px; }
.nav { display: flex; gap: 4px; }
.nav a { text-decoration: none; color: var(--muted); padding: 6px 12px; border-radius: 999px; font-weight: 500; }
.nav a:hover { color: var(--text); background: var(--panel-2); }
.nav a.on { color: #fff; background: var(--accent); }
.top .spacer { flex: 1; }
.top .clock { color: var(--muted); }
.linkbtn { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 6px 4px; }
.linkbtn:hover { color: var(--text); }

main { padding: 22px var(--gutter) 56px; max-width: 1520px; margin: 0 auto; }
h1 { font-size: 26px; font-weight: 700; letter-spacing: -.01em; margin: 0; line-height: 1.2; }
h2 { font-size: 15px; font-weight: 700; margin: 0 0 12px; }
.sub { color: var(--muted); }

/* ---------- buttons, inputs ---------- */
.btn { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 7px 14px; cursor: pointer; font-weight: 500; }
.btn:hover { border-color: var(--faint); }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
.btn.danger { color: var(--distraction); }
.btn:disabled { opacity: .5; cursor: default; }
input, select { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-s); padding: 7px 10px; min-width: 0; }
input:focus, select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px #E4E0FD; }
label.f { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 13px; }

/* ---------- state colors ---------- */
.k-productive { --c: var(--productive); }
.k-neutral { --c: var(--neutral); }
.k-distraction { --c: var(--distraction); }
.k-idle { --c: var(--idle); }
.k-paused, .k-auto_paused { --c: var(--paused); }
.k-active { --c: var(--productive); }
.k-offline { --c: var(--offline); }
.k-done { --c: var(--faint); }
.k-not_in { --c: transparent; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); display: inline-block; flex: none; }
.k-not_in .dot, .dot.k-not_in { box-shadow: inset 0 0 0 1.5px var(--faint); }

/* ---------- shift strip ---------- */
.strip { position: relative; height: 20px; background: var(--panel-2); border-radius: 4px; overflow: hidden; }
.strip .sess { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(135deg, var(--hatch) 0 3px, transparent 3px 7px); }
.strip .run { position: absolute; top: 0; bottom: 0; background: var(--c); }
.strip .run.k-paused { background: repeating-linear-gradient(90deg, var(--paused) 0 2px, #F8CF7E 2px 4px); }
.strip .net { position: absolute; bottom: 0; height: 4px; background: var(--net); box-shadow: 0 -1px 0 #fff; }
.strip .nowline { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--text); opacity: .6; }
.ruler { position: relative; height: 18px; color: var(--faint); font-size: 11px; }
.ruler span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.ruler span.major { color: var(--muted); }
.gridlines { position: absolute; inset: 0; pointer-events: none; }
.gridlines i { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(29,26,56,.05); }

.legend { display: flex; flex-wrap: wrap; gap: 14px; color: var(--muted); font-size: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .sw { width: 14px; height: 10px; border-radius: 3px; background: var(--c); }
.legend .sw.hatch { background: repeating-linear-gradient(135deg, var(--hatch) 0 3px, transparent 3px 6px); box-shadow: inset 0 0 0 1px var(--hatch); }
.legend .sw.net { background: linear-gradient(transparent 60%, var(--net) 60%); box-shadow: inset 0 0 0 1px var(--line); }

/* ---------- tables ---------- */
table { border-collapse: collapse; width: 100%; }
th { text-align: left; font-weight: 600; color: var(--faint); font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
td.n, th.n { text-align: right; }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--panel); }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 18px 20px;
         box-shadow: 0 1px 2px rgba(40, 30, 120, .04); }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: #fff; padding: 9px 16px; border-radius: 10px; font-weight: 500; z-index: 100; }
.err { color: var(--distraction); }
.empty { color: var(--muted); padding: 22px; text-align: center; }

@media (max-width: 720px) {
  :root { --gutter: 16px; }
  .top { gap: 12px; flex-wrap: wrap; }
  .top .clock { display: none; }
  h1 { font-size: 22px; }
}
