/* LP Checklist: supervisor dashboard.
 * Navy (brand, from the extension icon) + green (signed in, done) on a quiet
 * neutral base; amber and red only for "in progress" and destructive actions.
 * Every color is a token, redefined for dark mode below. */

:root {
  --canvas: #f4f5f7;
  --surface: #ffffff;
  --sunk: #f8f9fb;
  --hover: #f5f7fa;
  --ink: #101828;
  --ink-2: #344054;
  --muted: #667085;
  --faint: #98a2b3;
  --line: #e4e7ec;
  --line-soft: #eef0f3;

  --brand: #14213d;
  --brand-2: #22335c;
  --brand-soft: #edf0f7;
  --on-brand: #ffffff;
  --focus: #6b8cff;
  --link: #2449c7;

  --ok: #12b76a;
  --ok-ink: #067647;
  --ok-soft: #ecfdf3;
  --ok-track: #d1fadf;
  --warn: #f79009;
  --warn-ink: #b54708;
  --warn-soft: #fffaeb;
  --danger: #d92d20;
  --danger-ink: #b42318;
  --danger-soft: #fef3f2;
  --danger-line: #fecdca;
  --info-ink: #175cd3;
  --info-soft: #eff8ff;

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 4px 10px -2px rgba(16, 24, 40, 0.08), 0 2px 4px -2px rgba(16, 24, 40, 0.04);
  --shadow-lg: 0 24px 48px -12px rgba(16, 24, 40, 0.22);
  --backdrop: rgba(16, 24, 40, 0.45);
  --av-l: 93%;
  --av-ink-l: 30%;

  --r: 14px;
  --r-sm: 9px;
  --font: 'Inter', 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: 'JetBrains Mono', Consolas, 'Cascadia Mono', ui-monospace, Menlo, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #0b0f17;
    --surface: #121925;
    --sunk: #0f1520;
    --hover: #182133;
    --ink: #f2f4f7;
    --ink-2: #cfd5df;
    --muted: #98a2b3;
    --faint: #667085;
    --line: #253043;
    --line-soft: #1b2434;

    --brand: #e4e9f4;
    --brand-2: #ffffff;
    --brand-soft: #1b2741;
    --on-brand: #0b0f17;
    --focus: #84a1ff;
    --link: #8fb0ff;

    --ok: #32d583;
    --ok-ink: #6ce9a6;
    --ok-soft: rgba(18, 183, 106, 0.14);
    --ok-track: rgba(50, 213, 131, 0.2);
    --warn: #fdb022;
    --warn-ink: #fec84b;
    --warn-soft: rgba(247, 144, 9, 0.14);
    --danger: #f97066;
    --danger-ink: #fda29b;
    --danger-soft: rgba(217, 45, 32, 0.16);
    --danger-line: rgba(249, 112, 102, 0.4);
    --info-ink: #84caff;
    --info-soft: rgba(46, 144, 250, 0.14);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 24px 48px -12px rgba(0, 0, 0, 0.6);
    --backdrop: rgba(0, 0, 0, 0.6);
    --av-l: 24%;
    --av-ink-l: 82%;
    color-scheme: dark;
  }
}

/* ---------------------------------------------------------------- base */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 400 14px/1.5 var(--font);
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.num { font-variant-numeric: tabular-nums; }
.ic { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--muted); }
.boot img { width: 40px; height: 40px; border-radius: 10px; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.45; } }

/* ---------------------------------------------------------------- buttons + inputs */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: var(--r-sm);
  border: 1px solid transparent; background: none;
  font-weight: 600; font-size: 13.5px; white-space: nowrap;
  transition: background-color 0.12s, border-color 0.12s, color 0.12s, box-shadow 0.12s;
}
.btn .ic { width: 15px; height: 15px; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; gap: 6px; }
.btn.sm .ic { width: 14px; height: 14px; }
.btn.primary { background: var(--brand); color: var(--on-brand); box-shadow: var(--shadow-sm); }
.btn.primary:hover { background: var(--brand-2); }
.btn.ghost { background: var(--surface); border-color: var(--line); color: var(--ink-2); box-shadow: var(--shadow-sm); }
.btn.ghost:hover { background: var(--hover); border-color: var(--faint); color: var(--ink); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger:hover { filter: brightness(0.94); }
.btn.danger-ghost { background: var(--surface); border-color: var(--danger-line); color: var(--danger-ink); }
.btn.danger-ghost:hover { background: var(--danger-soft); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; filter: none; }
.icon-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px;
  border: 1px solid transparent; background: none; color: var(--muted);
  transition: background-color 0.12s, color 0.12s;
}
.icon-btn:hover, .icon-btn[aria-expanded='true'] { background: var(--hover); color: var(--ink); }
.icon-btn.xs { width: 26px; height: 26px; border-radius: 6px; }
.icon-btn.xs .ic { width: 14px; height: 14px; }

input[type='text'], input[type='email'], input[type='password'], input[type='search'], textarea {
  width: 100%; height: 38px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm);
  transition: border-color 0.12s, box-shadow 0.12s;
}
textarea { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }
.field { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.hint { font-size: 12.5px; font-weight: 400; color: var(--muted); }

.search { position: relative; display: block; }
.search .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search input { padding-left: 34px; height: 34px; font-size: 13.5px; }

/* segmented control */
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 9px; background: var(--sunk); border: 1px solid var(--line); }
.seg button { height: 26px; padding: 0 10px; border: 0; border-radius: 6px; background: none; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed='true'] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

/* ---------------------------------------------------------------- login */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background:
    radial-gradient(1200px 600px at 10% -10%, color-mix(in srgb, var(--brand) 9%, transparent), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, color-mix(in srgb, var(--ok) 10%, transparent), transparent 60%),
    var(--canvas);
}
.login { width: min(400px, 100%); display: grid; gap: 16px; padding: 32px; }
.login h1 { margin: 6px 0 0; font-size: 22px; letter-spacing: -0.01em; }
.login p { margin: -8px 0 4px; color: var(--muted); }
.login .err { margin: 0; min-height: 1.2em; color: var(--danger-ink); font-size: 13px; font-weight: 500; }
.login .btn { height: 40px; }

.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.brand b { display: block; font-size: 14.5px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; }
.brand span { display: block; font-size: 12px; color: var(--muted); line-height: 1.3; }

/* ---------------------------------------------------------------- shell */
.top { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1240px; margin: 0 auto; padding: 0 24px; height: 62px; display: flex; align-items: center; gap: 28px; }
.nav { display: flex; gap: 4px; align-self: stretch; }
.nav a { position: relative; display: flex; align-items: center; gap: 8px; padding: 0 12px; color: var(--muted); font-weight: 600; font-size: 14px; }
.nav a:hover { color: var(--ink); text-decoration: none; }
.nav a.on { color: var(--ink); }
.nav a.on::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--brand); }
.nav .ic { width: 17px; height: 17px; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.tz { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.me { display: flex; align-items: center; gap: 6px; padding-left: 14px; border-left: 1px solid var(--line); }
.me span { font-size: 13px; color: var(--ink-2); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { max-width: 1240px; margin: 0 auto; padding: 28px 24px 72px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.main > * { min-width: 0; }

.ph { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.ph h1 { margin: 0; font-size: 24px; line-height: 1.25; font-weight: 700; letter-spacing: -0.02em; }
.ph p { margin: 4px 0 0; color: var(--muted); max-width: 70ch; }
.ph .sp { flex: 1; }
.ph .actions { display: flex; gap: 8px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-sm); }
.card-h { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--line-soft); }
.card-h h2 { margin: 0; font-size: 15px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.card-h .sp { flex: 1; }
.card-h .search { width: 240px; }
.count { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 999px; background: var(--sunk); border: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }

.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

/* ---------------------------------------------------------------- shift summary */
.shift { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) auto; }
.shift > div { padding: 20px 24px; min-width: 0; }
.shift > div + div { border-left: 1px solid var(--line-soft); }
.kpi-label { font-size: 13px; font-weight: 600; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.kpi-label .ic { width: 15px; height: 15px; }
.kpi-value { margin-top: 6px; font-size: 30px; line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: 18px; font-weight: 600; color: var(--faint); letter-spacing: 0; }
.kpi-value.text { font-size: 20px; letter-spacing: -0.01em; }
.kpi-sub { margin-top: 6px; font-size: 13px; color: var(--muted); }
.kpi-sub.warn { color: var(--warn-ink); font-weight: 600; display: flex; gap: 6px; align-items: center; }
.meter { margin-top: 12px; height: 8px; border-radius: 999px; background: var(--ok-track); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 999px; background: var(--ok); transition: width 0.5s ease; }
.shift-actions { display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.shift-actions .btn { width: 100%; }

/* ---------------------------------------------------------------- tables */
.table-wrap { position: relative; overflow-x: auto; } /* relative: keeps .sr labels inside the scroller */
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 16px; background: var(--sunk); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 12px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background-color 0.1s; }
.tbl tbody tr:hover { background: var(--hover); }
.tbl .c-dot { width: 44px; padding-right: 0; text-align: center; }
.tbl .c-out { width: 1%; white-space: nowrap; text-align: right; }
.tbl .c-gen { width: 1%; white-space: nowrap; padding-left: 4px; }
.tbl .c-menu { width: 52px; padding-left: 4px; text-align: right; }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }

/* status dot: color + text label (never color alone) */
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; flex: none; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-track); }
.dot.off { background: transparent; border: 2px solid var(--faint); }
.dot.none { background: var(--line); }

/* avatar with initials; hue from the name */
.av {
  display: inline-grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%;
  background: hsl(var(--h, 220) 55% var(--av-l)); color: hsl(var(--h, 220) 45% var(--av-ink-l));
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.02em;
}
.av.lg { width: 48px; height: 48px; font-size: 16px; }
.av.sm { width: 28px; height: 28px; font-size: 11px; }
.av.gone { filter: grayscale(1); opacity: 0.6; }

.who { display: flex; align-items: center; gap: 12px; min-width: 200px; }
.who-name { font-weight: 600; color: var(--ink); }
a.who-name:hover { color: var(--link); text-decoration: none; }
.who-sub { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.who-sub.on { color: var(--ok-ink); font-weight: 500; }

.code-cell { display: flex; align-items: center; gap: 4px; }
.code-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 7px;
  font-family: var(--mono); font-size: 14px; font-weight: 600; letter-spacing: 0.06em;
  background: var(--sunk); border: 1px solid var(--line); color: var(--ink);
}
.code-chip .ic { width: 13px; height: 13px; color: var(--muted); }
.code-none { color: var(--faint); font-size: 13px; }

.act { display: grid; gap: 1px; min-width: 180px; }
.act b { font-weight: 600; font-size: 13px; }
.act span { font-size: 12.5px; color: var(--muted); }

/* deleted agents (collapsed by default) */
.deleted { border-top: 1px solid var(--line); }
.deleted summary { display: flex; align-items: center; gap: 8px; padding: 13px 18px; cursor: pointer; list-style: none; font-size: 13.5px; font-weight: 600; color: var(--muted); user-select: none; }
.deleted summary::-webkit-details-marker { display: none; }
.deleted summary:hover { color: var(--ink); }
.deleted summary .ic { transition: transform 0.15s; }
.deleted[open] summary .ic { transform: rotate(90deg); }
.deleted .tbl td { background: var(--sunk); }
.deleted .tbl tbody tr:hover td { background: var(--hover); }

/* ---------------------------------------------------------------- popover menu */
.menu {
  position: fixed; z-index: 60; min-width: 196px; padding: 5px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 11px; box-shadow: var(--shadow-lg);
  animation: pop 0.12s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(0.98); } }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 7px; background: none; text-align: left; font-size: 13.5px; font-weight: 500; color: var(--ink-2); }
.menu button:hover, .menu button:focus-visible { background: var(--hover); color: var(--ink); outline: none; }
.menu button.danger { color: var(--danger-ink); }
.menu button.danger:hover, .menu button.danger:focus-visible { background: var(--danger-soft); }
.menu hr { border: 0; border-top: 1px solid var(--line-soft); margin: 4px 2px; }

/* ---------------------------------------------------------------- dialogs */
dialog.dlg {
  width: min(480px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line); border-radius: 16px;
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg);
}
dialog.dlg[open] { animation: rise 0.16s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
dialog.dlg::backdrop { background: var(--backdrop); backdrop-filter: blur(2px); }
.dlg-h { display: flex; align-items: flex-start; gap: 14px; padding: 22px 24px 4px; }
.dlg-ic { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--brand-soft); color: var(--brand); }
.dlg-ic .ic { width: 20px; height: 20px; }
.dlg.danger .dlg-ic { background: var(--danger-soft); color: var(--danger-ink); }
.dlg.warn .dlg-ic { background: var(--warn-soft); color: var(--warn-ink); }
.dlg-h h2 { margin: 8px 0 0; font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.dlg-b { padding: 8px 24px 4px 78px; color: var(--ink-2); display: grid; gap: 12px; }
.dlg-b p { margin: 0; }
.dlg-b ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.dlg-f { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; padding: 18px 24px 22px; }
.confirm-name { font-weight: 700; color: var(--ink); user-select: all; }

/* ---------------------------------------------------------------- toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 80; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; max-width: min(560px, calc(100% - 32px));
  padding: 11px 16px; border-radius: 12px; background: #101828; color: #fff; font-weight: 500; box-shadow: var(--shadow-lg);
  animation: rise 0.18s ease-out;
}
.toast .ic { color: #32d583; }
.toast.err { background: #b42318; }
.toast.err .ic { color: #fff; }

/* ---------------------------------------------------------------- logs */
.logs { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; }
.roster { position: sticky; top: 82px; max-height: calc(100vh - 102px); display: flex; flex-direction: column; overflow: hidden; }
.roster-h { padding: 12px; border-bottom: 1px solid var(--line-soft); }
.roster-list { overflow-y: auto; padding: 6px; display: grid; gap: 1px; }
.roster-group { padding: 12px 10px 4px; font-size: 11.5px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: 0.06em; }
.roster-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--ink); position: relative; }
.roster-item:hover { background: var(--hover); text-decoration: none; }
.roster-item.on { background: var(--brand-soft); }
.roster-item.on::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--brand); }
.roster-item > span:nth-child(2) { min-width: 0; }
.roster-item b { display: block; font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.roster-item small { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.roster-item small.today { color: var(--ok-ink); font-weight: 500; }

.logs-main { display: grid; gap: 16px; min-width: 0; }
.logs-empty { padding: 64px 24px; text-align: center; color: var(--muted); }
.logs-empty .big { display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 16px; background: var(--brand-soft); color: var(--brand); }
.logs-empty .big .ic { width: 26px; height: 26px; }
.logs-empty b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }

.agent-h { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 18px 20px; }
.agent-h h2 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -0.01em; display: flex; align-items: center; gap: 8px; }
.agent-h .meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 3px; font-size: 13px; color: var(--muted); }
.agent-h .meta span { display: inline-flex; align-items: center; gap: 6px; }
.agent-h .tools { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.agent-h .search { width: 230px; }

.tag { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--sunk); color: var(--ink-2); border: 1px solid var(--line); }
.tag .ic { width: 12px; height: 12px; stroke-width: 2.5; }
.tag.ok { background: var(--ok-soft); color: var(--ok-ink); border-color: transparent; }
.tag.warn { background: var(--warn-soft); color: var(--warn-ink); border-color: transparent; }
.tag.danger { background: var(--danger-soft); color: var(--danger-ink); border-color: transparent; }
.tag.info { background: var(--info-soft); color: var(--info-ink); border-color: transparent; }

.day { overflow: hidden; }
.day-h { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 14px 20px; background: var(--sunk); border-bottom: 1px solid var(--line-soft); }
.day-h h3 { margin: 0; font-size: 15px; font-weight: 700; }
.day-h .date { color: var(--muted); font-size: 13px; }
.day-h .totals { margin-left: auto; display: flex; gap: 16px; font-size: 13px; color: var(--muted); }
.day-h .totals b { color: var(--ink); font-weight: 650; font-variant-numeric: tabular-nums; }
.sessions { display: flex; flex-wrap: wrap; gap: 6px 8px; padding: 10px 20px; border-bottom: 1px solid var(--line-soft); font-size: 12.5px; }
.sess { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; background: var(--sunk); border: 1px solid var(--line-soft); color: var(--ink-2); }
.sess .ic { width: 13px; height: 13px; }
.sess.in .ic { color: var(--ok-ink); }
.sess.out .ic { color: var(--muted); }
.sess.blocked { background: var(--danger-soft); border-color: transparent; color: var(--danger-ink); }

.acc-head, .acc-row {
  display: grid; align-items: center; gap: 16px;
  grid-template-columns: minmax(200px, 1.5fr) minmax(130px, 1fr) 96px 124px 132px 20px;
  padding: 0 20px;
}
.acc-head { height: 36px; font-size: 12px; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line-soft); }
.acc-head .r, .acc-row .r { text-align: right; }
.acc-row { width: 100%; min-height: 60px; padding-top: 10px; padding-bottom: 10px; border: 0; border-top: 1px solid var(--line-soft); background: none; text-align: left; color: var(--ink); font-size: 13.5px; }
.acc-head + .acc-row, .acc-list > .acc-row:first-child { border-top: 0; }
.acc-row:hover { background: var(--hover); text-decoration: none; }
.acc-row .chev { color: var(--faint); width: 15px; height: 15px; }
.acc-row:hover .chev { color: var(--link); }
.acct { display: flex; align-items: center; gap: 10px; min-width: 0; }
.acct > span:last-child { min-width: 0; }
.acct b { font-weight: 650; font-variant-numeric: tabular-nums; }
.acct small { display: block; color: var(--ink-2); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf { display: inline-grid; place-items: center; min-width: 44px; height: 24px; padding: 0 6px; border-radius: 6px; background: var(--brand); color: var(--on-brand); font-size: 11px; font-weight: 700; letter-spacing: 0.04em; }
.loan { color: var(--ink-2); font-size: 13px; }
.ticks { font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.ticks small { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.span { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }

.tl { list-style: none; margin: 0; padding: 0; position: relative; }
.tl::before { content: ''; position: absolute; left: 89px; top: 12px; bottom: 12px; width: 2px; background: var(--line); border-radius: 2px; }
.tl li { display: grid; grid-template-columns: 70px 22px minmax(0, 1fr); gap: 0 10px; align-items: start; padding: 6px 0; position: relative; }
.tl time { font-family: var(--mono); font-size: 11.5px; color: var(--muted); text-align: right; padding-top: 3px; white-space: nowrap; }
.tl .dotc { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line); color: var(--muted); position: relative; z-index: 1; }
.tl .dotc .ic { width: 12px; height: 12px; stroke-width: 3; }
.tl .k-checked .dotc { background: var(--ok); border-color: var(--ok); color: #fff; }
.tl .k-unchecked .dotc { border-color: var(--faint); }
.tl .k-answered .dotc { background: var(--info-soft); border-color: transparent; color: var(--info-ink); }
.tl .k-reset .dotc { background: var(--warn-soft); border-color: transparent; color: var(--warn-ink); }
.tl .k-completed .dotc { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.tl .txt { font-size: 13.5px; color: var(--ink); padding-top: 1px; }
.tl .txt b { font-weight: 650; }
.tl .k-unchecked .txt { color: var(--muted); }
.tl s { text-decoration-color: var(--faint); }
.tl .step { display: block; font-size: 12px; color: var(--muted); text-decoration: none; }
.tl .k-completed .txt { font-weight: 650; }
.tl .k-submitted .dotc { background: var(--ok); border-color: var(--ok); color: #fff; }
.tl .k-submitted .txt { font-weight: 650; }

/* ---------------------------------------------------------------- checklist page */
.sheet { display: grid; gap: 16px; min-width: 0; }
.back { display: inline-flex; align-items: center; gap: 6px; justify-self: start; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.back:hover { color: var(--ink); text-decoration: none; }
.sheet-h { overflow: hidden; }
.sheet-top { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; padding: 20px 22px 0; }
.sheet-id { min-width: 0; flex: 1; }
.sheet-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sheet-title h1 { margin: 0; font-size: 24px; line-height: 1.2; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.cust-name { font-size: 17px; font-weight: 600; color: var(--ink-2); }
.sheet-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-top: 10px; font-size: 13px; color: var(--ink-2); }
.sheet-meta > span { display: inline-flex; align-items: center; gap: 7px; }
.sheet-meta .ic { width: 14px; height: 14px; color: var(--muted); }
.av.xs { width: 22px; height: 22px; font-size: 9.5px; }
.loan-chip { display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 10px; white-space: nowrap; border-radius: 999px; background: var(--sunk); border: 1px solid var(--line); font-weight: 600; }
.loan-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.loan-chip.t-new i { background: #2563eb; }
.loan-chip.t-refi i { background: #059669; }
.loan-chip.t-reloan i { background: #7c3aed; }
.sheet-tools { display: flex; gap: 8px; }
.sheet-status { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 14px 22px 18px; }
.tag.big { height: 28px; padding: 0 12px; font-size: 13px; }
.tag.big .ic { width: 14px; height: 14px; }
.status-sub { font-size: 13px; color: var(--muted); }
.sheet-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line-soft); }
.sheet-kpis > div { padding: 16px 22px; min-width: 0; }
.sheet-kpis > div + div { border-left: 1px solid var(--line-soft); }
.sheet-kpis .kpi-value { font-size: 26px; }
.sheet-note { display: flex; align-items: center; gap: 8px; margin: 0; padding: 10px 22px; border-top: 1px solid var(--line-soft); background: var(--warn-soft); color: var(--warn-ink); font-size: 13px; font-weight: 500; }
.sheet-note.plain { background: var(--sunk); color: var(--muted); border-top: 0; border-bottom: 1px solid var(--line-soft); padding: 10px 20px; }

.sheet-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; font-size: 13px; }
.sheet-bar .sp { flex: 1; }
.legend-row { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: 12.5px; }
.legend-row > span { display: inline-flex; align-items: center; gap: 7px; }
.legend-row .bx { width: 16px; height: 16px; margin: 0; }

.phase { overflow: hidden; }
.phase-h { display: flex; justify-content: space-between; gap: 12px; padding: 10px 20px; background: var(--sunk); border-bottom: 1px solid var(--line-soft); font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.phase-h span:last-child { letter-spacing: 0; text-transform: none; font-weight: 600; font-size: 12.5px; }
.phase-done { display: none; align-items: center; gap: 8px; margin: 0; padding: 14px 20px; color: var(--ok-ink); font-weight: 600; font-size: 13.5px; }

.st { padding: 14px 20px 14px; }
.st + .st { border-top: 1px solid var(--line-soft); }
.st-h { display: grid; grid-template-columns: 26px 24px minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.st-ic { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); color: #fff; }
.st-ic .ic { width: 13px; height: 13px; stroke-width: 3; }
.st.done .st-ic { background: var(--ok); border-color: var(--ok); }
.st.part .st-ic { background: var(--warn-soft); border-color: var(--warn); color: var(--warn-ink); }
.st.stop .st-ic { background: var(--danger); border-color: var(--danger); }
.st.todo .st-ic { border-color: var(--faint); }
.st-n { font-weight: 700; font-size: 13px; color: var(--faint); font-variant-numeric: tabular-nums; text-align: right; }
.st-t { margin: 0; font-size: 15px; font-weight: 650; letter-spacing: -0.005em; }
.st-code { display: inline-block; margin-left: 4px; padding: 1px 6px; border-radius: 5px; background: var(--brand-soft); color: var(--brand); font-size: 11px; font-weight: 700; vertical-align: 2px; }

.st-items { list-style: none; margin: 8px 0 0; padding: 0 0 0 60px; display: grid; gap: 2px; }
.st-items.flat { padding: 8px 12px 14px; }
.it { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: start; gap: 12px; padding: 6px 10px; border-radius: 8px; font-size: 13.5px; }
.it.sub { margin-left: 22px; }
.it:hover { background: var(--hover); }
.it.off { background: color-mix(in srgb, var(--danger-soft) 70%, transparent); }
.it-t { min-width: 0; color: var(--ink); line-height: 1.45; }
.it-t small { display: block; font-size: 12px; color: var(--muted); }
.it.off .it-t { color: var(--ink-2); }
.it time, .it .ans, .it .miss { font-size: 12.5px; white-space: nowrap; padding-top: 1px; font-variant-numeric: tabular-nums; }
.it time { color: var(--muted); }
.it .miss { color: var(--danger-ink); font-weight: 600; }
.it .ans { color: var(--muted); }
.it .ans b { color: var(--info-ink); font-weight: 650; }
.it .ans.stop b { color: var(--danger-ink); }
.bx { display: grid; place-items: center; width: 18px; height: 18px; margin-top: 1px; border-radius: 5px; border: 2px solid var(--faint); background: var(--surface); color: #fff; }
.bx .ic { width: 12px; height: 12px; stroke-width: 3.2; }
.bx.on { background: var(--ok); border-color: var(--ok); }
.it.off .bx { border-color: var(--danger); }
.bx.q { border-radius: 50%; border-color: var(--info-ink); color: var(--info-ink); background: var(--info-soft); font-size: 11px; font-weight: 800; line-height: 1; }
.it.q.off .bx.q { border-color: var(--danger); background: var(--surface); }
.must { display: inline-block; margin-right: 6px; padding: 0 5px; border-radius: 4px; background: var(--danger-soft); color: var(--danger-ink); font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; vertical-align: 1px; }
.it-note { display: flex; align-items: center; gap: 8px; margin: 2px 0 2px 32px; padding: 6px 10px; border-radius: 8px; font-size: 13px; font-weight: 600; }
.it-note.stop { background: var(--danger-soft); color: var(--danger-ink); }
.it-note .ic { width: 14px; height: 14px; }

/* "Only what is missing": hide finished steps and ticked boxes */
.sheet.missing .st.done, .sheet.missing .it.on, .sheet.missing .phase.other { display: none; }
.sheet.missing .phase.all-done .phase-done { display: flex; }
.sheet.missing .phase.all-done .st-items { display: none; }

.tl-card summary { display: flex; align-items: center; gap: 8px; padding: 14px 20px; cursor: pointer; list-style: none; font-size: 14px; font-weight: 650; user-select: none; }
.tl-card summary::-webkit-details-marker { display: none; }
.tl-card summary .ic { color: var(--muted); transition: transform 0.15s; }
.tl-card[open] summary .ic { transform: rotate(90deg); }
.tl-wrap { padding: 4px 20px 18px; border-top: 1px solid var(--line-soft); background: var(--sunk); }

.skeleton { height: 14px; border-radius: 6px; background: linear-gradient(90deg, var(--line-soft), var(--hover), var(--line-soft)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1000px) {
  .shift { grid-template-columns: 1fr 1fr; }
  .shift-actions { grid-column: 1 / -1; flex-direction: row; border-left: 0 !important; border-top: 1px solid var(--line-soft); }
  .shift-actions .btn { width: auto; flex: 1; }
  .logs { grid-template-columns: 1fr; }
  .roster { position: static; max-height: 300px; }
  .acc-head { display: none; }
  .acc-row { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: 'acct ticks chev' 'loan status chev' 'span span chev'; gap: 6px 14px; }
  .acc-row > :nth-child(1) { grid-area: acct; }
  .acc-row > :nth-child(2) { grid-area: loan; }
  .acc-row > :nth-child(3) { grid-area: ticks; }
  .acc-row > :nth-child(4) { grid-area: status; justify-self: end; }
  .acc-row > :nth-child(5) { grid-area: span; text-align: left; }
  .acc-row > :nth-child(6) { grid-area: chev; }
}
@media (max-width: 760px) {
  .top-in { height: auto; padding: 10px 16px; flex-wrap: wrap; gap: 10px 16px; }
  .nav { order: 3; width: 100%; margin: 0 -12px; }
  .nav a { height: 40px; }
  .top-right { gap: 10px; }
  .me span { display: none; }
  .main { padding: 20px 16px 56px; }
  .ph h1 { font-size: 21px; }
  .shift { grid-template-columns: 1fr; }
  .shift > div + div { border-left: 0; border-top: 1px solid var(--line-soft); }
  .card-h .search, .agent-h .search { width: 100%; }
  .agent-h .tools { margin-left: 0; width: 100%; }
  .agent-h .tools .search { flex: 1; }
  .legend { display: none; }
  .dlg-b { padding-left: 24px; }
  .tl::before { left: 81px; }
  .tl li { grid-template-columns: 62px 22px minmax(0, 1fr); }
  .day-h .totals { margin-left: 0; width: 100%; }
  .sheet-top, .sheet-status { padding-left: 16px; padding-right: 16px; }
  .sheet-kpis { grid-template-columns: 1fr; }
  .sheet-kpis > div { padding: 12px 16px; }
  .sheet-kpis > div + div { border-left: 0; border-top: 1px solid var(--line-soft); }
  .st { padding: 12px 12px; }
  .st-h { grid-template-columns: 24px 20px minmax(0, 1fr); }
  .st-h > .tag { grid-column: 3; justify-self: start; }
  .st-items { padding-left: 0; }
  .it { grid-template-columns: 20px minmax(0, 1fr); }
  .it > :last-child:not(.it-t) { grid-column: 2; }
  .it.sub { margin-left: 12px; }
  .it-note { margin-left: 0; }
  .phase-h { padding: 10px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
