:root {
  color-scheme: light;
  --page: #f6f6f3;
  --surface: #fcfcfb;
  --surface-2: #f1f0ec;
  --surface-3: #e8e7e1;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);
  --accent: #2a78d6;
  --accent-ink: #1c5cab;
  --accent-wash: #e6f0fc;
  --good: #0ca30c;
  --good-ink: #006300;
  --warning: #fab219;
  --warning-ink: #8a5a00;
  --serious: #ec835a;
  --critical: #d03b3b;
  --critical-wash: #fdecec;
  --warning-wash: #fff5dd;
  --good-wash: #e7f6e7;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #6250d6; --s8: #e34948;
  --st-pending: #a9a79f;
  --st-progress: #2a78d6;
  --st-review: #6250d6;
  --st-blocked: #d03b3b;
  --st-done: #0ca30c;
  --seq-1: #cde2fb; --seq-2: #86b6ef; --seq-3: #3987e5; --seq-4: #1c5cab; --seq-5: #0d366b;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.04);
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #0d0d0d; --surface: #1a1a19; --surface-2: #232321; --surface-3: #2c2c2a;
    --ink: #f0efec; --ink-2: #c3c2b7; --muted: #898781; --grid: #2c2c2a; --axis: #383835;
    --border: rgba(255,255,255,0.10);
    --accent: #3987e5; --accent-ink: #86b6ef; --accent-wash: #16263a;
    --good-ink: #0ca30c; --warning-ink: #fab219; --critical-wash: #3a1b1b; --warning-wash: #3a2f12; --good-wash: #15301a;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
    --st-pending: #6f6d66; --st-progress: #3987e5; --st-review: #9085e9;
    --seq-1: #184f95; --seq-2: #256abf; --seq-3: #3987e5; --seq-4: #86b6ef; --seq-5: #cde2fb;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d; --surface: #1a1a19; --surface-2: #232321; --surface-3: #2c2c2a;
  --ink: #f0efec; --ink-2: #c3c2b7; --muted: #898781; --grid: #2c2c2a; --axis: #383835;
  --border: rgba(255,255,255,0.10);
  --accent: #3987e5; --accent-ink: #86b6ef; --accent-wash: #16263a;
  --good-ink: #0ca30c; --warning-ink: #fab219; --critical-wash: #3a1b1b; --warning-wash: #3a2f12; --good-wash: #15301a;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
  --st-pending: #6f6d66; --st-progress: #3987e5; --st-review: #9085e9;
  --seq-1: #184f95; --seq-2: #256abf; --seq-3: #3987e5; --seq-4: #86b6ef; --seq-5: #cde2fb;
  --shadow: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--page); color: var(--ink); font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
h1 { font-size: 22px; font-weight: 650; letter-spacing: -0.01em; }
h2 { font-size: 15px; font-weight: 650; }
h3 { font-size: 13px; font-weight: 650; }
.boot { display: grid; place-items: center; height: 100vh; color: var(--muted); }
.muted { color: var(--muted); }
.ink2 { color: var(--ink-2); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.num { font-variant-numeric: tabular-nums; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--border); padding: 16px 12px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; font-weight: 700; font-size: 16px; letter-spacing: -0.01em; }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; }
.nav-section { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 14px 10px 4px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--ink-2); font-weight: 500; }
.nav a:hover { background: var(--surface-2); text-decoration: none; }
.nav a.active { background: var(--accent-wash); color: var(--accent-ink); }
.nav .count { margin-left: auto; background: var(--critical); color: #fff; border-radius: 999px; font-size: 11px; padding: 0 7px; font-weight: 600; }
.sidebar-foot { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid var(--border); }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--page) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); padding: 10px 24px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.content { padding: 24px; max-width: 1480px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--ink-2); }

/* status bar */
.statusbar { display: flex; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 3px; }
.statusbar button { border: 0; background: transparent; padding: 6px 12px; border-radius: 999px; cursor: pointer; color: var(--ink-2); font-weight: 500; white-space: nowrap; }
.statusbar button:hover { background: var(--surface-2); }
.statusbar button.on { background: var(--accent); color: #fff; }
.statusbar button.on.pto { background: var(--good); }
.statusbar button:disabled { cursor: not-allowed; opacity: .55; }
.focus-note { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 7px 14px; min-width: 220px; flex: 1; max-width: 380px; }
.leave-lock { background: var(--good-wash); color: var(--good-ink); padding: 7px 14px; border-radius: 999px; font-weight: 600; }
.timer-chip { display: flex; align-items: center; gap: 8px; background: var(--critical-wash); color: var(--critical); border-radius: 999px; padding: 5px 6px 5px 12px; font-weight: 600; }
.timer-chip button { border: 0; background: var(--critical); color: #fff; border-radius: 999px; padding: 3px 10px; cursor: pointer; }
.icon-btn { position: relative; border: 1px solid var(--border); background: var(--surface); width: 36px; height: 36px; border-radius: 10px; cursor: pointer; display: grid; place-items: center; }
.icon-btn .dot { position: absolute; top: -4px; right: -4px; background: var(--critical); color: #fff; border-radius: 999px; font-size: 10px; min-width: 18px; height: 18px; display: grid; place-items: center; font-weight: 700; padding: 0 4px; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.live.on::before { background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 25%, transparent); }

/* ---------- cards & grid ---------- */
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-main-side { grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head .sub { color: var(--muted); font-size: 12px; font-weight: 400; }
.empty { color: var(--muted); padding: 14px 4px; text-align: center; font-size: 13px; }

.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.kpi .label { color: var(--ink-2); font-size: 12px; font-weight: 500; }
.kpi .value { font-size: 30px; font-weight: 650; letter-spacing: -0.02em; margin-top: 2px; }
.kpi .hint { font-size: 12px; color: var(--muted); }
.kpi.alert .value { color: var(--critical); }

/* ---------- controls ---------- */
.btn { border: 1px solid var(--border); background: var(--surface); padding: 7px 12px; border-radius: 8px; cursor: pointer; font-weight: 550; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { color: var(--critical); }
.btn.good { background: var(--good); border-color: var(--good); color: #fff; }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 5px 11px; border-radius: 7px; cursor: pointer; color: var(--ink-2); font-weight: 550; font-size: 13px; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], select, textarea {
  border: 1px solid var(--border); background: var(--surface); border-radius: 8px; padding: 7px 10px; min-width: 0; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 1px; }
textarea { width: 100%; resize: vertical; min-height: 64px; }
label.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ink-2); font-weight: 500; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--border); background: var(--surface); padding: 5px 11px; border-radius: 999px; cursor: pointer; font-size: 13px; font-weight: 500; }
.chip.on { background: var(--accent-wash); border-color: var(--accent); color: var(--accent-ink); }

/* ---------- pills & badges ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.pill .sw { width: 7px; height: 7px; border-radius: 50%; }
.pill.crit { background: var(--critical-wash); color: var(--critical); }
.pill.warn { background: var(--warning-wash); color: var(--warning-ink); }
.pill.ok { background: var(--good-wash); color: var(--good-ink); }
.pill.info { background: var(--accent-wash); color: var(--accent-ink); }
.badge-mode { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-weight: 600; font-size: 12.5px; background: var(--surface-2); }
.badge-mode.Office { background: var(--accent-wash); color: var(--accent-ink); }
.badge-mode.WFH { background: color-mix(in srgb, var(--s7) 14%, transparent); color: var(--s7); }
.badge-mode.Visit { background: color-mix(in srgb, var(--s2) 14%, transparent); color: var(--s2); }
.badge-mode.PTO { background: var(--good-wash); color: var(--good-ink); }
.badge-mode.none { color: var(--muted); }

/* ---------- lists ---------- */
.list { display: flex; flex-direction: column; }
.item { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--border); min-width: 0; }
.item:last-child { border-bottom: 0; }
.item .title { font-weight: 550; }
.item .meta { font-size: 12px; color: var(--muted); }
.time-col { width: 92px; flex: none; font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: 12.5px; font-weight: 600; }
.agenda-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); flex: none; }
.agenda-now { background: var(--accent-wash); border-radius: 8px; }
.urg { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.urg.overdue { background: var(--critical); }
.urg.soon { background: var(--warning); }
.urg.later { background: var(--good); }
.group-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 10px 0 2px; font-weight: 600; display: flex; align-items: center; gap: 6px; }

/* planner */
.planner { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.lane { background: var(--surface-2); border-radius: 10px; padding: 10px; min-height: 180px; display: flex; flex-direction: column; gap: 6px; transition: background .12s; }
.lane.over { background: var(--accent-wash); outline: 2px dashed var(--accent); outline-offset: -2px; }
.lane-head { display: flex; justify-content: space-between; align-items: center; font-weight: 650; font-size: 13px; padding: 0 2px 4px; }
.qcard { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; cursor: grab; display: flex; gap: 8px; align-items: flex-start; }
.qcard:active { cursor: grabbing; }
.qcard.dragging { opacity: .4; }
.qcard .title { font-weight: 550; font-size: 13px; }
.qcard .meta { font-size: 11.5px; color: var(--muted); }
.play { border: 0; background: var(--surface-2); width: 26px; height: 26px; border-radius: 50%; cursor: pointer; flex: none; font-size: 11px; display: grid; place-items: center; }
.play:hover { background: var(--accent-wash); }
.play.on { background: var(--critical); color: #fff; }
.check { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--axis); background: transparent; cursor: pointer; flex: none; margin-top: 1px; display: grid; place-items: center; padding: 0; font-size: 11px; color: #fff; }
.check:hover { border-color: var(--good); }
.check.done { background: var(--good); border-color: var(--good); }

/* quick add */
.quick { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.quick input[type=text] { flex: 1; min-width: 200px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; background: var(--surface); position: sticky; top: 0; }
tbody tr:hover { background: var(--surface-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* availability board */
.avail { border-collapse: separate; border-spacing: 3px; }
.avail th, .avail td { border: 0; padding: 0; }
.avail th { background: transparent; text-align: center; font-size: 11px; padding: 4px 0; position: static; text-transform: none; letter-spacing: 0; }
.avail th.today { color: var(--accent-ink); }
.avail td.name { padding-right: 12px; white-space: nowrap; font-weight: 550; min-width: 170px; }
.avail td.cell { width: 44px; height: 36px; text-align: center; border-radius: 6px; background: var(--surface-2); font-size: 16px; cursor: default; }
.avail td.cell.weekend { background: transparent; opacity: .5; }
.avail td.cell.holiday { background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 4px, var(--surface-3) 4px, var(--surface-3) 8px); }
.avail td.cell.today { outline: 2px solid var(--accent); outline-offset: -2px; }
.avail td.cell.m-Office { background: var(--accent-wash); }
.avail td.cell.m-WFH { background: color-mix(in srgb, var(--s7) 14%, transparent); }
.avail td.cell.m-Visit { background: color-mix(in srgb, var(--s2) 16%, transparent); }
.avail td.cell.m-PTO { background: var(--good-wash); }
.avail td.cell.m-pending { background: var(--warning-wash); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* roster */
.roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.person { border: 1px solid var(--border); border-radius: 12px; padding: 14px; background: var(--surface); display: flex; flex-direction: column; gap: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; flex: none; font-size: 13px; }
.now-status { font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.now-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.now-status.available::before { background: var(--good); }
.now-status.meeting::before { background: var(--s7); }
.now-status.visit::before { background: var(--s2); }
.now-status.leave::before { background: var(--muted); }
.daybar { position: relative; height: 18px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.daybar .ev { position: absolute; top: 0; bottom: 0; border-radius: 3px; }
.daybar .ev.meeting { background: color-mix(in srgb, var(--s7) 55%, transparent); }
.daybar .ev.visit { background: color-mix(in srgb, var(--s2) 60%, transparent); }
.daybar .nowline { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--critical); }
.daybar-axis { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }

/* gauges & heatmap */
.gauge { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; position: relative; }
.gauge > i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; }
.gauge .tick { position: absolute; top: -2px; bottom: -2px; width: 1px; background: var(--axis); }
.band-under { background: var(--seq-2); }
.band-balanced { background: var(--good); }
.band-full { background: var(--warning); }
.band-burnout { background: var(--critical); }
.band-leave { background: var(--surface-3); }
.heat { border-collapse: separate; border-spacing: 3px; }
.heat td, .heat th { border: 0; padding: 0; background: transparent; }
.heat th { font-size: 11px; color: var(--muted); text-transform: none; letter-spacing: 0; padding: 2px 4px; text-align: center; position: static; }
.heat td.name { padding-right: 12px; white-space: nowrap; font-weight: 550; }
.heat td.hc { width: 76px; height: 34px; border-radius: 6px; text-align: center; font-weight: 650; font-size: 12.5px; font-variant-numeric: tabular-nums; cursor: default; }
.hc.band-under { background: var(--accent-wash); color: var(--accent-ink); }
.hc.band-balanced { background: var(--good-wash); color: var(--good-ink); }
.hc.band-full { background: var(--warning-wash); color: var(--warning-ink); }
.hc.band-burnout { background: var(--critical); color: #fff; }
.hc.band-leave { background: var(--surface-2); color: var(--muted); }

/* gantt */
.gantt-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.gantt-scroll { overflow: auto; border: 1px solid var(--border); border-radius: 10px; max-height: 620px; background: var(--surface); position: relative; }
.gantt svg { display: block; }
.gantt .lbl { font-size: 12px; fill: var(--ink); }
.gantt .lbl-group { font-size: 12px; font-weight: 700; fill: var(--ink); }
.gantt .lbl-sub { font-size: 10.5px; fill: var(--muted); }
.gantt .axis-txt { font-size: 10.5px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.gantt .bar { cursor: pointer; }
.gantt .bar.editable { cursor: grab; }
.gantt .bar:hover rect.body { filter: brightness(1.08); }
.gantt .crit-ring { fill: none; stroke: var(--critical); stroke-width: 2; }
.gantt .dep { fill: none; stroke: var(--axis); stroke-width: 1.4; }
.gantt .dep.crit { stroke: var(--critical); stroke-width: 2; }
.gantt .today-line { stroke: var(--critical); stroke-width: 1.5; stroke-dasharray: 3 3; }
.gantt .milestone { fill: var(--ink); stroke: var(--surface); stroke-width: 2; }
.gantt .milestone.crit { fill: var(--critical); }
.gantt-tip { position: fixed; z-index: 60; pointer-events: none; background: var(--ink); color: var(--surface); padding: 8px 10px; border-radius: 8px; font-size: 12px; max-width: 280px; box-shadow: 0 6px 20px rgba(0,0,0,.2); }
.gantt-tip b { display: block; margin-bottom: 2px; }

/* charts */
.chart-tip { position: fixed; z-index: 60; pointer-events: none; background: var(--ink); color: var(--surface); padding: 8px 10px; border-radius: 8px; font-size: 12px; box-shadow: 0 6px 20px rgba(0,0,0,.2); }
.chart svg text { font-size: 10.5px; fill: var(--muted); font-variant-numeric: tabular-nums; }

/* risk radar */
.risk { width: 44px; flex: none; text-align: center; font-weight: 700; font-size: 13px; border-radius: 8px; padding: 4px 0; font-variant-numeric: tabular-nums; }
.risk.r-high { background: var(--critical); color: #fff; }
.risk.r-mid { background: var(--warning-wash); color: var(--warning-ink); }
.risk.r-low { background: var(--surface-2); color: var(--ink-2); }
.alloc-row { padding: 10px 0; border-bottom: 1px solid var(--border); }
.alloc-row:last-child { border-bottom: 0; }

/* leave */
.cal { user-select: none; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-dow { text-align: center; font-size: 11px; color: var(--muted); padding: 4px 0; font-weight: 600; }
.cal-day { position: relative; aspect-ratio: 1.15; border-radius: 8px; border: 1px solid transparent; background: var(--surface-2); cursor: pointer; padding: 4px 5px; font-size: 12.5px; font-weight: 550; display: flex; flex-direction: column; justify-content: space-between; text-align: left; }
.cal-day:hover { border-color: var(--accent); }
.cal-day.out { opacity: .35; }
.cal-day.weekend { background: transparent; color: var(--muted); }
.cal-day.past { opacity: .45; cursor: not-allowed; }
.cal-day.holiday { background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 4px, var(--surface-3) 4px, var(--surface-3) 8px); }
.cal-day.today { border-color: var(--ink-2); }
.cal-day.sel { background: var(--accent); color: #fff; }
.cal-day.inrange { background: var(--accent-wash); color: var(--accent-ink); }
.cal-day .marks { display: flex; gap: 3px; flex-wrap: wrap; }
.mk { width: 6px; height: 6px; border-radius: 50%; }
.mk.mine { background: var(--good); }
.mk.team { background: var(--s2); }
.mk.ms { background: var(--critical); border-radius: 1px; transform: rotate(45deg); }
.mk.hol { background: var(--muted); }
.balance { font-size: 34px; font-weight: 650; letter-spacing: -0.02em; }
.clash { border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.clash.bad { background: var(--critical-wash); }
.clash.warn { background: var(--warning-wash); }
.clash.ok { background: var(--good-wash); color: var(--good-ink); }
.clash ul { margin: 4px 0 0; padding-left: 18px; }

/* ---------- project-management components ---------- */
.nav a.sub { padding-left: 30px; font-size: 13px; }
.nav-ic { width: 18px; text-align: center; flex: none; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); min-width: 0; }
.stat .label { color: var(--ink-2); font-size: 12px; font-weight: 500; }
.stat .value { font-size: 26px; font-weight: 650; letter-spacing: -0.02em; margin-top: 2px; }
.stat .hint { font-size: 12px; color: var(--muted); }
.stat.crit .value { color: var(--critical); }
.stat.warn .value { color: var(--warning-ink); }
.stats.compact .value { font-size: 22px; }
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.project-card { display: flex; flex-direction: column; gap: 12px; color: inherit; transition: border-color .12s, transform .12s; }
.project-card:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-1px); }
.avatars { display: flex; }
.avatars .avatar { margin-right: -6px; box-shadow: 0 0 0 2px var(--surface); }
.avatar { border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; color: #fff; flex: none; }
.avatar.empty { background: var(--surface-3); color: var(--muted); border: 1px dashed var(--axis); font-size: 12px; }
.feed { display: flex; flex-direction: column; max-height: 420px; overflow-y: auto; margin-top: 10px; }
.feed-item { display: flex; gap: 10px; padding: 10px 2px; border-top: 1px solid var(--border); align-items: flex-start; }
.update-form { display: flex; flex-direction: column; gap: 8px; }
.update-form textarea { min-height: 54px; }
.due { font-weight: 600; width: 52px; text-align: right; }
.due.overdue { color: var(--critical); }
.toolbar { margin-bottom: 12px; }
.hbar { height: 9px; border-radius: 0 4px 4px 0; }
.kv { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--ink-2); }
.neg { color: var(--critical); font-weight: 600; }
.pos { color: var(--good-ink); font-weight: 600; }
.effort { display: flex; align-items: center; gap: 6px; }
.effort .gauge { flex: 1; height: 6px; min-width: 40px; }
.effort .over { color: var(--critical); font-weight: 600; }
.effort-row { display: flex; align-items: flex-end; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.hint-box { background: var(--accent-wash); border-radius: 10px; padding: 10px 12px; }
.clash-box { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.btn.danger-fill { background: var(--critical); border-color: var(--critical); color: #fff; }
.timer-chip .rec { width: 8px; height: 8px; border-radius: 50%; background: var(--critical); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.timer-panel { background: var(--critical-wash); border-radius: 10px; padding: 12px; }
select.mini { padding: 3px 6px; font-size: 12px; }
table.sortable th { cursor: pointer; user-select: none; }
table.sortable th:hover { color: var(--ink); }
table.sortable tbody tr { cursor: pointer; }
.gantt .bar-txt { font-size: 10px; fill: #fff; font-weight: 600; pointer-events: none; }
.gantt .lbl-sub { font-size: 10.5px; fill: var(--muted); }

/* ---------- v4: icons & new components ---------- */
.ic { flex: none; vertical-align: -0.15em; }
.btn, .pill, .chip, .tag, .mode, .seg button, .tabs a, .nav a, .status-toggle button { gap: 6px; }
.pill, .tag { display: inline-flex; align-items: center; gap: 4px; }
.tabs a { display: inline-flex; align-items: center; }
.btn.icon-only { padding: 5px; }
.nav-ic { display: grid; place-items: center; width: 20px; color: var(--muted); }
.nav a.active .nav-ic { color: var(--accent-ink); }
.me-link { color: inherit; padding: 6px; border-radius: 8px; }
.me-link:hover, .me-link.active { background: var(--surface-2); text-decoration: none; }
.icon-btn .ic { color: var(--ink-2); }
.ok-ic { color: var(--good); }
.warn-ic { color: var(--warning-ink); }
.status-toggle { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; border: 1px solid var(--border); }
.status-toggle button { border: 0; background: transparent; padding: 7px 12px; border-radius: 8px; cursor: pointer; color: var(--ink-2); font-weight: 600; display: inline-flex; align-items: center; }
.status-toggle button.on { background: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.15); }
.status-toggle button.on.wfh { background: var(--s7); }
.mode { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.mode-Office { background: var(--accent-wash); color: var(--accent-ink); }
.mode-WFH { background: color-mix(in srgb, var(--s7) 14%, transparent); color: var(--s7); }
.mode-Visit { background: color-mix(in srgb, var(--s2) 14%, transparent); color: var(--s2); }
.mode-PTO { background: var(--good-wash); color: var(--good-ink); }
.banner { display: flex; align-items: center; gap: 8px; background: var(--accent-wash); color: var(--accent-ink); border-radius: 10px; padding: 10px 14px; margin-bottom: 16px; font-size: 13px; flex-wrap: wrap; }
.banner.ok { background: var(--good-wash); color: var(--good-ink); }
.banner.err { background: var(--critical-wash); color: var(--critical); }
.card.soft { background: var(--surface-2); box-shadow: none; padding: 12px; }
.section-label { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
/* task dialog */
.task-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(260px, 1fr); gap: 18px; }
.task-grid .side { background: var(--surface-2); border-radius: 12px; padding: 12px; }
.subs { display: flex; flex-direction: column; gap: 2px; }
.sub { display: flex; align-items: center; gap: 8px; padding: 5px 4px; border-radius: 6px; font-size: 13px; }
.sub:hover { background: var(--surface-2); }
.sub.done .grow { text-decoration: line-through; color: var(--muted); }
.ms-ic { color: var(--critical); display: inline-flex; }
.assignee-list { display: flex; flex-direction: column; gap: 4px; margin: 4px 0 6px; }
.assignee { display: flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 3px 6px; font-size: 12.5px; color: var(--ink); }
.assignee .x { margin-left: auto; border: 0; background: transparent; cursor: pointer; color: var(--muted); display: grid; place-items: center; }
.assignee.done { border-color: color-mix(in srgb, var(--good) 50%, transparent); }
.avatar.is-done { box-shadow: 0 0 0 2px var(--good) !important; }
.avatar.more { background: var(--surface-3); color: var(--ink-2); font-size: 10px; }
.check .ic { stroke-width: 3; }
.play .ic { fill: currentColor; stroke-width: 0; }
.play.on .ic { fill: #fff; }
/* collapsible widgets */
.widget .card-head { margin-bottom: 10px; }
.widget.collapsed .card-head { margin-bottom: 0; }
.widget.collapsed { padding-top: 10px; padding-bottom: 10px; }
.ann-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.ann-mini { display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--border); border-left: 3px solid var(--axis); border-radius: 10px; padding: 10px 12px; color: inherit; background: var(--surface); }
.ann-mini:hover { text-decoration: none; border-color: var(--accent); }
.ann-mini.prio-urgent, .ann.prio-urgent { border-left-color: var(--critical); }
.ann-mini.prio-important, .ann.prio-important { border-left-color: var(--warning); }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ann { border-left: 3px solid var(--border); }
.ann.pinned { background: color-mix(in srgb, var(--accent-wash) 40%, var(--surface)); }
.ann-body { margin-top: 10px; line-height: 1.55; color: var(--ink); }
.act-ic { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--ink-2); }
.act-status { background: var(--accent-wash); color: var(--accent-ink); }
.act-milestone { background: var(--critical-wash); color: var(--critical); }
.act-announcement { background: var(--warning-wash); color: var(--warning-ink); }
.act-update { background: color-mix(in srgb, var(--s7) 14%, transparent); color: var(--s7); }
.act-team { background: var(--good-wash); color: var(--good-ink); }
.timeline-feed { display: flex; flex-direction: column; }
.tl-item { display: flex; gap: 10px; padding: 9px 2px; border-bottom: 1px solid var(--border); }
.tl-item:last-child { border-bottom: 0; }
.member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.member { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 10px; padding: 8px; }
.team-row { padding: 4px; border-radius: 8px; background: var(--surface); }
/* leave */
.balance-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 16px; }
.balance-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow); }
.big-num { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.chip .dot { margin-right: 2px; }
/* settings */
.settings-table td { padding: 6px 8px; }
.settings-table input[type=text] { width: 100%; min-width: 120px; padding: 5px 8px; }
.settings-table select { padding: 5px 6px; }
/* HR: per-person leave balances */
.lb-table th.num, .lb-table td.num { text-align: right; white-space: nowrap; }
.lb-cell { position: relative; }
.lb-avail { font-size: 16px; font-weight: 650; }
.lb-avail.warn { color: var(--warning-ink); }
.lb-avail.crit { color: var(--critical); }
.lb-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-left: 5px; vertical-align: middle; }
.lb-dot.static { margin: 0 2px; }
.swatch-btn { width: 16px; height: 16px; border-radius: 50%; border: 0; cursor: pointer; flex: none; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; }
.vars { margin: 6px 0 8px; padding-left: 18px; }
.vars li { margin: 2px 0; }
code { font-family: ui-monospace, Consolas, monospace; font-size: 12px; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.switch { position: relative; display: inline-block; width: 34px; height: 20px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--surface-3); border-radius: 999px; cursor: pointer; transition: background .15s; }
.switch span::before { content: ""; position: absolute; width: 14px; height: 14px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::before { transform: translateX(14px); }
.switch input:disabled + span { opacity: .5; cursor: not-allowed; }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
/* calendar events in My day */
.item.event { gap: 10px; }
.ev-bar { width: 3px; align-self: stretch; border-radius: 2px; background: var(--s7); flex: none; }
.item.event.live-ev { background: var(--accent-wash); border-radius: 8px; }
.item.event.live-ev .ev-bar { background: var(--accent); }
.item.event.past { opacity: .55; }
/* free slot cells */
.free-heat td.fc.slot { cursor: pointer; }
.free-heat td.fc.slot:hover, .free-heat td.fc.slot:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
@media (max-width: 900px) { .task-grid { grid-template-columns: 1fr; } }

/* tags, buckets, plans, templates */
.tagchip { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 550; color: var(--ink-2); background: var(--surface-2); border-radius: 999px; padding: 1px 8px 1px 6px; white-space: nowrap; }
.tagchip i { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.tagchip.big { font-size: 12.5px; padding: 3px 6px 3px 6px; gap: 6px; }
.tagchip.big input { border: 0; background: transparent; padding: 0; width: 110px; font-size: 12.5px; }
.tagchip .swatch { width: 12px; height: 12px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; flex: none; }
.tagchip .x { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 0 2px; font-size: 11px; }
.tagchip .x:hover { color: var(--critical); }
.chip.tagpick { display: inline-flex; align-items: center; gap: 6px; }
.chip.tagpick i { width: 8px; height: 8px; border-radius: 50%; }
.chip:disabled { cursor: default; opacity: .8; }
.tag-new { width: 110px; padding: 4px 9px !important; border-radius: 999px !important; font-size: 12.5px; }
.tag.planned { background: var(--accent-wash); color: var(--accent-ink); }
.kcard.is-done .title { color: var(--muted); }
.col-tools { display: none; gap: 0; }
.col:hover .col-tools, .col:focus-within .col-tools { display: inline-flex; }
.col-head > .ellipsis { flex: 1; min-width: 0; }
.col-head .tiny { white-space: nowrap; }
.col-tools .btn { padding: 0 4px; font-size: 11px; }
.col-new { display: flex; flex-direction: column; gap: 8px; border: 2px dashed var(--axis); background: transparent; min-height: 120px; }
.lane-empty { color: var(--muted); font-size: 12px; text-align: center; padding: 22px 0; border: 1px dashed var(--axis); border-radius: 8px; }
.qcard.is-done .title a { text-decoration: line-through; opacity: .6; }
.item[draggable=true] { cursor: grab; }
.item.planned { opacity: .7; }
.unplan-zone.over { outline: 2px dashed var(--accent); outline-offset: 2px; }
.plans-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.plan-card { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; background: var(--surface); }
.plan-card.empty-plan { background: var(--surface-2); }
.plan-line { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink); }
.plan-line:hover { text-decoration: none; color: var(--accent-ink); }
.strike { text-decoration: line-through; color: var(--muted); }
.plan-update { background: var(--surface-2); border-radius: 6px; padding: 5px 7px; }
.tpl-card { display: flex; flex-direction: column; gap: 10px; }
.bucket-chain { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 11.5px; }
.bucket-chain span { background: var(--accent-wash); color: var(--accent-ink); border-radius: 6px; padding: 1px 7px; font-weight: 600; }
.bucket-chain i { color: var(--muted); font-style: normal; }
.tpl-table td { padding: 5px 6px; }
.tpl-table input[type=text], .tpl-table select { width: 100%; padding: 5px 7px; }
.tpl-table input[data-k="title"] { min-width: 260px; }
.numin { width: 64px; padding: 5px 6px !important; }
.mini-tag { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--border); background: transparent; border-radius: 999px; padding: 0 6px; font-size: 10.5px; cursor: pointer; color: var(--muted); }
.mini-tag i { width: 6px; height: 6px; border-radius: 50%; }
.mini-tag.on { background: var(--surface-2); color: var(--ink); border-color: var(--axis); font-weight: 600; }
.mini-gantt { position: relative; height: 10px; background: var(--surface-2); border-radius: 4px; }
.mini-gantt i { position: absolute; top: 0; bottom: 0; background: var(--accent); border-radius: 4px; }

/* kanban */
.board { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.col { background: var(--surface-2); border-radius: 12px; padding: 8px; display: flex; flex-direction: column; gap: 8px; min-height: 240px; }
.col-head { display: flex; align-items: center; gap: 8px; padding: 4px 4px 2px; font-weight: 650; font-size: 13px; }
.col-head .sw { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.col-head .tiny { margin-left: auto; }
.col-add { padding: 0 6px; font-size: 15px; line-height: 1.4; }
.col-body { display: flex; flex-direction: column; gap: 8px; min-height: 60px; border-radius: 8px; transition: background .12s; flex: 1; }
.col-body.over { background: var(--accent-wash); outline: 2px dashed var(--accent); outline-offset: 2px; }
.col-empty { color: var(--muted); font-size: 12px; text-align: center; padding: 18px 0; border: 1px dashed var(--axis); border-radius: 8px; }
.col-quick input { width: 100%; background: transparent; border: 1px dashed transparent; }
.col-quick input:hover, .col-quick input:focus { background: var(--surface); border-color: var(--border); }
.kcard { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--axis); border-radius: 9px; padding: 9px 10px; display: flex; flex-direction: column; gap: 7px; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.kcard[draggable=true] { cursor: grab; }
.kcard:hover { border-color: var(--accent); border-left-color: inherit; }
.kcard.dragging { opacity: .4; }
.kcard .title { font-weight: 600; font-size: 13px; line-height: 1.35; }
.kcard.prio-critical { border-left-color: var(--critical); }
.kcard.prio-high { border-left-color: var(--serious); }
.kcard.prio-medium { border-left-color: var(--seq-3); }
.kcard.prio-low { border-left-color: var(--axis); }
.kdel { border: 0; background: transparent; color: var(--muted); cursor: pointer; opacity: 0; padding: 0 2px; font-size: 12px; }
.kcard:hover .kdel { opacity: 1; }
.kdel:hover { color: var(--critical); }
.tag { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-weight: 550; white-space: nowrap; }
.tag.late { background: var(--critical-wash); color: var(--critical); }
.hours-chip { display: inline-flex; align-items: center; gap: 3px; border: 1px dashed var(--border); cursor: pointer; font: inherit; font-size: 11px; font-weight: 550; }
.hours-chip:hover { border-color: var(--accent); color: var(--accent); }
.hours-chip.set { border-style: solid; border-color: var(--accent); color: var(--accent-ink); background: var(--accent-wash); }

/* who's free */
.find-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.find-card { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--surface); }
.find-card.fits { border-color: color-mix(in srgb, var(--good) 55%, transparent); }
.free-heat td.fc { width: 40px; height: 32px; border-radius: 6px; text-align: center; font-size: 11.5px; font-weight: 650; font-variant-numeric: tabular-nums; cursor: default; }
.free-heat th.today { color: var(--accent-ink); }
.free-heat td.fc.today { outline: 2px solid var(--ink-2); outline-offset: -2px; }
.free-heat td.team-row { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 10px 0 2px; }
.fh-4, .free-heat td.fh-4 { background: var(--seq-4); color: #fff; }
.fh-3, .free-heat td.fh-3 { background: var(--seq-3); color: #fff; }
.fh-2, .free-heat td.fh-2 { background: var(--seq-2); color: var(--ink); }
.fh-0, .free-heat td.fh-0 { background: var(--surface-3); color: var(--muted); }
.fh-over, .free-heat td.fh-over { background: var(--critical); color: #fff; }
.fh-leave, .free-heat td.fh-leave { background: var(--good-wash); }
.fh-off, .free-heat td.fh-off { background: repeating-linear-gradient(45deg, transparent, transparent 3px, var(--surface-2) 3px, var(--surface-2) 6px); }
.legend .sw.fh-4, .legend .sw.fh-3, .legend .sw.fh-2, .legend .sw.fh-0, .legend .sw.fh-over, .legend .sw.fh-off { display: inline-block; }
@media (prefers-color-scheme: dark) { :root:where(:not([data-theme="light"])) .fh-4 { color: #0b0b0b; } }
:root[data-theme="dark"] .fh-4 { color: #0b0b0b; }
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }

@media (max-width: 1100px) { .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 820px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .hide-sm { display: none; } }

/* tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tabs a { padding: 8px 14px; color: var(--ink-2); font-weight: 550; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { text-decoration: none; color: var(--ink); }
.tabs a.on { color: var(--accent-ink); border-bottom-color: var(--accent); }

/* popover / modal / toast */
.popover { position: absolute; right: 24px; top: 56px; width: 380px; max-height: 70vh; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.18); z-index: 40; padding: 8px; }
.notif { padding: 10px; border-radius: 8px; display: block; color: var(--ink); }
.notif:hover { background: var(--surface-2); text-decoration: none; }
.notif.unread { background: var(--accent-wash); }
.notif .t { font-weight: 600; font-size: 13px; }
.notif .b { font-size: 12.5px; color: var(--ink-2); }
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 50; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--surface); border-radius: 14px; width: min(560px, 100%); max-height: 90vh; overflow-y: auto; padding: 20px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal h2 { margin-bottom: 14px; font-size: 17px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
#toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 70; }
.toast { background: var(--ink); color: var(--surface); padding: 10px 14px; border-radius: 10px; box-shadow: 0 6px 24px rgba(0,0,0,.2); max-width: 360px; font-size: 13px; animation: tin .18s ease-out; }
.toast.err { background: var(--critical); color: #fff; }
@keyframes tin { from { transform: translateY(8px); opacity: 0; } }

/* login */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login-hero { background: linear-gradient(150deg, #0d366b, #2a78d6 70%, #6da7ec); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.login-hero h1 { font-size: 40px; letter-spacing: -0.03em; }
.login-hero p { color: rgba(255,255,255,.85); max-width: 440px; font-size: 15px; }
.login-panel { display: grid; place-items: center; padding: 32px; }
.login-card { width: min(420px, 100%); display: flex; flex-direction: column; gap: 14px; }
.ms-btn { justify-content: center; gap: 10px; padding: 10px; font-weight: 600; text-decoration: none; }
.demo-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.demo { text-align: left; border: 1px solid var(--border); background: var(--surface); border-radius: 10px; padding: 8px 10px; cursor: pointer; }
.demo:hover { border-color: var(--accent); }
.demo .r { font-size: 11px; color: var(--muted); }

@media (max-width: 1100px) {
  .g-main-side, .g3 { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; padding: 8px; }
  .sidebar .nav-section, .sidebar-foot { display: none; }
  .brand { padding: 4px 8px; }
  .g2, .planner, .form-grid { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content, .topbar { padding-left: 16px; padding-right: 16px; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-hero { padding: 28px 16px; }
  .popover { right: 8px; left: 8px; width: auto; }
}
