@font-face { font-family: "Roboto"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/roboto-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/roboto-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/roboto-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Open Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/open-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Open Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/open-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "DM Serif Display"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/dm-serif-display-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "DM Serif Display"; font-style: italic; font-weight: 400; font-display: swap; src: url("fonts/dm-serif-display-latin-400-italic.woff2") format("woff2"); }
:root {
  /* StatSoft AI Brand Manual 2026 */
  --indigo: #2E2BB4;
  --magenta: #EC04C0;
  --teal: #048EAF;
  --slate: #4B5E78;
  --lightblue: #D4EDF4;
  --paper: #F8F8F7;
  --surface: #FFFFFF;
  --surface-2: #F4F5F9;
  --ink: #1D1F3F;
  --muted: #4B5E78;
  --faint: #8893A6;
  --line: #E2E4EC;
  --line-strong: #C9CDDB;
  --accent: #2E2BB4;
  --accent-ink: #FFFFFF;
  --accent-soft: #E8E8F8;
  --side: #080d28; /* Brand manual: dark surfaces always use a radial gradient */
  --side-ink: rgba(255, 255, 255, .82);
  --side-hover: rgba(255, 255, 255, .13);
  --green: #1D9E75;
  --amber: #D98B1E;
  --red: #E24B4A;
  --grey: #8893A6;
  --weekend: rgba(46, 43, 180, .035);
  --shadow: 0 10px 30px rgba(29, 31, 63, .14);
  --radius: 4px;
  --font-body: "Open Sans", "Segoe UI", Arial, sans-serif;
  --font-ui: "Roboto", "Segoe UI", Arial, sans-serif;
  --font-display: "DM Serif Display", Georgia, "Times New Roman", serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #111228;
    --surface: #191A36;
    --surface-2: #20223F;
    --ink: #E6E7F5;
    --muted: #A9B3C6;
    --faint: #7A84A0;
    --line: #2A2C4D;
    --line-strong: #3A3D66;
    --accent: #8B89F2;
    --accent-ink: #111228;
    --accent-soft: #26285A;
    --side: #1E1C78;
    --side-ink: rgba(255, 255, 255, .78);
    --side-hover: rgba(255, 255, 255, .08);
    --weekend: rgba(255, 255, 255, .03);
    --shadow: 0 10px 30px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font: 14px/1.5 var(--font-body);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
.side, .btn, .tabs, .lbl, .tbl th, .list-head, .sec-head, .col-head, .pill, .prio, .props .k, .panel h3, .box h2, .modal h2,
.mt-group h2, .pcard h3, .tl-corner, .tl-month, .tl-day, .tl-sec .tl-name, .legend, .check, .badge, .chip, .demo-badge, #toast { font-family: var(--font-ui); }

/* ---------- Base layout ---------- */
.shell { display: grid; grid-template-columns: 236px 1fr; height: 100vh; }
.side {
  background: radial-gradient(ellipse 160% 55% at -10% 18%, rgba(34, 52, 140, .95) 0%, rgba(20, 32, 96, .7) 30%, rgba(13, 21, 69, 0) 70%), linear-gradient(160deg, #0d1545 0%, #080d28 55%, #04070f 100%); background-color: #080d28; color: var(--side-ink);
  display: flex; flex-direction: column; min-height: 0;
}
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 22px 18px 14px; color: #fff; }
.brand .app { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-size: 21px; line-height: 1; color: #fff; }
.side nav { overflow-y: auto; flex: 1; padding: 4px 10px 12px; }
.side .group { margin: 16px 8px 6px; font-size: 12px; color: rgba(255,255,255,.6); display: flex; justify-content: space-between; align-items: center; }
.side .group button { background: none; border: 0; color: rgba(255,255,255,.75); cursor: pointer; font-size: 18px; line-height: 1; padding: 0 4px; border-radius: 4px; }
.side .group button:hover { color: #fff; background: var(--side-hover); }
.navlink {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 3px;
  color: var(--side-ink); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.navlink:hover { background: var(--side-hover); color: #fff; }
.navlink.active { background: var(--side-hover); color: #fff; box-shadow: inset 3px 0 0 var(--magenta); }
.navlink .dot { flex: none; box-shadow: 0 0 0 1.5px rgba(255,255,255,.7); }
.navlink span { overflow: hidden; text-overflow: ellipsis; }
.side footer { border-top: 1px solid rgba(255,255,255,.14); padding: 12px; display: flex; align-items: center; gap: 10px; }
.side footer .who { flex: 1; min-width: 0; font-size: 13px; }
.side footer .who b { display: block; color: #fff; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side footer .who a { color: rgba(255,255,255,.7); text-decoration: none; margin-right: 10px; font-size: 12px; cursor: pointer; }
.side footer .who a:hover { color: #fff; }

main { overflow: auto; min-width: 0; display: flex; flex-direction: column; }
.page-head { padding: 22px 28px 0; background: var(--surface); border-bottom: 1px solid var(--line); }
.page-head h1 { margin: 0; font-family: var(--font-display); font-size: 28px; font-weight: 400; line-height: 1.15; letter-spacing: 0; display: flex; align-items: center; gap: 10px; }
.page-head .sub { color: var(--muted); margin: 4px 0 0; }
.head-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.head-row .spacer { flex: 1; }
.tabs { display: flex; gap: 2px; margin-top: 14px; }
.tabs a {
  padding: 9px 14px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; font-weight: 500;
}
.tabs a:hover { color: var(--ink); }
.tabs a.active { color: var(--accent); border-bottom-color: var(--accent); }
.page-body { padding: 20px 28px 40px; flex: 1; min-height: 0; }
.page-body.flush { padding: 0; display: flex; flex-direction: column; }
.toolbar { display: flex; gap: 10px; align-items: center; padding: 12px 28px; border-bottom: 1px solid var(--line); background: var(--surface); flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }

/* ---------- Components ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-strong); background: var(--surface);
  padding: 7px 16px; border-radius: 3px; cursor: pointer; font-weight: 500; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.12); }
.btn:not(.primary):not(.danger) { color: var(--accent); border-color: var(--accent); }
.btn.ghost:not(.primary) { border-color: transparent; }
.btn.danger { color: var(--red); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.small { padding: 3px 12px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
.iconbtn { background: none; border: 0; cursor: pointer; color: var(--faint); padding: 2px 6px; border-radius: 4px; line-height: 1; font-size: 16px; }
.iconbtn:hover { color: var(--ink); background: var(--surface-2); }

input.field, select.field, textarea.field {
  border: 1px solid var(--line-strong); border-radius: 3px; padding: 7px 10px; background: var(--surface); width: 100%;
}
textarea.field { resize: vertical; min-height: 90px; line-height: 1.5; }
.lbl { display: block; font-size: 12.5px; color: var(--muted); margin: 0 0 4px; font-weight: 500; }
.form-grid { display: grid; gap: 14px; }
.check { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); cursor: pointer; user-select: none; }

.dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.avatar {
  width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  font-size: 10.5px; font-weight: 650; color: #fff; letter-spacing: .02em;
}
.avatar.lg { width: 32px; height: 32px; font-size: 12px; }
.avatar.empty { background: transparent; border: 1.5px dashed var(--line-strong); }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 550; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-on_track { color: var(--green); background: color-mix(in srgb, var(--green) 13%, transparent); }
.st-at_risk { color: var(--amber); background: color-mix(in srgb, var(--amber) 15%, transparent); }
.st-off_track { color: var(--red); background: color-mix(in srgb, var(--red) 13%, transparent); }
.st-on_hold { color: var(--grey); background: color-mix(in srgb, var(--grey) 15%, transparent); }
.st-complete { color: var(--accent); background: var(--accent-soft); }

.prio { font-size: 12px; padding: 1px 8px; border-radius: 4px; font-weight: 550; }
.prio-high { color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); }
.prio-medium { color: var(--amber); background: color-mix(in srgb, var(--amber) 14%, transparent); }
.prio-low { color: var(--muted); background: var(--surface-2); }

.progress { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; min-width: 80px; }
.progress > i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }

.circle {
  width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line-strong); background: transparent;
  cursor: pointer; flex: none; display: inline-grid; place-items: center; padding: 0; color: transparent;
}
.circle:hover { border-color: var(--green); color: var(--green); }
.circle.done { background: var(--green); border-color: var(--green); color: #fff; }
.circle svg { width: 10px; height: 10px; }
.badge { display: inline-flex; align-items: center; gap: 3px; color: var(--faint); font-size: 12px; }
.badge.blocked { color: var(--amber); }
.due-over { color: var(--red); }
.due-soon { color: var(--amber); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }

.empty-state { border: 1.5px dashed var(--line-strong); border-radius: var(--radius); padding: 36px; text-align: center; color: var(--muted); }
.empty-state p { margin: 0 0 14px; }

table.tbl { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tbl th { text-align: left; font-weight: 550; font-size: 12.5px; color: var(--muted); padding: 9px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--surface-2); }
.tbl select.inline, .tbl input.inline { border: 1px solid transparent; background: transparent; border-radius: 5px; padding: 3px 6px; }
.tbl select.inline:hover, .tbl input.inline:hover { border-color: var(--line-strong); }

/* ---------- List view ---------- */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.list-head, .row {
  display: grid; grid-template-columns: 32px minmax(220px, 1fr) 170px 128px 128px 104px 28px; align-items: center;
}
.list-head { font-size: 12.5px; color: var(--muted); font-weight: 550; border-bottom: 1px solid var(--line); background: var(--surface-2); border-radius: var(--radius) var(--radius) 0 0; }
.list-head > div { padding: 8px 10px; }
.sec-head { display: flex; align-items: center; gap: 8px; padding: 14px 10px 6px; font-weight: 650; border-bottom: 1px solid var(--line); }
.sec-head .name { cursor: text; }
.sec-head .count { color: var(--faint); font-weight: 500; font-size: 13px; }
.sec-head .iconbtn { opacity: 0; }
.sec-head:hover .iconbtn { opacity: 1; }
.row { border-bottom: 1px solid var(--line); min-height: 38px; background: var(--surface); }
.row:hover { background: var(--surface-2); }
.row > div { padding: 4px 10px; min-width: 0; }
.row .title { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.row .title .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row.done .t { color: var(--faint); text-decoration: line-through; }
.row select, .row input[type=date] { border: 1px solid transparent; background: transparent; border-radius: 5px; padding: 3px 4px; width: 100%; font-size: 13px; }
.row select:hover, .row input[type=date]:hover { border-color: var(--line-strong); }
.row .grip { cursor: grab; color: var(--faint); opacity: 0; text-align: center; }
.row:hover .grip { opacity: 1; }
.addrow { padding: 6px 10px 6px 42px; border-bottom: 1px solid var(--line); }
.addrow input { border: 0; background: transparent; width: 100%; padding: 6px 0; outline: none; }
.addrow input::placeholder { color: var(--faint); }
.dragging { opacity: .4; }
.drop-before { box-shadow: inset 0 2px 0 var(--accent); }
.drop-after { box-shadow: inset 0 -2px 0 var(--accent); }
.drop-zone-over { background: var(--accent-soft) !important; }

/* ---------- Board ---------- */
.board { display: flex; gap: 14px; padding: 18px 28px 28px; overflow-x: auto; flex: 1; align-items: flex-start; }
.col { width: 284px; flex: none; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; max-height: 100%; }
.col-head { display: flex; align-items: center; gap: 8px; padding: 11px 12px 8px; font-weight: 650; }
.col-head .count { color: var(--faint); font-weight: 500; }
.col-head .spacer { flex: 1; }
.col-cards { padding: 4px 8px 8px; display: flex; flex-direction: column; gap: 8px; min-height: 40px; overflow-y: auto; border-radius: 6px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 10px 11px; cursor: pointer;
  display: flex; flex-direction: column; gap: 8px;
}
.card:hover { border-color: var(--line-strong); }
.card .top { display: flex; gap: 8px; align-items: flex-start; }
.card .top .t { flex: 1; overflow-wrap: anywhere; }
.card.done .t { color: var(--faint); text-decoration: line-through; }
.card .meta { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); }
.card .meta .spacer { flex: 1; }
.col .add { margin: 0 8px 10px; }
.col .add input { width: 100%; border: 1px dashed var(--line-strong); background: transparent; border-radius: 6px; padding: 7px 9px; }
.col.new { background: transparent; border-style: dashed; padding: 10px; }

/* ---------- Timeline ---------- */
.tl-wrap { flex: 1; min-height: 0; overflow: auto; background: var(--surface); position: relative; }
.tl-inner { position: relative; }
.tl-head { position: sticky; top: 0; z-index: 6; display: flex; background: var(--surface); border-bottom: 1px solid var(--line); height: 52px; }
.tl-corner { position: sticky; left: 0; z-index: 7; background: var(--surface); border-right: 1px solid var(--line); padding: 16px 14px; font-size: 12.5px; color: var(--muted); font-weight: 550; flex: none; }
.tl-scale { position: relative; flex: none; }
.tl-month { position: absolute; top: 0; height: 26px; padding: 5px 8px; font-size: 12.5px; font-weight: 600; border-left: 1px solid var(--line); white-space: nowrap; overflow: hidden; }
.tl-day { position: absolute; top: 26px; height: 26px; text-align: center; font-size: 11px; color: var(--faint); padding-top: 5px; border-left: 1px solid transparent; }
.tl-day.wk { border-left-color: var(--line); color: var(--muted); text-align: left; padding-left: 5px; }
.tl-day.today { color: var(--magenta); font-weight: 700; }
.tl-body { position: relative; }
.tl-grid { position: absolute; top: 0; bottom: 0; z-index: 0; pointer-events: none; }
.tl-grid .we { position: absolute; top: 0; bottom: 0; background: var(--weekend); }
.tl-grid .wkline { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); opacity: .6; }
.tl-grid .todayline { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--magenta); opacity: .75; }
.tl-row { display: flex; height: 38px; position: relative; }
.tl-row:hover .tl-track { background: color-mix(in srgb, var(--accent) 4%, transparent); }
.tl-name {
  position: sticky; left: 0; z-index: 5; background: var(--surface); border-right: 1px solid var(--line); flex: none;
  display: flex; align-items: center; gap: 8px; padding: 0 12px; border-bottom: 1px solid var(--line); cursor: pointer; min-width: 0;
}
.tl-name .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-name.done .t { color: var(--faint); text-decoration: line-through; }
.tl-sec .tl-name { font-weight: 650; cursor: default; background: var(--surface-2); }
.tl-sec .tl-track { background: var(--surface-2); }
.tl-track { position: relative; flex: none; border-bottom: 1px solid var(--line); cursor: crosshair; }
.tl-sec .tl-track { cursor: default; }
.bar {
  position: absolute; top: 7px; height: 24px; border-radius: 3px; z-index: 3; cursor: grab;
  display: flex; align-items: center; color: #fff; font-size: 12.5px; font-weight: 550; padding: 0 9px;
  box-shadow: 0 1px 2px rgba(0,0,0,.15); touch-action: none; user-select: none;
}
.bar.done { opacity: .5; }
.bar .lab { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.bar .outside { position: absolute; left: calc(100% + 8px); color: var(--ink); font-weight: 500; white-space: nowrap; pointer-events: none; }
.bar .h { position: absolute; top: 0; bottom: 0; width: 9px; cursor: ew-resize; }
.bar .h.l { left: 0; border-radius: 3px 0 0 3px; }
.bar .h.r { right: 0; border-radius: 0 3px 3px 0; }
.bar .h:hover { background: rgba(255,255,255,.25); }
.bar.moving { cursor: grabbing; box-shadow: var(--shadow); z-index: 8; }
.bar.ro { cursor: pointer; }
.tl-arrows { position: absolute; top: 0; z-index: 2; pointer-events: none; overflow: visible; }
.tl-arrows path { fill: none; stroke: var(--muted); stroke-width: 1.5; }
.tl-arrows path.conflict { stroke: var(--red); stroke-width: 2; }
.tl-tip { position: fixed; z-index: 50; background: var(--ink); color: var(--paper); font-size: 12px; padding: 4px 8px; border-radius: 5px; pointer-events: none; white-space: nowrap; }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); align-items: center; }
.legend i { display: inline-block; width: 18px; height: 0; border-top: 2px solid var(--muted); vertical-align: middle; margin-right: 5px; }
.legend i.c { border-color: var(--red); }

/* ---------- Detail panel ---------- */
.panel-back { position: fixed; inset: 0; z-index: 20; background: rgba(10, 20, 21, .18); }
.panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); z-index: 21; background: var(--surface);
  box-shadow: var(--shadow); display: flex; flex-direction: column; border-left: 1px solid var(--line);
  animation: slidein .16s ease-out;
}
@keyframes slidein { from { transform: translateX(24px); opacity: .4; } }
.panel-top { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.panel-top .spacer { flex: 1; }
.panel-scroll { overflow-y: auto; padding: 18px 22px 30px; flex: 1; }
.panel .crumb { font-size: 13px; color: var(--muted); margin-bottom: 6px; display: flex; gap: 6px; align-items: center; }
.panel .crumb a { cursor: pointer; text-decoration: none; }
.panel textarea.title {
  font-size: 20px; font-weight: 650; border: 1px solid transparent; border-radius: 6px; width: 100%; resize: none;
  padding: 4px 6px; margin-left: -6px; background: transparent; line-height: 1.3; letter-spacing: -.01em;
}
.panel textarea.title:hover, .panel textarea.title:focus { border-color: var(--line-strong); }
.props { display: grid; grid-template-columns: 120px 1fr; gap: 8px 12px; align-items: center; margin: 16px 0 22px; }
.props .k { color: var(--muted); font-size: 13px; }
.props select, .props input { border: 1px solid transparent; background: transparent; padding: 4px 6px; border-radius: 5px; width: 100%; max-width: 260px; }
.props select:hover, .props input:hover { border-color: var(--line-strong); }
.panel h3 { font-size: 13.5px; font-weight: 650; margin: 24px 0 8px; display: flex; align-items: center; gap: 8px; }
.panel h3 .count { color: var(--faint); font-weight: 500; }
.deplist, .sublist { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 4px; }
.deplist:empty, .sublist:empty { display: none; }
.dep, .sub { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-bottom: 1px solid var(--line); }
.dep:last-child, .sub:last-child { border-bottom: 0; }
.dep .t, .sub .t { flex: 1; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dep .t.done, .sub .t.done { text-decoration: line-through; color: var(--faint); }
.dep .pj { font-size: 12px; color: var(--faint); }
.picker { margin-top: 8px; position: relative; }
.picker-results { position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 4px; box-shadow: var(--shadow); z-index: 5; max-height: 240px; overflow-y: auto; }
.picker-results div { padding: 7px 10px; cursor: pointer; display: flex; gap: 8px; align-items: center; }
.picker-results div:hover, .picker-results div.sel { background: var(--surface-2); }
.comment { display: flex; gap: 10px; margin-bottom: 14px; }
.comment .b { flex: 1; min-width: 0; }
.comment .b .h { font-size: 13px; }
.comment .b .h .faint { margin-left: 6px; font-size: 12px; }
.comment .b p { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.compose { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); padding: 12px 22px 16px; }
.compose textarea { min-height: 60px; }
.compose .row2 { display: flex; justify-content: flex-end; }

/* ---------- Modal, Toast, Login ---------- */
.modal-back { position: fixed; inset: 0; z-index: 40; background: rgba(10, 20, 21, .35); display: grid; place-items: center; padding: 20px; }
.modal { background: var(--surface); border-radius: 6px; box-shadow: var(--shadow); width: min(460px, 100%); padding: 22px 24px; }
.modal h2 { margin: 0 0 16px; font-family: var(--font-display); font-size: 24px; font-weight: 400; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches button { width: 26px; height: 26px; border-radius: 6px; border: 2px solid transparent; cursor: pointer; }
.swatches button.on { border-color: var(--ink); }
#toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 60; }
#toast div { background: var(--ink); color: var(--paper); padding: 9px 16px; border-radius: 4px; box-shadow: var(--shadow); margin-top: 6px; }
#toast div.err { background: var(--red); color: #fff; }

.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth .art { background: #080d28 radial-gradient(ellipse at 55% 35%, #1a2a6e 0%, #0d1545 35%, #080d28 70%, #04070f 100%); position: relative; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.auth .art h1 { font-family: var(--font-display); font-size: 46px; font-weight: 400; margin: 0; line-height: 1.08; max-width: 14ch; }
.auth .art h1 em { font-style: italic; color: #3D8DB0; }
.auth .art .bars { display: flex; flex-direction: column; gap: 12px; margin: 40px 0; }
.auth .art .bars i { display: block; height: 22px; border-radius: 3px; }
.auth .art p { color: rgba(255,255,255,.78); max-width: 44ch; margin: 0; }
.auth .formside { display: grid; place-items: center; padding: 40px; background: var(--surface); }
.auth form { width: min(360px, 100%); }
.auth form h2 { margin: 0 0 6px; font-family: var(--font-display); font-size: 30px; font-weight: 400; }
.auth form p { color: var(--muted); margin: 0 0 22px; }
.auth .err { color: var(--red); min-height: 20px; margin-top: 10px; font-size: 13px; }

/* ---------- Overviews ---------- */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.pcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; cursor: pointer; text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 10px; }
.pcard:hover { border-color: var(--line-strong); }
.pcard h3 { margin: 0; font-size: 15px; display: flex; gap: 8px; align-items: center; }
.pcard .statusbar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: var(--line); }
.pcard .statusbar i { display: block; height: 100%; }
.summary { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.mt-group { margin-bottom: 22px; }
.mt-group h2 { font-size: 14px; margin: 0 0 8px; font-weight: 650; display: flex; gap: 8px; }
.mt-group h2 .count { color: var(--faint); font-weight: 500; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); max-width: 220px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.settings { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; max-width: 1100px; }
.box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.box h2 { font-size: 15px; margin: 0 0 14px; font-weight: 500; color: var(--accent); }
.update { border-top: 1px solid var(--line); padding: 12px 0; }
.update p { margin: 6px 0 0; white-space: pre-wrap; }

.menu-btn { display: none; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 30; transform: translateX(-100%); transition: transform .18s; }
  .shell.nav-open .side { transform: none; }
  .menu-btn { display: inline-flex; }
  .page-head, .toolbar { padding-left: 16px; padding-right: 16px; }
  .page-body { padding: 16px; }
  .board { padding: 16px; }
  .list { overflow-x: auto; }
  .list-head, .row { min-width: 820px; }
  .settings { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth .art { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
