/* timepassr — admin console. Clean light theme: bright surfaces, crisp text,
   violet→pink brand accent, cyan/amber data colours. */

:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f1f2f7;
  --surface-3: #e9eaf2;
  --line: #e6e7ef;
  --line-strong: #d4d5e2;

  --text: #16151f;
  --muted: #5c5a6e;
  --faint: #9a98ac;

  --violet: #6c4cff;
  --pink: #ff4d8d;
  --cyan: #16a34a;
  --amber: #e8890c;
  --primary: #6c4cff;
  --grad: linear-gradient(120deg, #6c4cff, #ff4d8d);

  --violet-soft: rgba(108, 76, 255, 0.10);
  --cyan-soft: rgba(22, 163, 74, 0.13);
  --amber-soft: rgba(232, 137, 12, 0.14);
  --danger: #e5484d;
  --danger-soft: rgba(229, 72, 77, 0.12);

  /* Time states, in this fixed order (checked for colour-blind separation). */
  --active: #15803d;
  --idle: #f59e0b;
  --locked: #0284c7;      /* away: the employee locked the screen */
  --admin-lock: #dc2626;  /* locked by an admin */
  --asleep: #8b5cf6;
  --productive: #16a34a;
  --unproductive: #e5484d;
  --neutral: #a7acbf;

  --ui: "Hanken Grotesk", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --display: "Unbounded", var(--ui);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(20, 21, 35, 0.05), 0 10px 26px rgba(20, 21, 35, 0.07);
}

/* ---------- night mode (toggled from the profile) ---------- */
:root[data-theme="dark"] {
  --bg: #0b0916;
  --surface: #141126;
  --surface-2: #1c1838;
  --surface-3: #262048;
  --line: rgba(244, 242, 252, 0.09);
  --line-strong: rgba(244, 242, 252, 0.17);
  --text: #f4f2fc;
  --muted: #b2add1;
  --faint: #7a7498;
  --violet: #8b5cff;
  --pink: #ff5c8a;
  --cyan: #34d399;
  --amber: #ffb020;
  --primary: #8b5cff;
  --grad: linear-gradient(120deg, #8b5cff, #ff5c8a);
  --violet-soft: rgba(139, 92, 255, 0.16);
  --cyan-soft: rgba(52, 211, 153, 0.15);
  --amber-soft: rgba(255, 176, 32, 0.15);
  --danger: #ff5c7a;
  --danger-soft: rgba(255, 92, 122, 0.15);
  --active: #0d9488;
  --idle: #d97706;
  --locked: #2563eb;
  --admin-lock: #e11d48;
  --asleep: #9333ea;
  --productive: #34d399;
  --unproductive: #ff5c7a;
  --neutral: #8b86b0;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 18px 44px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}
:root[data-theme="dark"] input[type="date"] { color-scheme: dark; }
:root[data-theme="dark"] .topbar { background: rgba(11, 9, 22, 0.8); }
:root[data-theme="dark"] .overlay { background: rgba(6, 5, 12, 0.66); }
:root[data-theme="dark"] .seg-toggle button.on { background: var(--surface-3); color: var(--violet); box-shadow: none; }
:root[data-theme="dark"] button.danger:hover { color: #1a0710; }

/* theme switch (profile) */
.theme-switch { display: flex; align-items: center; gap: 8px; padding: 6px 8px; }
.theme-switch .sw { width: 44px; height: 24px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line-strong); position: relative; cursor: pointer; transition: background 0.2s; flex: none; }
.theme-switch .sw i { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--grad); transition: left 0.2s; display: grid; place-items: center; font-size: 10px; }
:root[data-theme="dark"] .theme-switch .sw i { left: 22px; }
.theme-switch .lbl2 { font-size: 13px; color: var(--muted); }

* { box-sizing: border-box; }
html { color-scheme: light; height: 100%; }
body {
  margin: 0; height: 100vh; overflow: hidden; color: var(--text);
  background: radial-gradient(800px 500px at 90% -12%, rgba(108, 76, 255, 0.07), transparent 60%),
              radial-gradient(600px 450px at -8% 108%, rgba(14, 165, 183, 0.06), transparent 55%), var(--bg);
  background-attachment: fixed;
  font: 15px/1.55 var(--ui); -webkit-font-smoothing: antialiased;
}
a { color: var(--violet); text-decoration: none; }
.hidden { display: none !important; }
.muted { color: var(--muted); } .faint { color: var(--faint); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.micro { font: 600 11px var(--ui); text-transform: uppercase; letter-spacing: 0.09em; color: var(--faint); }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.01em; }

.lockup { display: inline-flex; align-items: center; gap: 10px; }
.lockup img { width: 30px; height: 30px; }
.lockup .wm { font-family: var(--display); font-weight: 700; font-size: 18px; }
.lockup .wm .ac { color: var(--pink); }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; height: 100vh; transition: grid-template-columns 0.2s ease; }
.sidebar { height: 100vh; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 20px 14px; overflow-y: auto; overflow-x: hidden; }
/* only the content scrolls; scrollbars hidden (invisible scroller) */
.main, .sidebar { scrollbar-width: none; }
.main::-webkit-scrollbar, .sidebar::-webkit-scrollbar { width: 0; height: 0; }
.sidebar .brand { padding: 6px 10px 22px; }
.navlist { display: grid; gap: 3px; }
.nav-group { padding: 16px 12px 5px; font: 700 10.5px var(--ui); letter-spacing: 0.09em; text-transform: uppercase; color: var(--faint); }
.nav-group:first-child { padding-top: 4px; }
.navlist button { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: transparent; border: 0; border-left: 3px solid transparent; color: var(--muted); font: 600 14.5px var(--ui); padding: 10px 12px; border-radius: 0 10px 10px 0; cursor: pointer; transition: background 0.15s, color 0.15s; }
.navlist button .ic { width: 20px; text-align: center; font-size: 16px; opacity: 0.9; }
.navlist button:hover { background: var(--surface-2); color: var(--text); }
.navlist button.on { background: var(--violet-soft); border-left-color: var(--violet); color: var(--violet); font-weight: 700; }
.sidebar .side-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 14px; display: grid; gap: 10px; }
.userbox { display: flex; align-items: center; gap: 10px; padding: 4px 8px; }
.userbox .nm { font-weight: 600; font-size: 14px; } .userbox .rl { font-size: 11.5px; color: var(--faint); }
#logout { display: flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; }
#logout .ic { font-size: 15px; }
/* collapse the sidebar to an icon rail (toggled with ☰; also the default on
   small screens) — it narrows, it isn't hidden, so the icons stay reachable. */
.shell.collapsed { grid-template-columns: 68px 1fr; }
.shell.collapsed .sidebar { padding: 18px 10px; }
.shell.collapsed .sidebar .brand .wm,
.shell.collapsed .sidebar .lbl,
.shell.collapsed .sidebar .nav-group,
.shell.collapsed .userbox .txt,
.shell.collapsed .theme-switch .lbl2 { display: none; }
.shell.collapsed .navlist button { border-left: 0; border-radius: 10px; }
.shell.collapsed .navlist button,
.shell.collapsed .userbox,
.shell.collapsed .theme-switch,
.shell.collapsed #logout { justify-content: center; padding-left: 0; padding-right: 0; }
.shell.collapsed .theme-switch .sw { margin-left: 0; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 68px 1fr; }
  .sidebar { padding: 18px 10px; }
  .sidebar .brand .wm, .sidebar .lbl, .sidebar .nav-group, .userbox .txt, .theme-switch .lbl2 { display: none; }
  .navlist button, .userbox, .theme-switch, #logout { justify-content: center; padding-left: 0; padding-right: 0; }
  .navlist button { border-left: 0; border-radius: 10px; }
  .theme-switch .sw { margin-left: 0; }
}

.main { min-width: 0; height: 100vh; overflow-y: auto; overflow-x: hidden; }
/* The title gives way first (cut with "…", full text on hover), and a toolbar
   that still doesn't fit moves to its own row whole instead of breaking up. */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 16px 26px; background: rgba(246, 247, 251, 0.82); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.topbar h1 { font-size: 20px; } .topbar .sub { font-size: 12.5px; color: var(--faint); }
.topbar .toolbar { flex: 0 0 auto; max-width: 100%; }
.topbar > .spacer { display: none; } /* the title grows to fill the row instead */
.tb-title { min-width: 12rem; flex: 1 1 14rem; } /* small basis: fits beside the toolbar, then grows */
@media (min-width: 601px) { .tb-title h1, .tb-title .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } }
@media (max-width: 600px) { .tb-title { flex-basis: 0; min-width: 0; } } /* phones: the bell stays on the title's row */

/* sidebar open/close toggle — a panel icon whose left pane fills when the
   sidebar is open and empties when it's collapsed, so the button shows state. */
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; padding: 0; border-radius: 10px; background: transparent; border: 1px solid transparent; color: var(--muted); cursor: pointer; transition: background 0.15s, color 0.15s, border-color 0.15s; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--line); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn:focus-visible { outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px var(--violet-soft); }
.nav-toggle svg { width: 20px; height: 20px; }
.nav-toggle .frame { fill: none; stroke: currentColor; stroke-width: 1.7; }
.nav-toggle .pane { fill: var(--violet); transition: opacity 0.18s ease; }
.shell.collapsed .nav-toggle .pane { opacity: 0; } /* collapsed: empty panel */
.spacer { flex: 1; }
.content { padding: 26px; }

/* ---------- controls ---------- */
button, input, select { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 9px 13px; transition: border-color 0.15s, box-shadow 0.15s, background 0.15s; }
input[type="date"] { color-scheme: light; font-family: var(--mono); }
input:focus, select:focus, button:focus-visible { outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px var(--violet-soft); }
button { cursor: pointer; font-weight: 600; }
button:hover { border-color: var(--line-strong); background: var(--surface-2); }
button.primary { background: var(--grad); border-color: transparent; color: #fff; font-weight: 700; }
button.primary:hover { filter: brightness(1.05); }
button.danger { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
button.danger:hover { background: var(--danger); color: #fff; }
button.ghost { background: transparent; }
button.sm { padding: 6px 10px; font-size: 13px; }
button:disabled { opacity: 0.5; cursor: default; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.seg-toggle { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 999px; padding: 3px; }
.seg-toggle button { border: 0; background: transparent; padding: 6px 14px; border-radius: 999px; font-size: 13px; color: var(--muted); }
.seg-toggle button.on { background: #fff; color: var(--violet); box-shadow: 0 1px 2px rgba(20,21,35,0.1); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.pad { padding: 18px; }
.card-h { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.card-h h3 { font-size: 15px; } .card-h .micro { margin: 0; }

/* ---------- KPI ---------- */
/* a quiet section heading above each block, for scan order */
.sec-label { margin: 2px 2px 11px; font: 700 11px var(--ui); letter-spacing: 0.09em; text-transform: uppercase; color: var(--faint); }

.kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin-bottom: 22px; }
@media (max-width: 1140px) { .kpis { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 620px) { .kpis { grid-template-columns: 1fr 1fr; } }
.kpi { padding: 15px 16px 14px 18px; position: relative; overflow: hidden; display: grid; gap: 1px; transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease; }
.kpi::after { content: ''; position: absolute; left: 0; top: 13px; bottom: 13px; width: 3px; border-radius: 0 3px 3px 0; background: var(--line-strong); }
.kpi.k-violet::after { background: var(--violet); } .kpi.k-cyan::after { background: var(--cyan); }
.kpi.k-amber::after { background: var(--amber); } .kpi.k-bad::after { background: var(--danger); }
.kpi:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: 0 8px 22px rgba(10, 11, 22, 0.22); }
@media (prefers-reduced-motion: reduce) { .kpi, .icon-btn { transition: none; } .kpi:hover, .icon-btn:active { transform: none; } }
.kpi .ic { position: absolute; right: 14px; top: 12px; font-size: 17px; color: var(--muted); opacity: 0.9; }
.kpi .ic.violet { color: var(--violet); opacity: 1; }
.kpi .ic.cyan { color: var(--active); opacity: 1; }
.kpi .ic.amber { color: var(--amber); opacity: 1; }
.kpi .ic.bad { color: var(--danger); opacity: 1; }
.kpi .val { font: 700 27px/1 var(--mono); margin: 8px 0 2px; letter-spacing: -0.02em; }
.kpi .val.nodata { font-size: 19px; color: var(--faint); }
.kpi .val.violet { color: var(--violet); } .kpi .val.cyan { color: var(--cyan); } .kpi .val.amber { color: var(--amber); } .kpi .val.bad { color: var(--danger); }
.kpi .sub { font-size: 12.5px; color: var(--muted); }

/* ---------- charts ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; align-items: stretch; }
@media (max-width: 920px) { .grid-2 { grid-template-columns: 1fr; } }
.grid-2 > .card { display: flex; flex-direction: column; }
.grid-2 > .card > .chart, .grid-2 > .card > .split { flex: 1; }
.chart { display: grid; gap: 10px; padding: 16px 18px; align-content: start; }

/* top-performer rows: avatar + name/subtitle + value, with the bar beneath —
   two lines each, so a small team still fills the card. */
.prow { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px 11px; padding: 9px 8px; border-radius: 11px; transition: background 0.15s; }
.prow:hover { background: var(--surface-2); }
.prow .avatar { width: 34px; height: 34px; font-size: 13px; }
.prow .who { min-width: 0; }
.prow .who .nm { font-weight: 600; font-size: 13.5px; display: flex; align-items: center; gap: 7px; }
.prow .who .mt { font-size: 11.5px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow .big { font: 700 15px var(--mono); text-align: right; white-space: nowrap; }
.prow .big small { display: block; margin-top: 2px; }
.prow .bar { grid-column: 1 / -1; height: 8px; border-radius: 5px; background: var(--surface-3); overflow: hidden; margin-top: 2px; }
.prow .bar i { display: block; height: 100%; border-radius: 5px; background: var(--grad); transition: width 0.6s cubic-bezier(.2,.7,.2,1); }
.rank-pill { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 6px; background: var(--violet-soft); color: var(--violet); font: 700 10px var(--mono); }

/* ---------- through the day: activity by hour, work hours ---------- */
.day-charts { display: grid; gap: 16px; margin-bottom: 20px; }
.hours { padding: 18px 20px 14px; }
/* bars over a light office-hours band; gridlines at the top and the middle */
.hours-plot { position: relative; height: 170px; margin-left: 46px; border-bottom: 1px solid var(--line-strong);
  background: linear-gradient(var(--line), var(--line)) 0 0 / 100% 1px no-repeat, linear-gradient(var(--line), var(--line)) 0 50% / 100% 1px no-repeat; }
.hours-office { position: absolute; top: 0; bottom: 0; border-radius: 6px 6px 0 0; background: var(--violet-soft); }
.hours-y { position: absolute; left: -46px; width: 40px; transform: translateY(-50%); text-align: right; font: 500 11px var(--mono); color: var(--faint); }
.hours-y.top { top: 0; } .hours-y.mid { top: 50%; }
.hours-bars { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(24, 1fr); gap: 3px; padding: 0 2px; }
.hours-col { display: flex; align-items: flex-end; height: 100%; }
.hours-col i { display: block; width: 100%; border-radius: 4px 4px 0 0; background: color-mix(in srgb, var(--active) 70%, transparent); transition: filter 0.15s; }
.hours-col.peak i { background: var(--active); }
.hours-col:hover i { filter: brightness(1.18); }
.hours-axis { position: relative; height: 18px; margin: 6px 0 0 46px; }
.hours-axis span { position: absolute; transform: translateX(-50%); font: 500 11px var(--mono); color: var(--faint); }
.hours-axis span:first-child { transform: none; }
.hours-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 18px; margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.hours-foot b { color: var(--text); font-weight: 600; }
.hours-foot .key { display: inline-flex; align-items: center; gap: 7px; }
.office-key { width: 14px; height: 10px; border-radius: 3px; background: var(--violet-soft); border: 1px solid var(--line); }

.spans { display: grid; gap: 2px; padding: 10px 12px 14px; }
.span-row { display: grid; grid-template-columns: 170px minmax(0, 1fr) 132px; align-items: center; gap: 14px; padding: 6px 8px; border-radius: 10px; }
.span-row.clickable { cursor: pointer; transition: background 0.12s; }
.span-row.clickable:hover { background: var(--surface-2); }
.span-row.axis { padding-block: 0 2px; }
.span-ticks { position: relative; height: 16px; }
.span-ticks span { position: absolute; transform: translateX(-50%); font: 500 11px var(--mono); color: var(--faint); }
.span-who { display: flex; align-items: center; gap: 9px; min-width: 0; }
.span-who .avatar { width: 28px; height: 28px; font-size: 11px; }
.span-who .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 13.5px; }
.span-track { position: relative; height: 26px; }
.span-track::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--line); }
.spans-office { position: absolute; top: 2px; bottom: 2px; border-radius: 5px; background: var(--violet-soft); }
.span-bar { position: absolute; top: 50%; height: 10px; transform: translateY(-50%); border-radius: 6px; background: var(--active); }
.span-time { display: flex; align-items: center; justify-content: flex-end; gap: 6px; white-space: nowrap; font: 600 12.5px var(--mono); color: var(--muted); }
@media (max-width: 600px) {
  .hours-axis .minor, .hours-axis span:first-child { display: none; } /* 06:00 · 12:00 · 18:00 only */
  .span-row { grid-template-columns: 96px minmax(0, 1fr); gap: 10px; }
  .span-row > :nth-child(3), .span-who .avatar { display: none; }
}
@media (prefers-reduced-motion: reduce) { .hours-col i, .span-row.clickable { transition: none; } }

.split { padding: 18px; container-type: inline-size; display: grid; align-content: center; }
/* State donut: segments and legend rows highlight together on hover/focus. */
.donut-box { display: grid; grid-template-columns: 168px minmax(0, 1fr); align-items: center; gap: 12px 20px; }
.donut-box .donut-help { grid-column: 1 / -1; }
@container (max-width: 430px) { .donut-box { grid-template-columns: 1fr; } }
.donut-wrap { position: relative; width: 168px; height: 168px; margin: 0 auto; }
.donut { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut circle { fill: none; stroke-width: 18; }
.donut .track { stroke: var(--surface-3); }
.donut .seg { cursor: pointer; transition: opacity 0.15s, stroke-width 0.15s; }
.donut .seg:hover { stroke-width: 22; }
.donut .seg.dim { opacity: 0.28; }
.donut-mid { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; text-align: center; pointer-events: none; line-height: 1.15; }
.donut-mid b { font: 700 24px var(--mono); color: var(--text); }
.donut-mid span { font-size: 12px; color: var(--muted); }
.donut-mid small { font: 500 11px var(--mono); color: var(--faint); }
.legend { display: grid; gap: 2px; }
.legend .li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 38px; align-items: center; gap: 9px; width: 100%; padding: 6px 8px;
  border: 0; border-radius: 8px; background: transparent; color: var(--text); font: 500 13.5px var(--ui); text-align: left; cursor: pointer; }
.legend .li:hover, .legend .li.on { background: var(--surface-2); }
.legend .li:disabled { opacity: 0.45; cursor: default; background: transparent; }
.legend .li b { width: 10px; height: 10px; border-radius: 3px; }
.legend .li .v { font-family: var(--mono); color: var(--muted); }
.legend .li .pc { font: 500 12px var(--mono); color: var(--faint); text-align: right; }
.donut-help { margin: 0; min-height: 2.7em; font-size: 12.5px; line-height: 1.35; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .donut .seg { transition: none; } }

/* ---------- table ---------- */
table { width: 100%; border-collapse: collapse; }
thead th { text-align: left; padding: 12px 16px; font: 600 11px var(--ui); text-transform: uppercase; letter-spacing: 0.07em; color: var(--faint); border-bottom: 1px solid var(--line); white-space: nowrap; }
tbody td { padding: 13px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.clickable { cursor: pointer; transition: background 0.12s; }
tbody tr.clickable:hover { background: var(--surface-2); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.who-cell { display: flex; align-items: center; gap: 11px; }
.who-cell .nm { font-weight: 600; } .who-cell .em { font-size: 12px; color: var(--muted); }
.avatar { display: grid; place-items: center; border-radius: 50%; background: var(--grad); color: #fff; font: 700 12px var(--ui); flex: none; width: 34px; height: 34px; }

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; vertical-align: middle; }
.dot.on { background: var(--cyan); box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.5); animation: pulse 2.2s infinite; }
.dot.off { background: var(--neutral); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.45); } 70% { box-shadow: 0 0 0 6px rgba(22, 163, 74, 0); } 100% { box-shadow: 0 0 0 0 transparent; } }
.status { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 5px; font: 600 11.5px var(--ui); padding: 3px 9px; border-radius: 999px; background: var(--surface-3); color: var(--muted); }
.chip.ok { background: var(--cyan-soft); color: var(--cyan); }
.chip.warn { background: var(--amber-soft); color: var(--amber); }
.chip.bad { background: var(--danger-soft); color: var(--danger); }

.mini { display: flex; align-items: center; gap: 10px; }
.mini .bar { width: 110px; height: 7px; border-radius: 4px; background: var(--surface-3); overflow: hidden; display: flex; }
.mini .bar i.active { background: var(--active); } .mini .bar i.idle { background: var(--idle); } .mini .bar i.locked { background: var(--locked); }
.mini .t { font-family: var(--mono); font-size: 13px; }
.rate { font: 700 13px var(--mono); }
.rate.hi { color: var(--cyan); } .rate.mid { color: var(--amber); } .rate.lo { color: var(--danger); }

.cat-tag { font: 600 11px var(--ui); padding: 2px 8px; border-radius: 999px; cursor: pointer; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--muted); }
.cat-tag:hover { border-color: var(--violet); color: var(--text); }
.cat-tag.productive { background: var(--cyan-soft); color: var(--cyan); border-color: transparent; }
.cat-tag.unproductive { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.cat-tag.neutral { background: var(--surface-3); color: var(--neutral); }

.menu-wrap { position: relative; }
.menu-btn { padding: 5px 10px; letter-spacing: 1px; font-weight: 700; }
.menu { position: fixed; z-index: 30; /* top/right set when opened (app.js openMenuAt) */ min-width: 170px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 11px; box-shadow: var(--shadow); padding: 6px; display: grid; gap: 2px; }
.menu button { width: 100%; text-align: left; background: transparent; border: 0; padding: 9px 11px; border-radius: 7px; font-weight: 500; }
.menu button:hover { background: var(--surface-2); }
.menu button.danger-item { color: var(--danger); }

/* ---------- modal ---------- */
.overlay { position: fixed; inset: 0; z-index: 40; overflow: auto; background: rgba(20, 21, 35, 0.4); backdrop-filter: blur(4px); display: flex; align-items: flex-start; justify-content: center; padding: 44px 16px; }
.modal { width: 100%; max-width: 880px; animation: rise 0.22s ease; }
.modal.narrow { max-width: 480px; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.mhead { display: flex; align-items: flex-start; gap: 14px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.mhead h2 { font-size: 18px; } .mhead .sub { font-size: 13px; color: var(--muted); margin-top: 3px; }
.lockbar { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; padding: 14px 20px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.lockbar .label { margin-right: auto; }

.timeline { position: relative; height: 26px; border-radius: 7px; background: var(--surface-3); overflow: hidden; }
.timeline i { position: absolute; top: 0; height: 100%; }
.timeline i.active { background: var(--active); } .timeline i.idle { background: var(--idle); } .timeline i.locked { background: var(--locked); }
/* Event markers: a thin line where something happened (details on hover, and in "What happened"). */
.timeline b.mark { position: absolute; top: 0; height: 100%; width: 2px; margin-left: -1px; background: var(--text); opacity: 0.6; }
.ticks { position: relative; height: 16px; margin-top: 4px; }
.ticks span { position: absolute; transform: translateX(-50%); font: 500 10.5px var(--mono); color: var(--faint); }
.ticks span:first-child { transform: none; } .ticks span:last-child { transform: translateX(-100%); }

.tl-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.tl-legend span { display: inline-flex; align-items: center; gap: 6px; }
.tl-legend b { width: 9px; height: 9px; border-radius: 3px; }
.tl-legend b.mk { width: 2px; height: 12px; border-radius: 1px; background: var(--text); opacity: 0.6; }

/* The timeline modal's sections, evenly spaced. */
.tl-stack { display: grid; gap: 16px; }
.tl-stack .tiles { margin: 0; }
.tl-stack .grid2 { gap: 16px; align-items: start; } /* each panel only as tall as its list */
.panel { min-width: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); padding: 14px 16px 10px; }
.panel-h { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.panel-h h3 { font-size: 14px; margin: 0; }
.panel-h .cnt { font: 600 11px var(--mono); color: var(--faint); background: var(--surface-3); border-radius: 999px; padding: 1px 7px; }
.panel-h .tot { margin-left: auto; font: 500 12px var(--mono); color: var(--muted); }
.panel .events { margin-top: 4px; }

/* A ranked row: name · label · time, then an optional address line and a thin share bar. */
.rrow { display: grid; grid-template-columns: minmax(0, 1fr) auto 56px; align-items: center; gap: 2px 10px; padding: 9px 0 8px; border-top: 1px solid var(--line); }
.panel-h + .rrow { border-top: 0; }
.rrow .nm { min-width: 0; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rrow .nm a { color: inherit; } .rrow .nm a:hover, .rrow .nm a:focus-visible { color: var(--violet); text-decoration: underline; }
.rrow .v { font: 500 12.5px var(--mono); color: var(--muted); text-align: right; }
.rrow .sub2 { grid-column: 1 / -1; min-width: 0; font-size: 11.5px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rrow .track { grid-column: 1 / -1; height: 4px; margin-top: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.rrow .track i { display: block; height: 100%; border-radius: 2px; background: var(--grad); }
.rrow.run .track i { background: var(--neutral); }
/* Unlabelled apps show "Label" only on hover/focus, so the list stays calm. */
.rrow .cat-tag.unset { opacity: 0; transition: opacity 0.12s; }
.rrow:hover .cat-tag.unset, .rrow .cat-tag.unset:focus-visible { opacity: 1; }
@media (hover: none) { .rrow .cat-tag.unset { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .rrow .cat-tag.unset { transition: none; } }
/* A long list scrolls inside its card with no visible scrollbar (like the
   sidebar and page); its bottom edge fades while there's more below. */
.scrolly { overflow-y: auto; scrollbar-width: none; }
.scrolly::-webkit-scrollbar { width: 0; height: 0; }
.scrolly.more-below { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 44px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 44px), transparent); }
.rank-scroll { max-height: 330px; }
.rank-scroll > .rrow:first-child { border-top: 0; }

/* report: visits, one row each (start, end, time in front, type, what) */
.visits-panel .panel-h { flex-wrap: wrap; align-items: center; gap: 8px; }
.visits-panel .seg-toggle { background: var(--surface); }
.visits-note { margin: 0 0 6px; font-size: 12px; }
.vrow { display: grid; grid-template-columns: 52px 52px 60px 78px minmax(0, 1fr); align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px; }
.visits { max-height: 450px; }
.vrow.head { position: sticky; top: 0; z-index: 1; background: var(--surface-2); border-top: 0; padding-bottom: 4px; font: 600 10.5px var(--ui); letter-spacing: 0.07em; text-transform: uppercase; color: var(--faint); }
.vrow .num { font: 500 12.5px var(--mono); font-variant-numeric: tabular-nums; color: var(--muted); }
.vrow .dur { font-weight: 700; color: var(--text); }
.vkind { justify-self: start; padding: 2px 8px; border-radius: 999px; background: var(--surface-3); color: var(--muted); font: 600 11px var(--ui); }
.vkind.k-page, .vkind.k-site { background: var(--violet-soft); color: var(--violet); }
.vkind.k-video { background: var(--danger-soft); color: var(--danger); }
.vkind.k-stream { background: var(--amber-soft); color: var(--amber); }
.vkind.k-app { background: var(--cyan-soft); color: var(--cyan); }
.vwhat { min-width: 0; }
.vwhat .nm, .vwhat .sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vwhat .nm { font-weight: 600; }
.vwhat .nm a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.vwhat .sub { font: 500 11.5px var(--mono); color: var(--faint); }
/* full addresses: shown whole (wrapping), clickable */
.vwhat a.url { display: block; white-space: normal; overflow-wrap: anywhere; color: var(--violet); text-decoration: none; }
.rrow .sub2.url { white-space: normal; overflow: visible; overflow-wrap: anywhere; }
.rrow .sub2.url a { color: var(--violet); text-decoration: none; }
.vwhat a.url:hover, .rrow .sub2.url a:hover { text-decoration: underline; text-underline-offset: 2px; }
.vrow.gap .vwhat .nm { font-weight: 500; font-style: italic; color: var(--muted); }
.vrow.gap .dur { color: var(--muted); }
@media (max-width: 600px) {
  .vrow { grid-template-columns: 44px 48px minmax(0, 1fr); }
  .vrow > :nth-child(2), .vrow > :nth-child(4) { display: none; } /* start, time and what on phones */
}

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 16px 0; }
.tiles.four { grid-template-columns: repeat(4, 1fr); }
.tiles.five { grid-template-columns: repeat(5, 1fr); gap: 10px; }
.tiles.five .tile { padding: 11px 12px; } .tiles.five .tile .v { font-size: 19px; }
.tiles.five .tile .p { font-family: var(--ui); font-size: 11.5px; line-height: 1.3; margin-top: 2px; }
@media (max-width: 760px) { .tiles.five { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 620px) { .tiles, .tiles.four, .tiles.five { grid-template-columns: 1fr 1fr; } }
.tile { border: 1px solid var(--line); border-radius: 11px; padding: 13px 14px; background: var(--surface-2); }
.tile .k { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); } .tile .k b { width: 9px; height: 9px; border-radius: 3px; }
.tile .v { font: 700 21px/1.1 var(--mono); margin-top: 7px; } .tile .p { font-size: 12px; color: var(--faint); font-family: var(--mono); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 720px) { .grid2 { grid-template-columns: 1fr; } }

.events { display: grid; }
.ev { display: grid; grid-template-columns: 54px 14px 1fr; gap: 10px; align-items: baseline; padding: 6px 0; }
.ev .time { font: 500 12.5px var(--mono); color: var(--muted); }
.ev .pip { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); align-self: center; }
.ev .pip.ev-lock { background: var(--locked); }
.ev .pip.ev-lock_admin, .ev .pip.ev-it_lockout, .ev .pip.ev-lock_screen { background: var(--admin-lock); }
.ev .pip.ev-sleep, .ev .pip.ev-wake { background: var(--asleep); }
.ev .pip.ev-unlock, .ev .pip.ev-login { background: var(--cyan); }
.ev .txt { font-size: 13.5px; } .ev .txt .by { color: var(--faint); font-size: 12px; }

.catman { display: grid; gap: 8px; }
.catrow { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.catrow .nm { font-weight: 600; } .catrow .nm small { color: var(--faint); font-weight: 400; margin-left: 8px; }
.catseg { display: inline-flex; gap: 4px; }
.catseg button { padding: 5px 11px; font-size: 12.5px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.catseg button.on.productive { background: var(--cyan-soft); color: var(--cyan); border-color: transparent; }
.catseg button.on.unproductive { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.catseg button.on.neutral { background: var(--violet-soft); color: var(--violet); border-color: transparent; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(700px 500px at 20% -5%, rgba(108,76,255,0.10), transparent 60%), radial-gradient(600px 450px at 100% 100%, rgba(255,77,141,0.08), transparent 55%), var(--bg); }
.login .card { width: 100%; max-width: 380px; padding: 30px; }
.login .brandrow { display: flex; justify-content: center; margin-bottom: 18px; }
.login h2 { text-align: center; font-size: 18px; margin-bottom: 20px; }
.field { display: block; margin-bottom: 15px; }
.field span { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 7px; }
.field input { width: 100%; }
.err { color: var(--danger); font-size: 13.5px; min-height: 20px; }

.formgrid { display: grid; gap: 14px; }
.hint { font-size: 12.5px; color: var(--faint); }
.codebox { font: 700 30px var(--mono); letter-spacing: 6px; text-align: center; padding: 16px; background: var(--surface-3); border-radius: 11px; color: var(--violet); }
.rowform { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
input.tz { width: 15rem; max-width: 100%; }
/* Ten columns (a project's team with its activity): tighter cells keep it
   inside its card on laptop screens; narrower windows scroll it sideways. */
.table-scroll { overflow-x: auto; }
.pj-table th, .pj-table td { padding-left: 11px; padding-right: 11px; }
.pj-table .mini .bar { width: 90px; }
/* Long device names are cut with "…" (full name on hover). On the inner div:
   browsers ignore max-width on table cells themselves. */
.pj-table .clip, .pj-table .who-cell .nm, .pj-table .who-cell .em { max-width: 13rem; overflow: hidden; text-overflow: ellipsis; }
td input.tz { padding: 6px 10px; }

/* ---------- reports: apps & web, monthly stats ---------- */
.tb-field { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); }
.tb-field input[type="number"] { width: 64px; padding: 8px 9px; }
#usage-tools .range { display: inline-flex; align-items: center; gap: 6px; }
/* Keep the filters on one line (the subtitle wraps instead); on narrower
   screens they move to their own row under the title. */
#usage-tools { flex-shrink: 0; }
@media (max-width: 1259px) {
  .topbar:has(#usage-tools:not(.hidden)) { flex-wrap: wrap; }
  #usage-tools { flex-shrink: 1; }
}
#usage-tools input[type="date"] { padding: 8px 8px; font-size: 13.5px; }
input[type="month"] { font-family: var(--mono); color-scheme: light; }
:root[data-theme="dark"] input[type="month"] { color-scheme: dark; }
.kpis.four { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1140px) { .kpis.four { grid-template-columns: repeat(2, 1fr); } }
.kpi .val.name { font: 700 19px/1.3 var(--ui); letter-spacing: -0.01em; margin: 10px 0 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grid-even { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
@media (max-width: 920px) { .grid-even { grid-template-columns: 1fr; } }
.uslist { max-height: 360px; padding: 4px 18px 10px; }
.usrow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(56px, 120px) 70px 58px; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.usrow:last-child { border-bottom: 0; }
.usrow.head { font: 600 11px var(--ui); text-transform: uppercase; letter-spacing: 0.07em; color: var(--faint); position: sticky; top: 0; background: var(--surface); }
.usrow .nm { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13.5px; }
.usrow .nm .txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usrow .nm .chip { flex: none; }
.usrow .track { height: 6px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.usrow .track i { display: block; height: 100%; border-radius: 4px; background: var(--grad); }
.usrow .v, .usrow .p { font: 500 12.5px var(--mono); color: var(--muted); text-align: right; }
.usrow.head .v, .usrow.head .p { font: inherit; }
.usrow.merged .nm { color: var(--faint); font-style: italic; }
.usrow.merged .track i { background: var(--neutral); }

table.month { table-layout: fixed; min-width: 860px; }
table.month th.we { color: var(--danger); }
table.month td { vertical-align: top; white-space: normal; padding: 12px 12px 14px; border-right: 1px solid var(--line); }
table.month td:last-child { border-right: 0; }
table.month td.wk { font: 600 12px var(--ui); color: var(--violet); white-space: nowrap; }
table.month td.total { background: var(--surface-2); }
table.month td.out { background: var(--surface-2); opacity: 0.5; }
/* a weekday that met the expected day (green) or fell short of it (red) */
.day-met { background: color-mix(in srgb, var(--cyan) 18%, transparent); }
.day-short { background: color-mix(in srgb, var(--danger) 15%, transparent); }
table.month td.day-met .t { color: var(--cyan); }
table.month td.day-short .t { color: var(--danger); }
.day-legend { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.day-legend span { display: inline-flex; align-items: center; gap: 7px; }
.day-legend i { width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--line); }
table.month .dn { font: 600 12px var(--mono); color: var(--faint); }
table.month .dn.we { color: var(--danger); }
table.month .t { font: 700 14.5px var(--mono); margin-top: 6px; white-space: nowrap; }
table.month .t.none { color: var(--faint); font-weight: 500; }
table.month .r { font: 500 12px var(--mono); color: var(--muted); }

.ev .pip.ev-tracking_paused { background: var(--amber); }
.ev .pip.ev-tracking_resumed { background: var(--cyan); }
.ev .pip.ev-lockout_password_changed, .ev .pip.ev-lockout_password_viewed { background: var(--violet); }

/* ---------- small dialogs (native <dialog>) ---------- */
dialog.dlg { border: 0; padding: 0; background: transparent; color: var(--text); width: calc(100% - 32px); max-width: 500px; max-height: calc(100vh - 64px); overflow: visible; }
dialog.dlg::backdrop { background: rgba(20, 21, 35, 0.4); backdrop-filter: blur(4px); }
:root[data-theme="dark"] dialog.dlg::backdrop { background: rgba(6, 5, 12, 0.66); }
dialog.dlg .modal { max-width: none; max-height: calc(100vh - 64px); overflow-y: auto; }
.flabel { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 7px; }
.wide input { width: 100%; }
.pwfield { display: flex; gap: 8px; }
.pwfield input { flex: 1; min-width: 0; letter-spacing: 0.02em; }
.hint.rule { margin-top: 7px; }
.hint.rule.bad { color: var(--danger); }
.formgrid .hint + .hint { margin-top: 4px; }
.linkbtn { justify-self: start; background: none; border: 0; padding: 0; color: var(--violet); font-weight: 600; font-size: 13px; cursor: pointer; }
.linkbtn:hover { background: none; text-decoration: underline; }
.secret { font: 700 20px/1.35 var(--mono); letter-spacing: 0.04em; padding: 16px; background: var(--surface-3); border-radius: 11px; color: var(--violet); text-align: center; word-break: break-all; user-select: all; }

/* ---------- projects ---------- */
/* A toolbar, then one card per project that opens like a dropdown to its team. */
.pj-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.pj-bar #pj-search { width: min(380px, 100%); padding-left: 38px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238b86b0' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m11 11 3.5 3.5'/%3E%3C/svg%3E") no-repeat 13px center; }
.pj-hint { margin: 10px 2px 16px; line-height: 1.45; }
.pj-list { display: grid; gap: 10px; }
.pj-blank { padding: 36px 24px; display: grid; justify-items: center; gap: 10px; text-align: center; }
.pj-blank h3 { font-size: 16px; } .pj-blank p { margin: 0; max-width: 420px; }

.pj-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; transition: border-color 0.15s; }
.pj-card[open] { border-color: var(--line-strong); }
.pj-card summary { list-style: none; display: grid; grid-template-columns: 14px 40px minmax(0, 1fr) auto auto auto; align-items: center; gap: 14px; padding: 13px 14px 13px 18px; cursor: pointer; }
.pj-card summary::-webkit-details-marker { display: none; }
.pj-card summary:hover { background: var(--surface-2); }
.pj-card summary:focus-visible { outline: 2px solid var(--violet); outline-offset: -2px; border-radius: 14px; }
.pj-chev { width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform 0.15s; justify-self: center; }
.pj-card[open] .pj-chev { transform: rotate(45deg); }
@media (prefers-reduced-motion: reduce) { .pj-chev, .pj-card { transition: none; } }
.pj-tile { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font: 700 14px var(--ui); color: #fff; letter-spacing: 0.02em; }
/* Five tints for project tiles and member faces, picked by id (decoration only). */
.pj-tile.h0, .av-stack .avatar.h0 { background: linear-gradient(135deg, #6c4cff, #9d7bff); }
.pj-tile.h1, .av-stack .avatar.h1 { background: linear-gradient(135deg, #e0457b, #ff7aa5); }
.pj-tile.h2, .av-stack .avatar.h2 { background: linear-gradient(135deg, #0f8a7a, #2bb5a2); }
.pj-tile.h3, .av-stack .avatar.h3 { background: linear-gradient(135deg, #c26a06, #eb9a2c); }
.pj-tile.h4, .av-stack .avatar.h4 { background: linear-gradient(135deg, #2457d6, #4f86f7); }
.pj-main { min-width: 0; display: grid; gap: 1px; }
.pj-main .nm { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pj-main .meta { font-size: 12.5px; color: var(--muted); }
.av-stack { display: flex; padding-left: 6px; }
.av-stack .avatar { width: 30px; height: 30px; font-size: 10.5px; margin-left: -6px; box-shadow: 0 0 0 2px var(--surface); }
.pj-card summary:hover .av-stack .avatar { box-shadow: 0 0 0 2px var(--surface-2); }
.av-stack .more-av { background: var(--surface-3); color: var(--muted); }

.pj-body { border-top: 1px solid var(--line); }
.pj-tools { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.pj-tools .pj-filter { width: min(320px, 100%); padding: 7px 11px; }
.pj-table thead th { padding-top: 10px; padding-bottom: 10px; }
.pj-empty { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; color: var(--muted); }
.pj-empty p { margin: 0; }
#dlg-body > .seg-toggle { justify-self: start; }
.pj-pane .pj-fields input, .pj-pane input[type="search"] { width: 100%; }
/* menu separators between groups of actions */
.menu .sep { height: 1px; margin: 4px 6px; background: var(--line); }

/* ---------- employee report page ---------- */
.report-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.report-head .who-cell { gap: 13px; }
.report-head .avatar { width: 46px; height: 46px; font-size: 15px; }
.report-head h2 { font-size: 20px; }
.report-head .sub { font-size: 13px; color: var(--muted); margin-top: 3px; }
#tab-report .lockbar { border-radius: var(--radius) var(--radius) 0 0; }
@media (max-width: 720px) {
  .pj-card summary { grid-template-columns: 14px 36px minmax(0, 1fr) auto; gap: 10px; }
  .pj-card .av-stack, .pj-card .pj-online { display: none; }
  .pj-tile { width: 36px; height: 36px; }
}
.row-acts { text-align: right; } .row-acts > button + button { margin-left: 6px; }
.dev-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.dev-chip { display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; }
.dev-chip .ip { font: 500 12px var(--mono); color: var(--faint); }
.pj-fields { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
@media (max-width: 760px) { .pj-fields { grid-template-columns: 1fr; } }

.pickbox { max-height: 230px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; padding: 4px; }
.pickbox label { display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: center; gap: 10px; padding: 7px 9px; border-radius: 7px; cursor: pointer; font-size: 13.5px; }
.pickbox label:hover { background: var(--surface-2); }
.pickbox label .faint { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pickbox input { width: auto; padding: 0; }
.pj-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.chip.pj { background: var(--violet-soft); color: var(--violet); font-size: 11px; padding: 2px 8px; }

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: grid; gap: 10px; }
.toast { background: var(--surface); border: 1px solid var(--line-strong); border-left: 3px solid var(--violet); border-radius: 10px; padding: 12px 16px; box-shadow: var(--shadow); min-width: 220px; animation: rise 0.2s ease; font-size: 13.5px; transition: opacity 0.3s; }
.toast.ok { border-left-color: var(--cyan); } .toast.bad { border-left-color: var(--danger); }

.empty { padding: 44px 16px; text-align: center; color: var(--muted); }
.spin { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--line-strong); border-top-color: var(--violet); border-radius: 50%; animation: rot 0.7s linear infinite; vertical-align: -3px; }
@keyframes rot { to { transform: rotate(360deg); } }

/* ---------- notification bell ---------- */
.notif-wrap { position: relative; }
.notif-btn { position: relative; font-size: 16px; line-height: 1; padding: 7px 10px; }
.notif-badge { position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--danger); color: #fff; font: 700 10px/17px var(--mono); text-align: center; box-sizing: border-box; }
.notif-panel { width: 320px; max-width: calc(100vw - 24px); max-height: 60vh; overflow-y: auto; }
.notif-head { padding: 4px 8px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.notif-item { display: grid; gap: 2px; padding: 9px 10px; border-radius: 8px; }
.notif-item.unread { background: var(--violet-soft); }
.notif-t { font: 600 13px var(--ui); }
.notif-s { font-size: 12px; color: var(--muted); }
.notif-empty { padding: 20px; text-align: center; color: var(--muted); font-size: 13px; }

/* ---------- phones ---------- */
@media (max-width: 600px) {
  .content { padding: 16px; }
  .topbar { padding: 12px 16px; gap: 10px; flex-wrap: wrap; }
  .topbar h1 { font-size: 17px; }
  .kpi .val { font-size: 20px; } /* "137h 18m" stays on one line in a half-width tile */
  .notif-panel { width: calc(100vw - 24px); }
}
