/* LedgerPilot — desktop app styles (app.css). System fonts only; nothing loaded from the network. */

/* ============================================================ tokens */
:root {
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "Cascadia Code", "SF Mono", Consolas, "Liberation Mono", monospace;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;

  --desk: #d9d6cf;
  --chrome: #ebe9e3;
  --chrome-line: #dcd9d1;
  --sidebar: #f3f2ee;
  --bg: #fbfaf8;
  --surface: #ffffff;
  --surface-2: #f7f6f3;
  --surface-3: #f0efeb;
  --hover: rgba(30, 36, 48, .045);
  --active: rgba(43, 76, 126, .09);
  --line: #e3e1db;
  --line-2: #eceae5;
  --text: #1c2026;
  --text-2: #464d58;
  --muted: #7a808a;
  --faint: #a3a8b0;
  --accent: #2b4c7e;
  --accent-2: #23406b;
  --accent-ink: #ffffff;
  --accent-soft: #e9eef7;
  --brass: #a07732;
  --brass-soft: #f6eedd;
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px rgba(43, 76, 126, .45);
  --shadow-1: 0 1px 2px rgba(20, 24, 31, .05);
  --shadow-2: 0 6px 20px rgba(20, 24, 31, .09), 0 1px 3px rgba(20, 24, 31, .06);
  --shadow-3: 0 18px 50px rgba(20, 24, 31, .18), 0 2px 8px rgba(20, 24, 31, .08);
  --radius: 8px;
  --radius-s: 6px;

  --g-ink: #1d6b45; --g-bg: #e3f2e9;
  --t-ink: #13686f; --t-bg: #def0f1;
  --b-ink: #2a5ba8; --b-bg: #e6eefa;
  --a-ink: #8d5f0c; --a-bg: #fbefd5;
  --r-ink: #b02a2a; --r-bg: #fbe5e3;
  --v-ink: #6646a8; --v-bg: #eee8fa;
  --n-ink: #59606b; --n-bg: #eeeef0;

  --sbw: 228px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --desk: #08090b;
  --chrome: #0f1114;
  --chrome-line: #22262c;
  --sidebar: #13161a;
  --bg: #16191d;
  --surface: #1b1e23;
  --surface-2: #1f2328;
  --surface-3: #262a30;
  --hover: rgba(255, 255, 255, .045);
  --active: rgba(122, 162, 227, .14);
  --line: #2b3038;
  --line-2: #24282e;
  --text: #e5e7ea;
  --text-2: #b6bbc3;
  --muted: #8a919b;
  --faint: #5f6670;
  --accent: #7ea6e6;
  --accent-2: #9ab9ee;
  --accent-ink: #0c1322;
  --accent-soft: #1d2a40;
  --brass: #d3aa5e;
  --brass-soft: #2e2618;
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px rgba(126, 166, 230, .55);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-2: 0 8px 24px rgba(0, 0, 0, .45), 0 1px 3px rgba(0, 0, 0, .3);
  --shadow-3: 0 20px 60px rgba(0, 0, 0, .6), 0 2px 8px rgba(0, 0, 0, .4);
  --g-ink: #6fd3a0; --g-bg: rgba(64, 190, 125, .14);
  --t-ink: #66cfd6; --t-bg: rgba(60, 180, 190, .14);
  --b-ink: #8db3f2; --b-bg: rgba(100, 150, 240, .15);
  --a-ink: #e9b95a; --a-bg: rgba(230, 170, 60, .15);
  --r-ink: #f08a84; --r-bg: rgba(235, 90, 80, .15);
  --v-ink: #b9a0f0; --v-bg: rgba(150, 120, 235, .16);
  --n-ink: #a6acb5; --n-bg: rgba(255, 255, 255, .07);
  color-scheme: dark;
}

/* ============================================================ base */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font: 13px/1.45 var(--font); color: var(--text); background: var(--desk);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow: hidden;
  font-variant-numeric: tabular-nums;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 4px; }
::selection { background: rgba(43, 76, 126, .2); }
[hidden] { display: none !important; }
code, kbd, .mono { font-family: var(--mono); font-size: .92em; }
kbd {
  display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 4px;
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; background: var(--surface); color: var(--muted);
  font-size: 10.5px; font-family: var(--font); font-weight: 600; line-height: 1; margin-left: 2px;
}
.ic { flex: none; display: inline-block; vertical-align: middle; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12px; }
.strong { font-weight: 600; }
.num, .a-right { text-align: right; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.sp { flex: 1 1 auto; }
.ellip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb { background: rgba(120, 125, 135, .35); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(120, 125, 135, .55); }
::-webkit-scrollbar-corner { background: transparent; }

/* ============================================================ window */
.window {
  position: fixed; inset: 0; display: grid; grid-template-rows: 36px minmax(0, 1fr) 26px;
  background: var(--bg); overflow: hidden;
}
body.windowed { background: radial-gradient(1200px 700px at 20% 0%, #c9c4b8 0%, var(--desk) 55%, #bdb8ad 100%); }
:root[data-theme="dark"] body.windowed { background: radial-gradient(1200px 700px at 20% 0%, #1b1e24 0%, #0b0c0e 60%); }
body.windowed .window { inset: 18px 22px; border-radius: 11px; box-shadow: var(--shadow-3), 0 0 0 1px rgba(0, 0, 0, .12); }
.is-locked .window { filter: blur(6px) saturate(.7); pointer-events: none; }

/* title bar */
.titlebar {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 36px;
  background: var(--chrome); border-bottom: 1px solid var(--chrome-line); user-select: none; -webkit-user-select: none;
}
.tb-left { display: flex; align-items: center; gap: 6px; padding-left: 10px; min-width: 0; }
.tb-logo { display: inline-flex; color: var(--brass); margin-right: 2px; }
.menubar { display: flex; gap: 1px; }
.menubar button { border: 0; background: none; padding: 4px 8px; border-radius: 5px; font-size: 12.5px; color: var(--text-2); cursor: default; }
.menubar button:hover, .menubar button:focus-visible { background: var(--hover); color: var(--text); }
.tb-title { font-size: 12.5px; font-weight: 600; color: var(--text-2); letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 12px; }
.tb-right { display: flex; justify-content: flex-end; height: 100%; }
.winctl { width: 46px; height: 100%; border: 0; background: none; color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; cursor: default; }
.winctl:hover { background: var(--hover); color: var(--text); }
.winctl.close:hover { background: #c4382f; color: #fff; }
body.windowed .winctl.close:hover { border-top-right-radius: 11px; }

.win-body { display: grid; grid-template-columns: var(--sbw) minmax(0, 1fr); min-height: 0; }

/* ============================================================ sidebar */
.sidebar { background: var(--sidebar); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.sb-firm { display: flex; align-items: center; gap: 10px; padding: 14px 14px 12px; border-bottom: 1px solid var(--line-2); }
.sb-firm-mark {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none;
  background: linear-gradient(145deg, var(--accent), var(--accent-2)); color: var(--accent-ink); font: 600 12px/1 var(--serif); letter-spacing: .04em;
}
.sb-firm-n { font: 600 13.5px/1.2 var(--serif); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-firm-s { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-firm-t { min-width: 0; }
.sb-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 6px 8px 10px; }
.sb-group { margin-top: 10px; }
.sb-gh { font-size: 10.5px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); padding: 4px 8px 4px; }
.sb-item {
  display: flex; align-items: center; gap: 9px; height: 30px; padding: 0 8px; border-radius: 6px; color: var(--text-2);
  font-size: 13px; position: relative; text-decoration: none !important; cursor: default;
}
.sb-item:hover { background: var(--hover); color: var(--text); }
.sb-item.active { background: var(--active); color: var(--accent); font-weight: 600; }
.sb-item.active::before { content: ""; position: absolute; left: -8px; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.sb-item.pending .sb-l { opacity: .55; }
.sb-l { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-badge { font-size: 10.5px; font-weight: 650; min-width: 19px; height: 17px; padding: 0 5px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: var(--n-bg); color: var(--n-ink); }
.sb-badge.t-red { background: var(--r-bg); color: var(--r-ink); }
.sb-badge.t-amber { background: var(--a-bg); color: var(--a-ink); }
.sb-badge.t-blue { background: var(--b-bg); color: var(--b-ink); }
.sb-badge.t-green { background: var(--g-bg); color: var(--g-ink); }
.sb-foot { border-top: 1px solid var(--line-2); padding: 9px 14px; }
.sb-offline { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--muted); }
body.sb-collapsed, body.narrow { --sbw: 56px; }
body.sb-collapsed .sb-l, body.sb-collapsed .sb-gh, body.sb-collapsed .sb-firm-t, body.sb-collapsed .sb-offline span,
body.narrow .sb-l, body.narrow .sb-gh, body.narrow .sb-firm-t, body.narrow .sb-offline span { display: none; }
body.sb-collapsed .sb-item, body.narrow .sb-item { justify-content: center; padding: 0; }
body.sb-collapsed .sb-badge, body.narrow .sb-badge { position: absolute; top: 1px; right: 2px; min-width: 15px; height: 14px; font-size: 9px; padding: 0 3px; }
body.sb-collapsed .sb-firm, body.narrow .sb-firm { justify-content: center; padding: 12px 0; }
body.sb-collapsed .sb-group, body.narrow .sb-group { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line-2); }
body.sb-collapsed .sb-foot, body.narrow .sb-foot { display: flex; justify-content: center; padding: 9px 0; }

/* ============================================================ main + command bar */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); }
.cmdbar { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 14px 0 10px; border-bottom: 1px solid var(--line); background: var(--surface); flex: none; }
.crumbs { display: flex; align-items: center; gap: 4px; min-width: 0; font-size: 13px; white-space: nowrap; overflow: hidden; flex: 0 1 auto; }
.crumbs .cr { color: var(--muted); }
.crumbs .cr-cur { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.crumbs .cr-sep { color: var(--faint); display: inline-flex; }
.cmd-search {
  margin: 0 auto; flex: 0 1 440px; min-width: 120px; height: 31px; display: flex; align-items: center; gap: 8px; padding: 0 8px 0 11px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--muted); font-size: 12.5px; cursor: text; text-align: left;
}
.cmd-search span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmd-search:hover { border-color: var(--faint); color: var(--text-2); }
.cmd-right { display: flex; align-items: center; gap: 4px; flex: none; }
.iconbtn {
  width: 30px; height: 30px; border: 0; border-radius: 7px; background: none; color: var(--text-2); display: inline-flex; align-items: center; justify-content: center;
  position: relative; cursor: default; flex: none;
}
.iconbtn:hover { background: var(--hover); color: var(--text); }
.dot-n { position: absolute; top: 2px; right: 1px; min-width: 15px; height: 15px; padding: 0 4px; border-radius: 8px; background: #c4382f; color: #fff; font-size: 9.5px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--surface); box-sizing: content-box; }
.userbtn { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 6px 0 3px; border: 0; border-radius: 16px; background: none; cursor: default; color: var(--text-2); font-size: 12.5px; }
.userbtn:hover { background: var(--hover); }
.caret { opacity: .6; }
.narrow-note { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: var(--brass-soft); color: var(--text-2); border-bottom: 1px solid var(--line); font-size: 12.5px; }
.narrow-note span { flex: 1; }
.lp-view { flex: 1; min-height: 0; overflow: auto; outline: none; position: relative; }
.view-inner { padding: 18px 24px 30px; min-height: 100%; }
.view-inner.page-fill { height: 100%; display: flex; flex-direction: column; padding-bottom: 14px; }
.g-pending .cmdbar::after { content: "G → D C T J F K N U A B R H V P M S"; position: absolute; left: 50%; top: 52px; transform: translateX(-50%); background: var(--text); color: var(--bg); font-size: 11px; padding: 4px 10px; border-radius: 6px; z-index: 50; letter-spacing: .08em; pointer-events: none; }

/* ============================================================ buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px; height: 31px; padding: 0 12px; border-radius: 7px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font-size: 12.5px; font-weight: 550; cursor: default; white-space: nowrap; box-shadow: var(--shadow-1);
  transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--surface-2); border-color: var(--faint); }
.btn:active { transform: translateY(.5px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.danger { color: var(--r-ink); border-color: color-mix(in srgb, var(--r-ink) 35%, var(--line)); }
.btn.danger:hover { background: var(--r-bg); }
.btn.ghost { border-color: transparent; background: none; box-shadow: none; }
.btn.ghost:hover { background: var(--hover); }
.btn.sm { height: 27px; padding: 0 9px; font-size: 12px; border-radius: 6px; }
.btn.icon-only { padding: 0; width: 31px; justify-content: center; }
.btn.sm.icon-only { width: 27px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn kbd { margin-left: 4px; background: transparent; }
.btn.primary kbd { color: inherit; border-color: rgba(255, 255, 255, .35); }
.linkbtn { border: 0; background: none; color: var(--accent); padding: 0; cursor: pointer; font-size: inherit; }
.linkbtn:hover { text-decoration: underline; }

/* ============================================================ page head + cards */
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.ph-text { flex: 1 1 260px; min-width: 0; }
.ph-title { margin: 0; font: 600 21px/1.2 var(--font-display); letter-spacing: -.01em; }
.ph-badge { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface-3); padding: 2px 8px; border-radius: 10px; vertical-align: 3px; margin-left: 4px; }
.ph-sub { color: var(--muted); margin-top: 3px; font-size: 12.5px; }
.ph-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); min-width: 0; }
.card-h { display: flex; align-items: center; gap: 8px; padding: 11px 14px; border-bottom: 1px solid var(--line-2); min-height: 44px; }
.card-t { font-weight: 600; font-size: 13px; display: flex; align-items: center; gap: 7px; }
.card-t .ic { color: var(--muted); }
.card-s { color: var(--muted); font-size: 12px; }
.card-b { padding: 12px 14px; }
.card-b.flush { padding: 0; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.sec-t { font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 18px 0 8px; }
.sec-t:first-child { margin-top: 0; }
.divider { height: 1px; background: var(--line-2); margin: 12px 0; }
.note { display: flex; gap: 9px; align-items: flex-start; padding: 9px 12px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--line-2); color: var(--text-2); font-size: 12.5px; }
.note .ic { margin-top: 1px; color: var(--muted); }
.note.t-amber { background: var(--a-bg); border-color: transparent; color: var(--a-ink); }
.note.t-amber .ic { color: inherit; }
.note.t-red { background: var(--r-bg); border-color: transparent; color: var(--r-ink); }
.note.t-blue { background: var(--b-bg); border-color: transparent; color: var(--b-ink); }
.note.t-brass { background: var(--brass-soft); border-color: transparent; }
.note b { color: inherit; }

/* ============================================================ pills, chips */
.pill { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 8px; border-radius: 10px; font-size: 11.5px; font-weight: 560; white-space: nowrap; background: var(--n-bg); color: var(--n-ink); }
.pill.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.t-green { --ti: var(--g-ink); --tb: var(--g-bg); } .t-teal { --ti: var(--t-ink); --tb: var(--t-bg); } .t-blue { --ti: var(--b-ink); --tb: var(--b-bg); }
.t-amber { --ti: var(--a-ink); --tb: var(--a-bg); } .t-red { --ti: var(--r-ink); --tb: var(--r-bg); } .t-violet { --ti: var(--v-ink); --tb: var(--v-bg); } .t-grey { --ti: var(--n-ink); --tb: var(--n-bg); }
.pill[class*="t-"] { background: var(--tb); color: var(--ti); }
.chip { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 5px; font-size: 11.5px; background: var(--surface-3); color: var(--text-2); white-space: nowrap; border: 1px solid var(--line-2); }
.chip.law { font-family: var(--mono); font-size: 10.5px; letter-spacing: .02em; }
.chip.law.new { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.chip.law.old { background: var(--brass-soft); color: var(--brass); border-color: transparent; }
.demo-tag { font-size: 9.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--brass); border: 1px solid color-mix(in srgb, var(--brass) 40%, transparent); padding: 0 4px; border-radius: 4px; margin-left: 5px; vertical-align: 1px; }
.due { display: inline-flex; flex-direction: column; line-height: 1.25; }
.due-d { font-size: 12.5px; white-space: nowrap; }
.due-r { font-size: 11px; color: var(--muted); white-space: nowrap; }
.due-over .due-r { color: var(--r-ink); font-weight: 600; }
.due-soon .due-r { color: var(--a-ink); font-weight: 600; }
.due-week .due-r { color: var(--b-ink); }
.due-done .due-d { color: var(--muted); }
.av { display: inline-grid; place-items: center; border-radius: 50%; background: var(--av, #777); color: #fff; font-weight: 650; flex: none; letter-spacing: .02em; line-height: 1; }
.who { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.idf { font-family: var(--mono); font-size: 12px; letter-spacing: .02em; }
.ring { display: block; }
.ring-bg { stroke: var(--surface-3); }
.ring-fg { stroke: var(--accent); transition: stroke-dasharray .4s; }
.ring-fg.t-green { stroke: var(--g-ink); } .ring-fg.t-amber { stroke: var(--a-ink); } .ring-fg.t-red { stroke: var(--r-ink); } .ring-fg.t-teal { stroke: var(--t-ink); } .ring-fg.t-violet { stroke: var(--v-ink); }
.ring-t { font-size: 13px; font-weight: 650; fill: var(--text); font-family: var(--font); }
.meter { display: block; height: 6px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.meter-f { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.meter-f.t-accent { background: var(--accent); } .meter-f.t-green { background: var(--g-ink); } .meter-f.t-amber { background: var(--a-ink); } .meter-f.t-red { background: var(--r-ink); } .meter-f.t-teal { background: var(--t-ink); } .meter-f.t-violet { background: var(--v-ink); } .meter-f.t-blue { background: var(--b-ink); } .meter-f.t-grey { background: var(--faint); }

/* ============================================================ empty, kv */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 46px 20px; color: var(--muted); }
.empty.compact { padding: 26px 16px; }
.empty-ic { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); margin-bottom: 6px; }
.empty.compact .empty-ic { width: 40px; height: 40px; border-radius: 11px; }
.empty-t { font-weight: 600; color: var(--text); font-size: 14px; }
.empty-x { max-width: 420px; font-size: 12.5px; margin-bottom: 8px; }
.kv { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; gap: 7px 14px; margin: 0; font-size: 12.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.kv.wide { grid-template-columns: 160px 1fr; }

/* ============================================================ segmented + tabs */
.seg { display: inline-flex; padding: 2px; border-radius: 8px; background: var(--surface-3); border: 1px solid var(--line-2); gap: 2px; }
.seg-b { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border: 0; border-radius: 6px; background: none; color: var(--text-2); font-size: 12.5px; font-weight: 550; cursor: default; white-space: nowrap; }
.seg-b:hover { color: var(--text); }
.seg-b.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
.seg.sm .seg-b { height: 22px; font-size: 12px; padding: 0 8px; }
.seg-n { font-size: 10.5px; color: var(--muted); font-weight: 600; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { position: relative; border: 0; background: none; padding: 8px 10px 9px; color: var(--muted); font-size: 12.5px; font-weight: 560; cursor: default; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.tab:hover { color: var(--text); }
.tab.on { color: var(--text); }
.tab.on::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); }
.tab-n { font-size: 10.5px; padding: 0 6px; border-radius: 8px; background: var(--surface-3); color: var(--muted); line-height: 16px; }

/* ============================================================ forms */
.frm { display: grid; gap: 12px 14px; }
.frm.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.frm.cols-1 { grid-template-columns: minmax(0, 1fr); }
.frm.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.frm-sec { grid-column: 1 / -1; font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding-top: 8px; border-top: 1px solid var(--line-2); margin-top: 4px; display: flex; gap: 8px; align-items: baseline; }
.frm-sec span { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--faint); font-size: 11.5px; }
.frm-sec:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.frm-html { grid-column: 1 / -1; }
.fld { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fld.span-2, .frm .span-2 { grid-column: 1 / -1; }
.fld-l { font-size: 12px; font-weight: 560; color: var(--text-2); }
.fld-l i { color: var(--r-ink); font-style: normal; }
.fld-h { font-size: 11.5px; color: var(--faint); }
.fld-e { font-size: 11.5px; color: var(--r-ink); min-height: 0; }
.fld-e:empty { display: none; }
input[type=text], input[type=search], input[type=email], input[type=tel], input[type=number], input[type=date], input[type=datetime-local], input[type=password], input:not([type]), select, textarea {
  height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--text); font-size: 13px; min-width: 0; width: 100%;
  transition: border-color .12s, box-shadow .12s;
}
textarea { height: auto; padding: 8px 10px; resize: vertical; line-height: 1.45; }
select { padding-right: 26px; appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9.5l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[readonly] { background: var(--surface-2); color: var(--text-2); }
.fld.bad input, .fld.bad select, .fld.bad textarea { border-color: var(--r-ink); }
.money-in { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.money-in span { padding: 0 0 0 10px; color: var(--muted); }
.money-in input { border: 0; box-shadow: none !important; text-align: right; }
.money-in:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.chk { display: inline-flex; align-items: center; gap: 7px; cursor: default; font-size: 12.5px; }
.chk input, input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--accent); margin: 0; flex: none; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 4px 0; }
.fld-cb { justify-content: flex-end; }

/* ============================================================ tables */
.tbl-wrap { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); min-width: 0; }
.tbl-wrap.fill { flex: 1 1 auto; min-height: 240px; }
.tbl-tools { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.search-in { display: flex; align-items: center; gap: 6px; height: 29px; padding: 0 6px 0 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-2); width: 260px; max-width: 100%; color: var(--muted); }
.search-in input { border: 0; background: none; height: 27px; padding: 0; box-shadow: none !important; font-size: 12.5px; }
.search-in:focus-within { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-in kbd { flex: none; }
.fsel { width: auto; height: 29px; font-size: 12.5px; background-color: var(--surface); padding-left: 9px; max-width: 190px; }
.fsel.on { border-color: var(--accent); color: var(--accent); background-color: var(--accent-soft); font-weight: 560; }
.tbl-count { color: var(--muted); font-size: 12px; white-space: nowrap; }
.bulkbar { display: flex; align-items: center; gap: 6px; padding: 7px 10px; background: var(--accent-soft); border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.bulk-n { font-weight: 600; font-size: 12.5px; color: var(--accent); margin-right: 6px; }
.tbl-scroll { overflow: auto; min-height: 0; outline: none; position: relative; border-radius: 0 0 var(--radius) var(--radius); }
.tbl-wrap.fill .tbl-scroll { flex: 1 1 auto; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.tbl th {
  position: sticky; top: 0; z-index: 2; background: var(--surface-2); text-align: left; font-weight: 600; font-size: 11.5px; color: var(--muted);
  padding: 0 10px; height: 32px; border-bottom: 1px solid var(--line); white-space: nowrap; user-select: none;
}
.tbl th.sortable { cursor: default; }
.tbl th.sortable:hover { color: var(--text); }
.th-in { display: inline-flex; align-items: center; gap: 4px; }
.sort-ic { opacity: 0; display: inline-flex; }
.tbl th.sortable:hover .sort-ic { opacity: .45; }
.tbl th.sorted { color: var(--text); }
.tbl th.sorted .sort-ic { opacity: 1; color: var(--accent); }
.tbl td { padding: 6px 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; height: 38px; }
.tbl-wrap.dense .tbl td { height: 32px; padding-top: 4px; padding-bottom: 4px; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr { outline: none; }
.tbl tbody tr.clickable { cursor: default; }
.tbl tbody tr:hover td { background: var(--hover); }
.tbl tbody tr:focus td { background: var(--active); }
.tbl tbody tr:focus td:first-child { box-shadow: inset 2px 0 0 var(--accent); }
.tbl tbody tr.selected td { background: var(--accent-soft); }
.tbl .a-right { text-align: right; }
.tbl .a-center { text-align: center; }
.tbl th.a-right .th-in { flex-direction: row-reverse; }
.c-sel { width: 34px; padding-right: 0 !important; }
.tbl tr.row-muted td { color: var(--muted); }
.tbl tr.row-alert td:first-child { box-shadow: inset 2px 0 0 var(--r-ink); }
.tbl-more { padding: 8px; text-align: center; border-top: 1px solid var(--line-2); }
.tbl-empty { border-top: 1px solid var(--line-2); }
.cell-main { font-weight: 560; color: var(--text); }
.cell-sub { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 340px; }
.cell-2 { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.row-acts { display: inline-flex; gap: 2px; opacity: 0; }
.tbl tr:hover .row-acts, .tbl tr:focus .row-acts, .tbl tr:focus-within .row-acts { opacity: 1; }

/* ============================================================ overlays */
#lp-layer { position: fixed; inset: 0; pointer-events: none; z-index: 100; }
#lp-layer > * { pointer-events: auto; }
.ov-back { position: fixed; inset: 0; background: rgba(18, 22, 28, .28); opacity: 0; transition: opacity .16s; }
:root[data-theme="dark"] .ov-back { background: rgba(0, 0, 0, .5); }
.ov-back.in { opacity: 1; }
.drawer-back { background: rgba(18, 22, 28, .14); }
.modal-back { display: grid; place-items: center; padding: 30px 16px; overflow: auto; }
.modal {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-3); max-width: calc(100vw - 32px);
  max-height: calc(100vh - 60px); display: flex; flex-direction: column; transform: translateY(6px) scale(.985); transition: transform .16s;
}
.ov-back.in .modal { transform: none; }
.modal-head { display: flex; align-items: flex-start; gap: 10px; padding: 15px 16px 10px 20px; }
.modal-head > div:first-child { flex: 1; min-width: 0; }
.modal-title { font: 600 16px/1.3 var(--font-display); }
.modal-sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.modal-body { padding: 6px 20px 18px; overflow: auto; min-height: 0; }
.modal-foot { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line-2); background: var(--surface-2); border-radius: 0 0 12px 12px; }
.foot-note { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.confirm-text { margin: 0; color: var(--text-2); line-height: 1.55; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow-3);
  display: flex; flex-direction: column; transform: translateX(24px); opacity: .6; transition: transform .18s ease-out, opacity .18s; max-width: 100vw;
}
.ov-back.in .drawer { transform: none; opacity: 1; }
body.windowed .drawer { top: 18px; bottom: 18px; right: 22px; border-radius: 0 11px 11px 0; }
.drawer-head { display: flex; gap: 12px; align-items: flex-start; padding: 16px 14px 12px 20px; border-bottom: 1px solid var(--line-2); }
.dh-text { flex: 1; min-width: 0; }
.dh-actions { display: flex; gap: 4px; align-items: center; }
.drawer-kicker { font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.drawer-title { font: 600 17px/1.3 var(--font-display); }
.drawer-sub { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.drawer-sub:empty { display: none; }
.drawer-body { flex: 1; overflow: auto; padding: 16px 20px 24px; min-height: 0; }
.drawer-foot { display: flex; gap: 8px; align-items: center; padding: 11px 14px; border-top: 1px solid var(--line-2); background: var(--surface-2); flex-wrap: wrap; }
.ctxmenu, .popover {
  position: fixed; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; box-shadow: var(--shadow-2);
  padding: 4px; min-width: 200px; max-width: 340px; z-index: 120; outline: none; animation: pop .1s ease-out;
}
.popover { padding: 0; overflow: auto; }
@keyframes pop { from { opacity: 0; transform: translateY(-3px); } }
.cm-item { display: flex; align-items: center; gap: 8px; width: 100%; height: 29px; padding: 0 8px; border: 0; background: none; border-radius: 6px; font-size: 12.5px; color: var(--text); text-align: left; cursor: default; }
.cm-item:hover, .cm-item:focus { background: var(--accent); color: var(--accent-ink); outline: none; }
.cm-item:hover kbd, .cm-item:focus kbd { color: inherit; border-color: rgba(255, 255, 255, .35); background: transparent; }
.cm-item.danger { color: var(--r-ink); }
.cm-item.danger:hover, .cm-item.danger:focus { background: #c4382f; color: #fff; }
.cm-item[disabled] { opacity: .45; }
.cm-ic { width: 16px; display: inline-flex; justify-content: center; color: inherit; opacity: .85; }
.cm-l { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm-hint { font-size: 11px; opacity: .7; }
.cm-sep { height: 1px; background: var(--line-2); margin: 4px 6px; }
.cm-head { font-size: 10.5px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); padding: 6px 8px 4px; }

/* digest popover */
.pop-head { padding: 13px 14px 9px; border-bottom: 1px solid var(--line-2); }
.pop-t { font-weight: 650; font-size: 13.5px; }
.pop-s { color: var(--muted); font-size: 12px; }
.digest { padding: 5px; }
.dg-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border: 0; border-radius: 7px; background: none; text-align: left; cursor: default; color: var(--text); }
.dg-row:hover { background: var(--hover); }
.dg-ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--tb); color: var(--ti); flex: none; }
.dg-n { font-weight: 700; font-size: 15px; min-width: 24px; }
.dg-l { flex: 1; font-size: 12.5px; color: var(--text-2); }
.pop-foot { padding: 8px 14px; border-top: 1px solid var(--line-2); font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }

/* toasts */
.toasts { position: fixed; right: 18px; bottom: 36px; display: flex; flex-direction: column; gap: 8px; z-index: 200; align-items: flex-end; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 9px; max-width: 420px; padding: 9px 8px 9px 12px; border-radius: 9px;
  background: #1f242b; color: #f0f2f4; box-shadow: var(--shadow-2); font-size: 12.5px; opacity: 0; transform: translateY(6px); transition: opacity .18s, transform .18s;
}
:root[data-theme="dark"] .toast { background: #2a2f37; }
.toast.in { opacity: 1; transform: none; }
.toast .ic { color: #6fd3a0; }
.toast.t-warn .ic, .toast.t-err .ic { color: #f2b45b; }
.toast.t-err .ic { color: #f08a84; }
.toast.t-info .ic { color: #8db3f2; }
.toast-msg { flex: 1; }
.toast-act { border: 0; background: rgba(255, 255, 255, .12); color: #fff; border-radius: 5px; padding: 3px 8px; font-size: 12px; font-weight: 600; }
.toast-x { border: 0; background: none; color: #aab; display: inline-flex; padding: 3px; border-radius: 4px; }
.toast-x:hover { background: rgba(255, 255, 255, .1); }

/* palette */
.pal-back { display: flex; justify-content: center; align-items: flex-start; padding-top: 11vh; background: rgba(18, 22, 28, .3); }
.palette { width: 640px; max-width: calc(100vw - 24px); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-3); overflow: hidden; display: flex; flex-direction: column; max-height: 70vh; }
.pal-top { display: flex; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--line-2); color: var(--muted); }
.pal-in { border: 0 !important; box-shadow: none !important; height: 50px; font-size: 15px; padding: 0; background: none; }
.pal-list { overflow: auto; padding: 6px; min-height: 0; }
.pal-g { font-size: 10.5px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); padding: 8px 10px 4px; }
.pal-i { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 7px; cursor: default; color: var(--text-2); }
.pal-i.on { background: var(--active); color: var(--text); }
.pal-i.on .ic { color: var(--accent); }
.pal-l { flex: 1; min-width: 0; display: flex; gap: 8px; align-items: baseline; overflow: hidden; white-space: nowrap; }
.pal-s { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.pal-h { font-size: 11px; color: var(--muted); font-family: var(--mono); }
.pal-empty { padding: 26px; text-align: center; color: var(--muted); }
.pal-foot { display: flex; gap: 14px; align-items: center; padding: 8px 14px; border-top: 1px solid var(--line-2); font-size: 11.5px; color: var(--muted); background: var(--surface-2); flex-wrap: wrap; }
.pal-foot span { display: inline-flex; align-items: center; gap: 4px; }

/* shortcuts / about */
.sc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 20px; }
.sc-row { display: flex; gap: 10px; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--line-2); font-size: 12.5px; color: var(--text-2); }
.sc-k { min-width: 92px; display: inline-flex; gap: 2px; }
.prose p { margin: 0 0 10px; line-height: 1.6; color: var(--text-2); }
.prose ul { margin: 0 0 10px; padding-left: 18px; line-height: 1.6; color: var(--text-2); }
.about { text-align: center; }
.about-mark { color: var(--brass); margin: 6px 0; }
.about-n { font: 600 20px/1.2 var(--font-display); }
.about .kv { text-align: left; margin: 16px 0 10px; }

/* ============================================================ status bar */
.statusbar {
  display: flex; align-items: center; gap: 2px; height: 26px; padding: 0 8px; background: var(--chrome); border-top: 1px solid var(--chrome-line);
  font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; user-select: none;
}
.st-seg { display: inline-flex; align-items: center; gap: 5px; padding: 0 8px; height: 20px; border-radius: 4px; border: 0; background: none; color: inherit; font-size: 11.5px; }
.st-seg + .st-seg:not(.sp) { border-left: 1px solid var(--chrome-line); border-radius: 0; }
.st-btn { cursor: default; }
.st-btn:hover { color: var(--text); background: var(--hover); }
.st-off { color: var(--g-ink); font-weight: 600; }
.st-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--g-ink); box-shadow: 0 0 0 3px var(--g-bg); }
.st-warn { color: var(--a-ink); }

/* ============================================================ lock screen */
.lock {
  position: fixed; inset: 0; z-index: 300; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px;
  background:
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(43, 76, 126, .05) 31px 32px),
    radial-gradient(900px 600px at 50% 30%, rgba(160, 119, 50, .10), transparent 70%),
    rgba(240, 238, 232, .78);
  backdrop-filter: blur(3px);
}
:root[data-theme="dark"] .lock { background: repeating-linear-gradient(0deg, transparent 0 31px, rgba(126, 166, 230, .05) 31px 32px), radial-gradient(900px 600px at 50% 30%, rgba(211, 170, 94, .08), transparent 70%), rgba(10, 12, 15, .85); }
.lock-card { width: 380px; max-width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-3); padding: 26px 28px 20px; text-align: center; }
.lock-card.shake { animation: shake .36s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.lock-brand { display: inline-flex; align-items: center; gap: 7px; font-weight: 650; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--brass); }
.lock-firm { font: 600 22px/1.25 var(--serif); margin-top: 14px; }
.lock-firm-s { color: var(--muted); font-size: 12.5px; margin-bottom: 18px; }
.lock-form { display: flex; flex-direction: column; gap: 10px; }
.lock-user { display: flex; align-items: center; gap: 10px; text-align: left; }
.lock-user select { height: 36px; }
.lock-pw { display: flex; gap: 8px; }
.lock-pw input { height: 38px; font-size: 14px; }
.lock-pw .btn { height: 38px; width: 44px; justify-content: center; padding: 0; }
.lock-err { color: var(--r-ink); font-size: 12px; min-height: 16px; }
.lock-hint { font-size: 12px; color: var(--text-2); background: var(--brass-soft); border-radius: 7px; padding: 7px 10px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.lock-hint code { font-weight: 700; color: var(--text); }
.lock-meta { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; margin-top: 16px; font-size: 11px; color: var(--muted); }
.lock-meta span { display: inline-flex; align-items: center; gap: 5px; }
.lock-foot { margin-top: 16px; font-size: 11.5px; color: var(--muted); }

/* ============================================================ print preview */
.print-modal .modal-body { background: var(--surface-3); padding: 18px; }
.print-stage { display: flex; justify-content: center; }
.a4 { width: 794px; max-width: 100%; background: #fff; box-shadow: var(--shadow-2); }
.a4-frame { width: 100%; height: 1123px; border: 0; display: block; background: #fff; }

/* ============================================================ dashboard */
.dash-hero { display: flex; gap: 16px; align-items: stretch; margin-bottom: 14px; flex-wrap: wrap; }
.season {
  flex: 1 1 420px; display: flex; gap: 16px; align-items: center; padding: 16px 18px; border-radius: 10px; min-width: 0;
  background: linear-gradient(120deg, var(--accent) 0%, color-mix(in srgb, var(--accent) 70%, #0b1424) 100%); color: #fff; position: relative; overflow: hidden;
}
:root[data-theme="dark"] .season { background: linear-gradient(120deg, #20365a 0%, #172741 100%); }
.season::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 39px, rgba(255, 255, 255, .05) 39px 40px); pointer-events: none; }
.season-days { font: 600 34px/1 var(--font-display); text-align: center; min-width: 72px; position: relative; z-index: 1; }
.season-days small { display: block; font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; opacity: .75; margin-top: 4px; }
.season-t { position: relative; z-index: 1; min-width: 0; flex: 1; }
.season-k { font-size: 10.5px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: #f0d9a8; }
.season-h { font: 600 17px/1.3 var(--font-display); margin: 3px 0 4px; }
.season-s { font-size: 12px; opacity: .8; }
.season-prog { position: relative; z-index: 1; width: 160px; flex: none; }
.season-prog .meter { background: rgba(255, 255, 255, .18); height: 7px; }
.season-prog .meter-f { background: #f0d9a8; }
.season-prog .sp-l { font-size: 11.5px; opacity: .85; margin-top: 6px; display: flex; justify-content: space-between; }
.pack-card { flex: 0 1 300px; display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 13px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.pack-card .pk-t { display: flex; align-items: center; gap: 7px; font-weight: 600; }
.pack-card .pk-t .ic { color: var(--g-ink); }
.pack-card .pk-s { font-size: 12px; color: var(--muted); }
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 11px 13px; text-align: left; cursor: default; display: flex; flex-direction: column; gap: 2px; min-width: 0; box-shadow: var(--shadow-1); }
.kpi:hover { border-color: var(--faint); }
.kpi-l { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-l .ic { color: var(--ti, var(--muted)); }
.kpi-v { font: 600 24px/1.15 var(--font-display); color: var(--text); }
.kpi-v.t-red { color: var(--r-ink); } .kpi-v.t-amber { color: var(--a-ink); }
.kpi-s { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.dash-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.dlist { list-style: none; margin: 0; padding: 0; }
.dlist li { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 1px solid var(--line-2); min-height: 42px; }
.dlist li:last-child { border-bottom: 0; }
.dlist li.clickable:hover { background: var(--hover); }
.dlist .dl-main { flex: 1; min-width: 0; }
.dlist .dl-t { font-weight: 560; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dlist .dl-s { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dlist .dl-r { text-align: right; flex: none; }
.daygroup { font-size: 11px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding: 8px 14px 6px; background: var(--surface-2); border-bottom: 1px solid var(--line-2); display: flex; justify-content: space-between; }
.daygroup.over { color: var(--r-ink); }
.rings { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; padding: 12px; }
.ring-cell { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px; border-radius: 8px; border: 0; background: none; cursor: default; color: var(--text); }
.ring-cell:hover { background: var(--hover); }
.ring-cell .rc-t { font-size: 12px; font-weight: 600; text-align: center; line-height: 1.25; }
.ring-cell .rc-s { font-size: 11px; color: var(--muted); }
.wl-row { display: grid; grid-template-columns: 130px minmax(0, 1fr) 40px; gap: 10px; align-items: center; padding: 7px 14px; }
.wl-row:hover { background: var(--hover); }
.wl-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--surface-3); }
.wl-bar span { display: block; height: 100%; }
.wl-n { text-align: right; font-weight: 600; font-size: 12.5px; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; vertical-align: 0; }
.qa { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 10px; }
.qa .btn { justify-content: flex-start; box-shadow: none; }

/* ============================================================ clients */
.c360-head { display: flex; gap: 14px; align-items: center; }
.c-mark { width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center; font: 600 15px/1 var(--serif); color: var(--accent); background: var(--accent-soft); flex: none; }
.c-mark.lg { width: 52px; height: 52px; font-size: 18px; }
.c360-ids { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.c360-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.svc-list { display: flex; flex-direction: column; gap: 0; }
.svc { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 12.5px; }
.svc:last-child { border-bottom: 0; }
.flags { display: flex; flex-wrap: wrap; gap: 5px; }
.flag { font-size: 11.5px; padding: 2px 8px; border-radius: 5px; background: var(--surface-3); color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(128, 128, 128, .4); }
.flag.on { background: var(--g-bg); color: var(--g-ink); text-decoration: none; }
.tl { list-style: none; margin: 0; padding: 0 0 0 4px; position: relative; }
.tl li { position: relative; padding: 0 0 12px 20px; font-size: 12.5px; }
.tl li::before { content: ""; position: absolute; left: 3px; top: 6px; bottom: -6px; width: 1px; background: var(--line); }
.tl li:last-child::before { display: none; }
.tl li::after { content: ""; position: absolute; left: 0; top: 4px; width: 7px; height: 7px; border-radius: 50%; background: var(--surface); border: 2px solid var(--ti, var(--faint)); }
.tl .tl-t { font-weight: 560; }
.tl .tl-s { color: var(--muted); font-size: 11.5px; }
.notes-list .nt { padding: 9px 11px; background: var(--brass-soft); border-radius: 7px; margin-bottom: 8px; font-size: 12.5px; }
.notes-list .nt-m { font-size: 11px; color: var(--muted); margin-top: 3px; }
.mini-tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.mini-tbl th { text-align: left; font-size: 11px; color: var(--muted); font-weight: 600; padding: 5px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.mini-tbl td { padding: 6px 8px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.mini-tbl tr:last-child td { border-bottom: 0; }
.mini-tbl tr.clickable:hover td { background: var(--hover); }
.wizard-steps { display: flex; gap: 4px; margin-bottom: 14px; }
.wz { flex: 1; display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); padding: 6px 8px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--line-2); }
.wz b { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 10.5px; background: var(--surface-3); color: var(--muted); }
.wz.on { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }
.wz.on b { background: var(--accent); color: var(--accent-ink); }
.wz.done b { background: var(--g-ink); color: #fff; }
.svc-pick { display: grid; grid-template-columns: 1fr 120px; gap: 6px 10px; align-items: center; }
.svc-pick .chk { padding: 4px 0; }

/* ============================================================ compliance */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.cal-h { padding: 7px 10px; font-size: 11px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--line); }
.cal-d { min-height: 104px; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); padding: 6px 7px; display: flex; flex-direction: column; gap: 3px; min-width: 0; cursor: default; }
.cal-d:nth-child(7n) { border-right: 0; }
.cal-d.out { background: var(--surface-2); }
.cal-d.out .cal-n { color: var(--faint); }
.cal-d.today { background: color-mix(in srgb, var(--accent-soft) 60%, var(--surface)); }
.cal-d.today .cal-n { background: var(--accent); color: var(--accent-ink); }
.cal-d.sel { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-d:hover { background: var(--hover); }
.cal-n { font-size: 12px; font-weight: 600; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: var(--text-2); }
.cal-top { display: flex; align-items: center; justify-content: space-between; }
.cal-cnt { font-size: 10.5px; color: var(--muted); }
.cal-ev { display: flex; align-items: center; gap: 5px; font-size: 11px; padding: 1px 6px; border-radius: 4px; background: var(--tb, var(--surface-3)); color: var(--ti, var(--text-2)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-ev b { font-weight: 650; }
.cal-more { font-size: 10.5px; color: var(--muted); padding-left: 6px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start; }
.side-panel { position: sticky; top: 0; }
.mx-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); flex: 1 1 auto; min-height: 260px; }
.mx { border-collapse: separate; border-spacing: 0; font-size: 12px; }
.mx th, .mx td { border-bottom: 1px solid var(--line-2); border-right: 1px solid var(--line-2); padding: 0; }
.mx thead th { position: sticky; top: 0; background: var(--surface-2); z-index: 2; font-size: 11px; font-weight: 600; color: var(--muted); padding: 6px 6px; text-align: center; white-space: nowrap; height: 44px; min-width: 64px; }
.mx thead th .mx-h { display: block; color: var(--text-2); }
.mx thead th .mx-d { display: block; font-weight: 500; font-size: 10.5px; }
.mx .mx-c { position: sticky; left: 0; background: var(--surface); z-index: 1; text-align: left; padding: 0 10px; min-width: 230px; max-width: 230px; height: 34px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 550; }
.mx thead th.mx-c { z-index: 3; background: var(--surface-2); }
.mx-cell { width: 100%; height: 33px; border: 0; background: none; display: flex; align-items: center; justify-content: center; cursor: default; padding: 0 4px; }
.mx-cell:hover { background: var(--hover); }
.mx-cell.sel { box-shadow: inset 0 0 0 2px var(--accent); background: var(--accent-soft); }
.mx-st { width: 100%; height: 22px; border-radius: 5px; display: flex; align-items: center; justify-content: center; gap: 3px; font-size: 10.5px; font-weight: 600; background: var(--tb); color: var(--ti); white-space: nowrap; }
.mx-st.over { box-shadow: inset 0 0 0 1.5px var(--r-ink); }
.mx-na { color: var(--faint); }
.mx-legend { display: flex; gap: 10px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); align-items: center; }
.mx-legend .mx-st { width: auto; padding: 0 7px; display: inline-flex; }
.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.bcard { padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); cursor: default; text-align: left; display: flex; flex-direction: column; gap: 8px; color: var(--text); box-shadow: var(--shadow-1); }
.bcard:hover { border-color: var(--faint); }
.bcard-t { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.bcard-t b { font-size: 13px; }
.stackbar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--surface-3); }
.stackbar span { height: 100%; }
.toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar .fsel { max-width: 200px; }
.lawswitch { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); }
.ci-head { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.status-steps { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 14px; }
.status-steps button { border: 1px solid var(--line); background: var(--surface); border-radius: 6px; padding: 4px 9px; font-size: 12px; cursor: default; color: var(--text-2); }
.status-steps button:hover { border-color: var(--faint); }
.status-steps button.on { background: var(--tb); color: var(--ti); border-color: transparent; font-weight: 600; }

/* ============================================================ jobs kanban */
.kanban { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: 10px; flex: 1 1 auto; min-height: 0; overflow-x: auto; padding-bottom: 4px; }
.kcol { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 10px; display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.kcol.drop { border-color: var(--accent); background: var(--accent-soft); }
.kcol-h { display: flex; align-items: center; gap: 7px; padding: 9px 11px; font-weight: 600; font-size: 12.5px; }
.kcol-h .pill { margin-left: auto; }
.kcol-b { flex: 1; overflow-y: auto; padding: 2px 7px 8px; display: flex; flex-direction: column; gap: 7px; min-height: 60px; }
.kcard { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; box-shadow: var(--shadow-1); cursor: grab; display: flex; flex-direction: column; gap: 6px; text-align: left; color: var(--text); }
.kcard:hover { border-color: var(--faint); }
.kcard.dragging { opacity: .45; }
.kcard-t { font-weight: 560; font-size: 12.5px; line-height: 1.35; }
.kcard-c { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kcard-f { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.kcard-f > span { white-space: nowrap; }
.kcard-f .sp { flex: 1; }
.kprog { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.kprog .meter { flex: 1; height: 4px; }
.chklist { list-style: none; margin: 0; padding: 0; }
.chklist li { display: flex; align-items: center; gap: 9px; padding: 6px 0; border-bottom: 1px solid var(--line-2); font-size: 12.5px; }
.chklist li.done span { color: var(--muted); text-decoration: line-through; }
.chklist li:last-child { border-bottom: 0; }
.staff-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.scard { border: 1px solid var(--line); border-radius: 9px; padding: 12px; background: var(--surface); display: flex; flex-direction: column; gap: 8px; cursor: default; text-align: left; color: var(--text); }
.scard:hover { border-color: var(--faint); }
.scard-h { display: flex; gap: 9px; align-items: center; }
.scard-n { font-weight: 600; font-size: 12.5px; }
.scard-r { font-size: 11.5px; color: var(--muted); }
.scard-k { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; text-align: center; }
.scard-k b { display: block; font-size: 16px; font-weight: 650; }
.scard-k span { font-size: 10.5px; color: var(--muted); }

/* ============================================================ documents */
.docs-split { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 14px; flex: 1 1 auto; min-height: 0; }
.tree { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; padding: 6px; min-height: 0; }
.tree-i { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 6px; font-size: 12.5px; cursor: default; color: var(--text-2); width: 100%; border: 0; background: none; text-align: left; }
.tree-i:hover { background: var(--hover); color: var(--text); }
.tree-i.on { background: var(--active); color: var(--accent); font-weight: 600; }
.tree-i .tw { width: 14px; display: inline-flex; color: var(--faint); }
.tree-i .tn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-i .tc { font-size: 10.5px; color: var(--muted); }
.tree-kids { padding-left: 14px; }
.fileic { width: 26px; height: 30px; border-radius: 4px; display: inline-grid; place-items: center; font-size: 8.5px; font-weight: 750; letter-spacing: .03em; color: #fff; flex: none; text-transform: uppercase; }
.fileic.pdf { background: #c0453a; } .fileic.xlsx { background: #2f7d4f; } .fileic.zip { background: #6b6f78; } .fileic.jpg { background: #3d6fb0; } .fileic.docx { background: #2f5ea8; }
.dropzone { border: 1.5px dashed var(--line); border-radius: 9px; padding: 14px; text-align: center; color: var(--muted); font-size: 12.5px; background: var(--surface-2); }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.req-card { border: 1px solid var(--line); border-radius: 9px; background: var(--surface); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; cursor: default; text-align: left; color: var(--text); }
.req-card:hover { border-color: var(--faint); }
.req-items li { justify-content: space-between; }
.draft-box { white-space: pre-wrap; font-family: var(--font); font-size: 12.5px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; max-height: 320px; overflow: auto; line-height: 1.55; }

/* ============================================================ DSC */
.dsc-timeline { position: relative; height: 92px; margin: 4px 6px 0; }
.dt-axis { position: absolute; left: 0; right: 0; top: 54px; height: 2px; background: var(--line); }
.dt-zone { position: absolute; top: 18px; bottom: 30px; border-radius: 4px; }
.dt-tick { position: absolute; top: 60px; font-size: 10.5px; color: var(--muted); transform: translateX(-50%); white-space: nowrap; }
.dt-tick::before { content: ""; position: absolute; left: 50%; top: -9px; width: 1px; height: 6px; background: var(--faint); }
.dt-dot { position: absolute; top: 47px; width: 15px; height: 15px; border-radius: 50%; border: 2px solid var(--surface); transform: translateX(-50%); cursor: default; padding: 0; box-shadow: 0 0 0 1px var(--line); }
.dt-dot:hover { transform: translateX(-50%) scale(1.25); z-index: 2; }
.dt-today { position: absolute; top: 8px; bottom: 22px; width: 2px; background: var(--accent); }
.dt-today span { position: absolute; top: -2px; left: 5px; font-size: 10.5px; font-weight: 650; color: var(--accent); white-space: nowrap; }
.loc { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; }
.dsc-alerts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.moves li { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; border-bottom: 1px solid var(--line-2); font-size: 12.5px; }
.mv-ic { width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; flex: none; background: var(--tb); color: var(--ti); }

/* ============================================================ responsive */
@media (max-width: 1279px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1fr) 300px; }
  .cmd-search span { font-size: 12px; }
}
@media (max-width: 1100px) {
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
  .dsc-alerts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1023px) {
  .split, .c360-grid, .docs-split { grid-template-columns: minmax(0, 1fr); }
  .side-panel { position: static; }
  .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .menubar button:nth-child(n+3) { display: none; }
  .tb-title { font-size: 12px; }
}
@media (max-width: 760px) {
  .menubar, .crumbs, .cmd-search kbd, .ub-n, #lp-theme-btn { display: none; }
  .tb-title { text-align: left; padding-left: 4px; }
  .titlebar { grid-template-columns: auto minmax(0, 1fr) auto; }
  .winctl { width: 38px; }
  .view-inner { padding: 14px 12px 24px; }
  .kpis, .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); }
  .frm.cols-2, .frm.cols-3 { grid-template-columns: minmax(0, 1fr); }
  .st-hide-s, .statusbar .st-seg:nth-child(2), .statusbar .st-seg:nth-child(3) { display: none; }
  .season { flex-direction: column; align-items: flex-start; }
  .season-prog { width: 100%; }
  .search-in { width: 100%; }
  .cal-d { min-height: 64px; padding: 3px; }
  .cal-ev { font-size: 9.5px; padding: 0 3px; }
  .kanban { grid-template-columns: repeat(5, 240px); }
  .sc-grid { grid-template-columns: 1fr; }
  .dsc-alerts { grid-template-columns: minmax(0, 1fr); }
  .cmdbar { gap: 6px; padding: 0 8px 0 4px; }
  .cmd-search { flex: 1 1 auto; margin: 0; }
  #lp-newbtn span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
@media print {
  body { overflow: visible; background: #fff; }
  .window { position: static; display: block; }
  .titlebar, .sidebar, .cmdbar, .statusbar, .narrow-note, .ph-actions, .tbl-tools, #lp-layer, .toasts { display: none !important; }
  .win-body { display: block; }
  .lp-view { overflow: visible; }
}

/* compact (1024–1279): keep the breadcrumb readable */
body.compact .crumbs .cr:first-child, body.compact .crumbs .cr:first-child + .cr-sep { display: none; }
body.compact { --sbw: 204px; }
body.compact.narrow, body.compact.sb-collapsed { --sbw: 56px; }
