/* HMCL design system — slate & teal, light and dark. No external fonts or assets: everything ships in the bundle. */
:root {
  --bg: #f3f5f9; --surface: #ffffff; --surface-2: #f8fafc; --ink: #0f172a; --ink-2: #334155; --muted: #64748b;
  --line: #e3e8ef; --line-2: #cfd8e3; --accent: #0d9488; --accent-2: #0f766e; --accent-soft: #ccfbf1; --accent-ink: #ffffff;
  --nav: #0f172a; --nav-2: #1e293b; --nav-ink: #cbd5e1; --nav-muted: #64748b;
  --ok: #15803d; --ok-bg: #dcfce7; --warn: #b45309; --warn-bg: #fef3c7; --bad: #b91c1c; --bad-bg: #fee2e2;
  --info: #1d4ed8; --info-bg: #dbeafe; --violet: #6d28d9; --violet-bg: #ede9fe; --gray-bg: #eef2f7;
  --shadow: 0 1px 2px rgba(15,23,42,.06), 0 1px 3px rgba(15,23,42,.05);
  --shadow-lg: 0 10px 30px rgba(15,23,42,.18), 0 2px 6px rgba(15,23,42,.08);
  --r: 10px; --r-sm: 7px; --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace; color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0a1020; --surface: #111a2e; --surface-2: #0e1729; --ink: #e8eef8; --ink-2: #c3cfe0; --muted: #8696b0;
  --line: #22304a; --line-2: #31425f; --accent: #2dd4bf; --accent-2: #5eead4; --accent-soft: #123b3a; --accent-ink: #042f2e;
  --nav: #070c18; --nav-2: #131d33; --ok: #4ade80; --ok-bg: #12351f; --warn: #fbbf24; --warn-bg: #3a2c0b; --bad: #f87171; --bad-bg: #3b1518;
  --info: #7cb0ff; --info-bg: #14284f; --violet: #b69cff; --violet-bg: #2a2050; --gray-bg: #1a2640;
  --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-lg: 0 10px 30px rgba(0,0,0,.55); color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font: 14px/1.45 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; overflow: hidden; }
svg { width: 18px; height: 18px; flex: none; } /* default icon size; components override */
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 20px; } h2 { font-size: 16px; } h3 { font-size: 14px; }
a { color: var(--accent-2); text-decoration: none; } a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
kbd { font: 11px var(--mono); background: var(--gray-bg); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; color: var(--ink-2); }
.mono { font-family: var(--mono); font-size: 12.5px; } .muted { color: var(--muted); } .right { text-align: right; } .nowrap { white-space: nowrap; }
.hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::-webkit-scrollbar { width: 11px; height: 11px; } ::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 8px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); background-clip: content-box; border: 3px solid transparent; }

/* ───── Shell ───── */
#app { height: 100%; }
#app.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
#app.shell.collapsed { grid-template-columns: 64px minmax(0, 1fr); }
.nav { background: var(--nav); color: var(--nav-ink); display: flex; flex-direction: column; padding: 14px 10px; gap: 2px; overflow: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 16px; color: #fff; font-weight: 700; letter-spacing: .02em; }
.brand .logo { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, #14b8a6, #0d9488); display: grid; place-items: center; font-size: 13px; color: #fff; flex: none; box-shadow: 0 2px 8px rgba(20,184,166,.35); }
.brand small { display: block; font-weight: 500; color: var(--nav-muted); font-size: 11px; letter-spacing: 0; }
.nav-h { font-size: 10.5px; font-weight: 700; letter-spacing: .09em; color: var(--nav-muted); padding: 14px 12px 6px; text-transform: uppercase; }
.nav a.item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 8px; color: var(--nav-ink); font-weight: 520; text-decoration: none; position: relative; }
.nav a.item:hover { background: var(--nav-2); color: #fff; }
.nav a.item.active { background: rgba(45,212,191,.14); color: #fff; }
.nav a.item.active::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: #2dd4bf; }
.nav a.item svg { width: 18px; height: 18px; flex: none; opacity: .9; }
.nav a.item .label { white-space: nowrap; overflow: hidden; }
.nav a.item .count { margin-left: auto; font-size: 11px; background: #2dd4bf; color: #042f2e; border-radius: 9px; padding: 0 6px; font-weight: 700; }
#app.collapsed .label, #app.collapsed .nav-h, #app.collapsed .brand div:last-child, #app.collapsed .count { display: none; }
.nav .spacer { flex: 1; }
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100%; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 10px 22px; background: var(--surface); border-bottom: 1px solid var(--line); height: 56px; flex: none; }
.topbar h1 { white-space: nowrap; }
.crumbs { color: var(--muted); font-size: 13px; display: flex; gap: 6px; align-items: center; white-space: nowrap; }
.search-pill { margin-left: auto; display: flex; align-items: center; gap: 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; min-width: 300px; color: var(--muted); cursor: pointer; }
.search-pill:hover { border-color: var(--line-2); } .search-pill svg { width: 16px; height: 16px; } .search-pill kbd { margin-left: auto; }
.conn { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); } .dot.off { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-bg); }
.userbtn { display: flex; align-items: center; gap: 9px; padding: 4px 8px 4px 4px; border-radius: 999px; border: 1px solid transparent; background: none; cursor: pointer; }
.userbtn:hover { background: var(--surface-2); border-color: var(--line); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-2); display: grid; place-items: center; font-weight: 700; font-size: 12px; }
.banner { background: var(--warn-bg); color: var(--warn); padding: 8px 22px; font-weight: 550; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: center; }
.banner.bad { background: var(--bad-bg); color: var(--bad); }
.content { flex: 1; min-width: 0; min-height: 0; overflow: auto; container: workspace / inline-size; padding: 22px 26px 40px; }
.page-head { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 2px; } .page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ───── Controls ───── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-weight: 560; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s, transform .05s; }
.btn:hover { background: var(--surface-2); border-color: var(--muted); } .btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; flex: none; }
.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(--bad); border-color: var(--bad-bg); } .btn.danger:hover { background: var(--bad-bg); border-color: var(--bad); }
.btn.ghost { border-color: transparent; background: none; } .btn.ghost:hover { background: var(--gray-bg); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 13px; } .btn.icon { width: 34px; padding: 0; } .btn.sm.icon { width: 28px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn .spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label { font-size: 12px; font-weight: 600; color: var(--ink-2); letter-spacing: .01em; }
.field > label .req { color: var(--bad); margin-left: 2px; }
.field .hint { font-size: 12px; color: var(--muted); } .field .err { font-size: 12px; color: var(--bad); font-weight: 550; }
.input, select.input, textarea.input { height: 34px; width: 100%; padding: 0 11px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-sm); transition: border-color .12s, box-shadow .12s; }
textarea.input { height: auto; min-height: 76px; padding: 8px 11px; resize: vertical; }
.input:hover { border-color: var(--muted); } .input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.invalid { border-color: var(--bad); box-shadow: 0 0 0 3px var(--bad-bg); }
.input[readonly], .input[disabled] { background: var(--surface-2); color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); gap: 14px 16px; }
.form-grid .wide { grid-column: 1 / -1; } .form-grid .half { grid-column: span 2; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; } .check input { width: 16px; height: 16px; accent-color: var(--accent); }
.seg { display: inline-flex; background: var(--gray-bg); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; padding: 5px 12px; border-radius: 7px; cursor: pointer; font-weight: 560; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--gray-bg); color: var(--ink-2); white-space: nowrap; }
.chip.ok { background: var(--ok-bg); color: var(--ok); } .chip.warn { background: var(--warn-bg); color: var(--warn); } .chip.bad { background: var(--bad-bg); color: var(--bad); }
.chip.info { background: var(--info-bg); color: var(--info); } .chip.violet { background: var(--violet-bg); color: var(--violet); }
.chip.btn-like { cursor: pointer; border: 1px solid var(--line-2); background: var(--surface); } .chip.btn-like.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-2); }

/* ───── Cards, tables ───── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--line); } .card-h .grow { flex: 1; }
.card-b { padding: 16px; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: inherit; position: relative; overflow: hidden; }
.stat:hover { border-color: var(--accent); text-decoration: none; }
.stat .cap { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.stat .cap svg { width: 16px; height: 16px; } .stat .val { font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.stat .foot { font-size: 12px; color: var(--muted); } .stat.alert .val { color: var(--bad); } .stat.good .val { color: var(--ok); }
.cols { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); align-items: start; }
.table-wrap { overflow: auto; border-radius: var(--r); }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; }
table.t th { position: sticky; top: 0; z-index: 1; text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; background: var(--surface-2); padding: 9px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; user-select: none; }
table.t th.sortable { cursor: pointer; } table.t th.sortable:hover { color: var(--ink); }
table.t td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tbody tr:last-child td { border-bottom: 0; }
table.t tbody tr { transition: background .08s; } table.t tbody tr.click { cursor: pointer; } table.t tbody tr:hover { background: var(--surface-2); }
table.t tbody tr.sel { background: var(--accent-soft); } table.t tbody tr.kb { outline: 2px solid var(--accent); outline-offset: -2px; }
table.t td.num, table.t th.num { text-align: right; font-variant-numeric: tabular-nums; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .grow { flex: 1; }
.searchbox { position: relative; min-width: 260px; } .searchbox svg { position: absolute; left: 10px; top: 9px; width: 16px; height: 16px; color: var(--muted); } .searchbox .input { padding-left: 33px; }
.empty { text-align: center; padding: 46px 20px; color: var(--muted); } .empty svg { width: 38px; height: 38px; opacity: .5; margin-bottom: 8px; } .empty b { display: block; color: var(--ink-2); font-size: 15px; margin-bottom: 4px; }
.pager { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; } .pager .grow { flex: 1; }
.skel { background: linear-gradient(90deg, var(--gray-bg) 25%, var(--surface-2) 37%, var(--gray-bg) 63%); background-size: 400% 100%; animation: shimmer 1.3s infinite; border-radius: 6px; height: 14px; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.bars { display: flex; flex-direction: column; gap: 9px; } .bar { display: grid; grid-template-columns: 150px 1fr 48px; align-items: center; gap: 10px; font-size: 13px; }
.bar i { display: block; height: 10px; border-radius: 6px; background: linear-gradient(90deg, #14b8a6, #0d9488); min-width: 3px; } .bar .track { background: var(--gray-bg); border-radius: 6px; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; } .kv dt { color: var(--muted); font-weight: 560; } .kv dd { margin: 0; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow: auto; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 9px 14px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; margin-bottom: -1px; }
.tabs button:hover { color: var(--ink); } .tabs button.on { color: var(--accent-2); border-bottom-color: var(--accent); }
.list-row { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); } .list-row:last-child { border-bottom: 0; }
.list-row.click { cursor: pointer; } .list-row.click:hover { background: var(--surface-2); } .list-row .grow { flex: 1; min-width: 0; } .list-row .t { font-weight: 600; } .list-row .s { font-size: 12.5px; color: var(--muted); }
.tech-group { margin-bottom: 18px; } .tech-group > h3 { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.ticket { font: 700 13px var(--mono); background: var(--ink); color: var(--surface); border-radius: 6px; padding: 2px 8px; letter-spacing: .06em; }

/* ───── Overlays ───── */
.scrim { position: fixed; inset: 0; background: rgba(8,13,25,.5); backdrop-filter: blur(2px); z-index: 50; display: grid; place-items: center; animation: fade .12s; }
.scrim.right { place-items: stretch end; }
.dialog { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); width: min(560px, calc(100vw - 40px)); max-height: calc(100vh - 60px); display: flex; flex-direction: column; animation: pop .14s; border: 1px solid var(--line); }
.dialog.wide { width: min(860px, calc(100vw - 40px)); }
.drawer { background: var(--surface); width: min(620px, 100vw); height: 100%; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slide .18s; border-left: 1px solid var(--line); }
.dh { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); } .dh h2 { flex: 1; }
.db { padding: 20px; overflow: auto; flex: 1; } .df { display: flex; gap: 8px; justify-content: flex-end; align-items: center; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 14px 14px; }
.df .grow { flex: 1; color: var(--muted); font-size: 12.5px; }
@keyframes fade { from { opacity: 0; } } @keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } } @keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast { background: var(--ink); color: var(--surface); padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: center; max-width: 420px; animation: pop .15s; font-weight: 520; }
.toast.ok svg { color: #4ade80; } .toast.bad { background: #7f1d1d; color: #fff; } .toast .undo { color: #5eead4; font-weight: 700; cursor: pointer; background: none; border: 0; padding: 0 0 0 6px; }
.palette { width: min(640px, calc(100vw - 40px)); align-self: start; margin-top: 12vh; }
.palette input { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: none; padding: 16px 20px; font-size: 16px; outline: none; border-radius: 14px 14px 0 0; }
.palette .results { max-height: 52vh; overflow: auto; padding: 6px; }
.palette .grp { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; padding: 10px 12px 4px; }
.palette .res { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 8px; cursor: pointer; } .palette .res svg { width: 17px; height: 17px; color: var(--muted); }
.palette .res.on { background: var(--accent-soft); } .palette .res .s { color: var(--muted); font-size: 12.5px; margin-left: auto; white-space: nowrap; }
.palette .foot { display: flex; gap: 16px; padding: 9px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.menu { position: fixed; z-index: 80; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 5px; min-width: 190px; animation: pop .1s; }
.menu button { display: flex; width: 100%; gap: 10px; align-items: center; background: none; border: 0; padding: 8px 10px; border-radius: 7px; cursor: pointer; text-align: left; } .menu button:hover { background: var(--gray-bg); } .menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; } .menu svg { width: 16px; height: 16px; color: var(--muted); }
.ac { position: relative; } .ac-pop { position: fixed; z-index: 2100; background: var(--surface); border: 1px solid var(--line-2); border-radius: 9px; box-shadow: var(--shadow-lg); max-height: 260px; overflow: auto; padding: 4px; }
.ac-pop .opt { padding: 7px 10px; border-radius: 6px; cursor: pointer; display: flex; flex-direction: column; } .ac-pop .opt.on { background: var(--accent-soft); } .ac-pop .opt small { color: var(--muted); }
.ac .picked { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 6px 0 11px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); } .ac .picked span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ───── Editable grid (spreadsheet-style) ───── */
.sheet { border: 1px solid var(--line); border-radius: var(--r); overflow: auto; background: var(--surface); }
.sheet table { border-collapse: separate; border-spacing: 0; width: 100%; }
.sheet th { position: sticky; top: 0; background: var(--surface-2); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 8px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.sheet td { padding: 0; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); } .sheet td:last-child { border-right: 0; }
.sheet td.rn { width: 34px; text-align: center; color: var(--muted); font-size: 12px; background: var(--surface-2); }
.sheet td input, .sheet td select { width: 100%; height: 34px; border: 0; background: transparent; padding: 0 9px; outline: none; font-variant-numeric: tabular-nums; }
.sheet td input:focus, .sheet td select:focus { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.sheet td.calc { background: var(--surface-2); color: var(--ink-2); padding: 0 9px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sheet td.calc.bad { color: var(--bad); } .sheet td.x { width: 32px; text-align: center; } .sheet tr.cancelled td { opacity: .5; text-decoration: line-through; }
.sheet-foot { display: flex; align-items: center; gap: 10px; padding: 8px 10px; color: var(--muted); font-size: 12.5px; }
.totals { margin-left: auto; width: 320px; } .totals div { display: flex; justify-content: space-between; padding: 5px 0; } .totals .grand { border-top: 2px solid var(--ink); margin-top: 6px; padding-top: 10px; font-size: 18px; font-weight: 700; }
.wizard-steps { display: flex; gap: 8px; margin-bottom: 18px; } .wizard-steps .st { flex: 1; padding: 8px 12px; border-radius: 8px; background: var(--gray-bg); color: var(--muted); font-weight: 600; font-size: 13px; } .wizard-steps .st.on { background: var(--accent-soft); color: var(--accent-2); } .wizard-steps .st.done { color: var(--ok); }

/* ───── Login ───── */
.login { height: 100%; display: grid; grid-template-columns: 1.1fr 1fr; }
.login .hero { background: radial-gradient(1200px 600px at 10% 0%, #134e4a 0%, transparent 60%), linear-gradient(160deg, #0b1324, #0f172a 60%, #0c2a3a); color: #e2e8f0; padding: 60px; display: flex; flex-direction: column; justify-content: center; gap: 22px; }
.login .hero h1 { font-size: 38px; line-height: 1.12; letter-spacing: -.03em; color: #fff; max-width: 14ch; } .login .hero p { color: #94a3b8; max-width: 44ch; font-size: 15.5px; }
.login .hero ul { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 10px; color: #cbd5e1; } .login .hero li { display: flex; gap: 10px; align-items: center; } .login .hero li svg { width: 18px; height: 18px; color: #2dd4bf; }
.login .panel { display: grid; place-items: center; padding: 30px; background: var(--bg); overflow: auto; } .login form { width: min(380px, 100%); display: grid; gap: 15px; }
.login form h2 { font-size: 22px; } .recent { display: flex; gap: 6px; flex-wrap: wrap; }
@media (max-width: 880px) { .login { grid-template-columns: 1fr; } .login .hero { display: none; } #app.shell { grid-template-columns: 64px 1fr; } .label, .nav-h { display: none !important; }   .search-pill { min-width: 0; } .search-pill span { display: none; } }
@media print {
  body { overflow: visible; background: #fff; color: #000; } #app { display: block; } .nav, .topbar, .toasts, .no-print, .banner { display: none !important; }
  .content { padding: 0; overflow: visible; } .card { box-shadow: none; border-color: #bbb; } .scrim { position: static; background: none; backdrop-filter: none; display: block; }
  .dialog, .drawer { box-shadow: none; border: 0; width: 100%; max-height: none; } .df, .dh .btn { display: none !important; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Printing a dialog (report / invoice): hide the whole app and show only the document. */
body.printing #app, body.printing .toasts { display: none !important; }
@media print {
  body.printing .scrim { position: static; background: none; display: block; padding: 0; }
  body.printing .dialog { width: 100%; max-width: none; border: 0; box-shadow: none; max-height: none; }
  body.printing .dh, body.printing .df { display: none !important; }
  body.printing .db { padding: 0; overflow: visible; }
  .doc { color: #000; }
}
.doc { font-size: 12.5px; line-height: 1.4; } .doc h1 { font-size: 22px; } .doc h2 { font-size: 14px; margin: 18px 0 6px; text-transform: uppercase; letter-spacing: .05em; }
.doc .meta { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 28px; margin: 12px 0; } .doc .meta div { display: flex; gap: 8px; } .doc .meta b { min-width: 120px; color: var(--muted); font-weight: 600; }
.doc table { width: 100%; border-collapse: collapse; margin-bottom: 8px; } .doc th, .doc td { border: 1px solid var(--line-2); padding: 4px 7px; text-align: left; } .doc th { background: var(--surface-2); font-size: 11px; text-transform: uppercase; letter-spacing: .03em; }
.doc td.num, .doc th.num { text-align: right; font-variant-numeric: tabular-nums; } .doc .sig { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 42px; } .doc .sig div { border-top: 1px solid var(--ink); padding-top: 4px; color: var(--muted); }
.doc .banner-doc { display: flex; justify-content: space-between; border-bottom: 3px solid var(--accent); padding-bottom: 10px; }

/* ───── Help centre & rendered Markdown ───── */
.help-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr) 210px; gap: 18px; align-items: start; }
.help-layout.kb { grid-template-columns: 0 minmax(0, 1fr) 210px; } .help-layout.kb > span { display: none; }
.help-nav { padding: 8px; position: sticky; top: 0; } .help-nav a { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; color: var(--ink-2); font-weight: 560; text-decoration: none; }
.help-nav a:hover { background: var(--gray-bg); } .help-nav a.on { background: var(--accent-soft); color: var(--accent-2); }
.help-nav .n { width: 22px; height: 22px; border-radius: 50%; background: var(--gray-bg); display: grid; place-items: center; font-size: 12px; flex: none; } .help-nav a.on .n { background: var(--accent); color: var(--accent-ink); }
.help-toc { position: sticky; top: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; } .help-toc b { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.help-toc a { color: var(--ink-2); } .help-toc a.l3 { padding-left: 12px; color: var(--muted); }
.help-pager { display: flex; justify-content: space-between; align-items: center; margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); }
.md { max-width: 78ch; font-size: 15px; line-height: 1.65; } .md > :first-child { margin-top: 0; }
.md h1 { font-size: 26px; margin: 0 0 14px; } .md h2 { font-size: 20px; margin: 30px 0 10px; padding-top: 6px; border-top: 1px solid var(--line); } .md h3 { font-size: 16px; margin: 22px 0 8px; } .md h4 { margin: 16px 0 6px; }
.md p { margin: 0 0 14px; } .md ul, .md ol { margin: 0 0 14px; padding-left: 24px; } .md li { margin: 4px 0; } .md li > ul, .md li > ol { margin: 4px 0 4px; }
.md code { font: 13px var(--mono); background: var(--gray-bg); padding: 1px 6px; border-radius: 5px; } .md pre { background: var(--nav); color: #e2e8f0; padding: 14px 16px; border-radius: 10px; overflow: auto; margin: 0 0 16px; } .md pre code { background: none; padding: 0; color: inherit; }
.md figure { margin: 18px 0 22px; } .md figure img, .md .md-img { max-width: 100%; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); } .md figcaption { text-align: center; color: var(--muted); font-size: 13px; margin-top: 8px; }
.md .md-table { overflow: auto; margin-bottom: 16px; } .md table { border-collapse: collapse; width: 100%; font-size: 14px; } .md th, .md td { border: 1px solid var(--line-2); padding: 7px 11px; text-align: left; } .md th { background: var(--surface-2); }
.md blockquote { margin: 0 0 16px; padding: 10px 16px; border-left: 4px solid var(--line-2); background: var(--surface-2); border-radius: 0 8px 8px 0; } .md blockquote p:last-child { margin: 0; }
.md blockquote.callout.tip { border-color: var(--ok); background: var(--ok-bg); } .md blockquote.callout.note { border-color: var(--info); background: var(--info-bg); } .md blockquote.callout.warning, .md blockquote.callout.important { border-color: var(--warn); background: var(--warn-bg); }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; } .md kbd { font-size: 12px; }
@media (max-width: 1180px) { .help-layout, .help-layout.kb { grid-template-columns: 200px minmax(0, 1fr); } .help-toc { display: none; } .help-layout.kb { grid-template-columns: 1fr; } }
@media print { .help-layout { display: block; } .help-nav { display: none; } .md figure { break-inside: avoid; } .md h2 { break-after: avoid; } }

/* Polish: soft entry for each screen, a shimmer while it loads, calmer press feedback. */
.view-in { animation: viewIn .22s ease-out both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.view-skel { display: grid; gap: 14px; padding: 6px 2px; }
.view-skel i { display: block; height: 54px; border-radius: 12px; background: linear-gradient(90deg, var(--surface-2) 25%, var(--line) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; }
.view-skel i:first-child { height: 34px; width: 38%; } .view-skel i:last-child { height: 220px; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.btn { transition: background-color .12s, border-color .12s, box-shadow .12s, transform .06s; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.dialog { animation: dialogIn .16s ease-out both; }
@keyframes dialogIn { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }

/* ───── Dashboard ───── */
.dash-hero { display: grid; grid-template-columns: 1fr auto; gap: 8px 18px; align-items: center; padding: 18px 22px; margin-bottom: 14px; border-radius: 14px; color: #fff;
  background: linear-gradient(120deg, #0f2a43 0%, #0f5f5a 100%); box-shadow: var(--shadow); }
.dash-hello h2 { font: 700 24px var(--font); margin: 0; } .dash-hello p { margin: 2px 0 0; color: #b6c8d6; font-size: 14px; }
.dash-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .dash-controls .lg-input { width: 170px; color: #0f172a; background: #fff; } .dash-controls .btn { color: #0f172a; }
.dash-quick { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.dash-chip { display: inline-flex; align-items: center; gap: 7px; border: 1px solid rgba(255,255,255,.22); background: rgba(255,255,255,.1); color: #fff; border-radius: 999px; padding: 6px 14px; cursor: pointer; font-size: 13.5px; }
.dash-chip:hover { background: rgba(255,255,255,.2); } .dash-chip svg { width: 16px; height: 16px; }
.dash-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 14px; }
.dash-tile { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; color: inherit; text-decoration: none; box-shadow: var(--shadow); transition: transform .12s, border-color .12s; }
a.dash-tile:hover { transform: translateY(-1px); border-color: var(--accent); text-decoration: none; }
.dash-tile .chip { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex: none; } .dash-tile .chip svg { width: 20px; height: 20px; }
.dash-tile .val { font: 700 26px/1.1 var(--font); font-variant-numeric: tabular-nums; } .dash-tile .cap { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.dash-tile.info .chip { background: var(--info-bg); color: var(--info); } .dash-tile.ok .chip { background: var(--ok-bg); color: var(--ok); } .dash-tile.warn .chip { background: var(--warn-bg); color: var(--warn); }
.dash-tile.bad .chip { background: var(--bad-bg); color: var(--bad); } .dash-tile.bad .val { color: var(--bad); } .dash-tile.bad.calm .val { color: inherit; } .dash-tile.violet .chip { background: var(--violet-bg); color: var(--violet); }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; align-items: start; }
.dash-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.dash-card > header { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.dash-card h3 { display: flex; align-items: center; gap: 8px; font-size: 15px; } .dash-card h3 svg { color: var(--accent); width: 18px; height: 18px; }
.dash-link { background: none; border: 0; color: var(--accent-2); cursor: pointer; font-size: 13px; } .dash-link:hover { text-decoration: underline; }
.dash-card > footer { padding: 8px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; background: var(--surface-2); }
.dash-body { padding: 6px 0; } .dash-empty { padding: 26px 16px; text-align: center; color: var(--muted); }
.dash-list { list-style: none; margin: 0; padding: 0; } .dash-row { display: grid; grid-template-columns: minmax(70px, 100px) 1fr auto; gap: 12px; align-items: center; padding: 9px 16px; cursor: pointer; }
.dash-row:hover, .dash-row:focus-visible { background: var(--surface-2); } .dash-row + .dash-row { border-top: 1px solid var(--line); }
.dash-row .time { font: 600 13px var(--mono); color: var(--ink-2); } .dash-row .what b { display: block; font-weight: 600; } .dash-row .what small { color: var(--muted); }
.dash-row .amt { font-variant-numeric: tabular-nums; }
.dash-pill { font-size: 12px; padding: 2px 10px; border-radius: 999px; font-weight: 600; white-space: nowrap; } .dash-pill.ok { background: var(--ok-bg); color: var(--ok); } .dash-pill.warn { background: var(--warn-bg); color: var(--warn); }
.dash-bars { padding: 8px 16px; display: grid; gap: 10px; } .dash-bar { display: grid; grid-template-columns: minmax(110px, 40%) 1fr 36px; gap: 12px; align-items: center; font-size: 13.5px; }
.dash-bar .track { background: var(--gray-bg); height: 10px; border-radius: 6px; overflow: hidden; } .dash-bar i { display: block; height: 100%; background: var(--accent); border-radius: 6px; } .dash-bar b { text-align: right; font-variant-numeric: tabular-nums; }

/* create-on-the-fly */
.ref-row { display: flex; gap: 8px; align-items: flex-start; } .ref-row > .ac, .ref-row > div:first-child { flex: 1; min-width: 0; } .ref-row .btn { height: 40px; flex: none; }
.cf-sched { display: flex; gap: 6px; align-items: center; min-width: 0; } .cf-mini { flex: none; border: 1px solid var(--line-2); background: var(--surface); border-radius: 6px; padding: 4px 10px; cursor: pointer; font-size: 12.5px; color: var(--accent-2); white-space: nowrap; }
.cf-mini:hover { border-color: var(--accent); background: var(--accent-soft); }
.cf-sched select { flex: 1; min-width: 0; text-overflow: ellipsis; }
.cf-two:has(.cf-sched) { grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr) !important; }

/* searchable dropdowns */
.combo-btn { display: inline-flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; cursor: pointer; padding-right: 10px !important; background-image: none !important; }
.combo-btn .combo-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; } .combo-btn .combo-text.placeholder { color: var(--muted); }
.combo-btn .combo-chev { width: 16px; height: 16px; flex: none; color: var(--accent); } .combo-btn:disabled { opacity: .6; cursor: default; } .combo-btn.invalid { border-color: var(--bad); }
.combo-btn:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.combo-pop { position: fixed; z-index: 2000; background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 6px; display: flex; flex-direction: column; max-width: min(520px, 94vw); }
.combo-search { height: 34px; border: 1px solid var(--line-2); border-radius: 7px; padding: 0 10px; margin-bottom: 6px; background: var(--surface-2); } .combo-search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.combo-list { overflow: auto; } .combo-group { padding: 6px 10px 2px; font: 600 11px var(--font); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.combo-item { padding: 7px 10px; border-radius: 6px; cursor: pointer; font-size: 14px; } .combo-item.hl { background: var(--surface-2); outline: 1px solid var(--line-2); } .combo-item.on { background: var(--accent-soft); color: var(--accent-2); font-weight: 600; }
.combo-item.none { color: var(--muted); } .combo-item.off { opacity: .45; cursor: default; } .combo-empty { padding: 12px; color: var(--muted); text-align: center; }

.dash-fin { padding: 8px 0; } .dash-money { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 6px 16px 12px; border-bottom: 1px solid var(--line); }
.dash-money b { display: block; font: 700 20px var(--font); font-variant-numeric: tabular-nums; } .dash-money b.bad { color: var(--bad); } .dash-money b.ok { color: var(--ok); } .dash-money small { color: var(--muted); font-size: 12px; }
.dash-bars .track i.ok { background: var(--ok); } .dash-bars .track i.warn { background: #d97706; } .dash-bars .track i.bad { background: var(--bad); } .dash-bar b { min-width: 86px; }
.dash-top { padding: 4px 16px 0; border-top: 1px solid var(--line); margin-top: 8px; } .dash-top small { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; } .dash-top > div { display: flex; justify-content: space-between; padding: 5px 0; font-size: 13.5px; } .dash-top span { color: var(--muted); font-variant-numeric: tabular-nums; }
.dash-fin .dash-bar { grid-template-columns: 110px 1fr 112px; } .dash-money b { font-size: 17px; } .dash-money { gap: 12px; }
.login .hero-logo { height: 46px; max-width: 220px; object-fit: contain; background: #fff; border-radius: 8px; padding: 6px 10px; } .login .panel .powered { margin-top: 28px; color: var(--muted); font-size: 12.5px; text-align: center; }
