/* GGA ERP — an account-book look: bottle-green binding, ledger rules, red ink for deadlines.
   Layout: fixed green "spine" sidebar, sticky top bar, content on pale ledger paper. */
@font-face { font-family: "Public Sans"; src: url(/fonts/public-sans.woff2) format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Public Sans"; src: url(/fonts/public-sans-italic.woff2) format("woff2"); font-weight: 100 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url(/fonts/plex-mono-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url(/fonts/plex-mono-500.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url(/fonts/plex-mono-600.woff2) format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --font: "Public Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "Plex Mono", Consolas, "Cascadia Mono", ui-monospace, monospace;
  --bg: #f3f5f2; --surface: #ffffff; --surface-2: #eef2ee; --surface-3: #e4eae5;
  --line: #d9e1db; --line-2: #c3cfc7;
  --ink: #17211c; --ink-2: #4a5a52; --ink-3: #75847c;
  --accent: #1d5a43; --accent-ink: #ffffff; --accent-soft: #e1eee7; --accent-hover: #164a37;
  --spine: #143c2d; --spine-2: #1b4a39; --spine-ink: #c7dbcf; --spine-hi: #ffffff;
  --red: #b3361f; --red-soft: #fbe7e2;
  --amber: #8f5c08; --amber-soft: #fbefd6;
  --blue: #285b8d; --blue-soft: #e4edf7;
  --violet: #66479a; --violet-soft: #eee8f8;
  --green: #22744d; --green-soft: #def1e6;
  --muted-soft: #eaeeeb;
  --c1: #1d5a43; --c2: #2b6aa0; --c3: #7a4fb0; --c4: #a0581c; --c5: #24807a; --c6: #6b6f1e; --c7: #b3361f; --c8: #8a3f74; --c9: #3d5a99; --c10: #9a6a00; --c11: #4f6f52;
  --shadow: 0 1px 2px rgb(20 40 30 / .06), 0 4px 16px rgb(20 40 30 / .06);
  --shadow-lg: 0 10px 40px rgb(10 25 18 / .18);
  --radius: 8px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1311; --surface: #151c19; --surface-2: #1a2320; --surface-3: #212c27;
    --line: #29352f; --line-2: #36453d;
    --ink: #e1eae4; --ink-2: #a5b4ac; --ink-3: #7a8a82;
    --accent: #5bb089; --accent-ink: #08110d; --accent-soft: #1b3228; --accent-hover: #72c39d;
    --spine: #0a0f0d; --spine-2: #15201b; --spine-ink: #9fb3a8; --spine-hi: #e8f1eb;
    --red: #f08068; --red-soft: #3a1f19; --amber: #e3b257; --amber-soft: #342812; --blue: #82b2e4; --blue-soft: #172739;
    --violet: #b89ee8; --violet-soft: #29203d; --green: #6dc596; --green-soft: #16301f; --muted-soft: #212a26;
    --c1: #6dc596; --c2: #82b2e4; --c3: #b89ee8; --c4: #e39a5d; --c5: #5ec4bb; --c6: #c2c65a; --c7: #f08068; --c8: #dc8fc5; --c9: #9cb1ee; --c10: #e3b257; --c11: #9cc39f;
    --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 4px 16px rgb(0 0 0 / .25); --shadow-lg: 0 10px 40px rgb(0 0 0 / .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1311; --surface: #151c19; --surface-2: #1a2320; --surface-3: #212c27;
  --line: #29352f; --line-2: #36453d;
  --ink: #e1eae4; --ink-2: #a5b4ac; --ink-3: #7a8a82;
  --accent: #5bb089; --accent-ink: #08110d; --accent-soft: #1b3228; --accent-hover: #72c39d;
  --spine: #0a0f0d; --spine-2: #15201b; --spine-ink: #9fb3a8; --spine-hi: #e8f1eb;
  --red: #f08068; --red-soft: #3a1f19; --amber: #e3b257; --amber-soft: #342812; --blue: #82b2e4; --blue-soft: #172739;
  --violet: #b89ee8; --violet-soft: #29203d; --green: #6dc596; --green-soft: #16301f; --muted-soft: #212a26;
  --c1: #6dc596; --c2: #82b2e4; --c3: #b89ee8; --c4: #e39a5d; --c5: #5ec4bb; --c6: #c2c65a; --c7: #f08068; --c8: #dc8fc5; --c9: #9cb1ee; --c10: #e3b257; --c11: #9cc39f;
  --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 4px 16px rgb(0 0 0 / .25); --shadow-lg: 0 10px 40px rgb(0 0 0 / .5);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mono { font-family: var(--mono); font-size: .92em; letter-spacing: -.01em; }
.upper { text-transform: uppercase; }
.num, td.num, .stat-value { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }
.block { display: block; }
.prewrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.red-ink { color: var(--red); font-weight: 600; }
.grow { flex: 1 1 auto; min-width: 0; }
.row { display: flex; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.gap-s { gap: 8px; }
.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.pad-s { padding: 12px; }
.full { grid-column: 1 / -1; }
.ic { flex: none; }

/* ---------- inputs ---------- */
input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea {
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 6px; padding: 7px 10px; min-height: 36px; width: 100%; min-width: 0;
}
textarea { resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input:disabled, select:disabled { opacity: .6; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; flex: none; }
input[type=range] { accent-color: var(--accent); }
select.mini { min-height: 28px; padding: 3px 6px; font-size: 12px; width: auto; max-width: 150px; }
.w-num { width: 84px !important; }
.w-amt { width: 120px !important; }
.w-sac { width: 96px !important; }
.w-date { width: 98px; flex: none; }
.r { text-align: right; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 7px 14px; border-radius: 6px; border: 1px solid transparent; cursor: pointer; font-weight: 600; white-space: nowrap; text-decoration: none !important; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.ghost { background: var(--surface); border-color: var(--line-2); color: var(--ink); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { background: var(--red); color: #fff; }
.btn.sm { min-height: 30px; padding: 4px 10px; font-size: 13px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.file-btn { cursor: pointer; align-self: flex-start; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 6px; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; position: relative; flex: none; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn.sm { width: 28px; height: 28px; }
.danger-h:hover { color: var(--red); background: var(--red-soft); }
.linkish { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font-weight: 600; }

/* ---------- pills, tones ---------- */
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 18px; }
.t-neutral { background: var(--surface-3); color: var(--ink-2); }
.t-blue { background: var(--blue-soft); color: var(--blue); }
.t-amber { background: var(--amber-soft); color: var(--amber); }
.t-violet { background: var(--violet-soft); color: var(--violet); }
.t-green { background: var(--green-soft); color: var(--green); }
.t-red { background: var(--red-soft); color: var(--red); }
.t-muted { background: var(--muted-soft); color: var(--ink-3); }
.cat { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--ink-2); }
.cat::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: var(--cc, var(--ink-3)); }
.cat span { color: var(--ink-3); }
.c1 { --cc: var(--c1); } .c2 { --cc: var(--c2); } .c3 { --cc: var(--c3); } .c4 { --cc: var(--c4); } .c5 { --cc: var(--c5); } .c6 { --cc: var(--c6); }
.c7 { --cc: var(--c7); } .c8 { --cc: var(--c8); } .c9 { --cc: var(--c9); } .c10 { --cc: var(--c10); } .c11 { --cc: var(--c11); }

.avatar { display: inline-grid; place-items: center; border-radius: 50%; flex: none; font-weight: 700; letter-spacing: .02em; color: hsl(var(--h) 45% 25%); background: hsl(var(--h) 45% 86%); }
:root[data-theme="dark"] .avatar { color: hsl(var(--h) 50% 85%); background: hsl(var(--h) 30% 26%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .avatar { color: hsl(var(--h) 50% 85%); background: hsl(var(--h) 30% 26%); } }
.people { display: inline-flex; align-items: center; }
.people .avatar { box-shadow: 0 0 0 2px var(--surface); }
.people .avatar + .avatar { margin-left: -6px; }
.people .more { font-size: 12px; color: var(--ink-3); margin-left: 4px; }
.people-names { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.pn { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 236px; flex: none; background: var(--spine); color: var(--spine-ink); position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 14px 10px 24px; border-right: 1px solid var(--spine-2); }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; margin-bottom: 6px; border-bottom: 1px solid rgb(255 255 255 / .08); }
.brand b { display: block; color: var(--spine-hi); font-size: 14px; line-height: 1.2; }
.brand small { color: var(--spine-ink); font-size: 11.5px; opacity: .8; }
.mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 6px; border: 1.5px solid currentColor; font: 600 14px var(--mono); color: var(--spine-hi); flex: none; letter-spacing: .04em; }
.nav-group { padding: 6px 0; }
.nav-group p { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; padding: 8px 10px 4px; opacity: .55; }
.nav-group a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 6px; color: var(--spine-ink); font-weight: 500; text-decoration: none; }
.nav-group a:hover { background: var(--spine-2); color: var(--spine-hi); }
.nav-group a.on { background: var(--spine-2); color: var(--spine-hi); box-shadow: inset 3px 0 0 var(--accent-hover); }
.nav-group a span { flex: 1; }
.nav-group em { font-style: normal; font-size: 11px; font-weight: 700; background: var(--red); color: #fff; border-radius: 999px; padding: 0 7px; line-height: 18px; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; display: flex; align-items: center; gap: 8px; height: 56px; padding: 0 20px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.menu-btn { display: none; }
#content { padding: 22px 24px 60px; }
.offline { display: inline-flex; align-items: center; gap: 4px; color: var(--red); font-weight: 600; font-size: 13px; }
.scrim { position: fixed; inset: 0; background: rgb(0 0 0 / .35); z-index: 39; }

.qs { position: relative; width: min(440px, 100%); }
.search { display: flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 6px; padding: 0 10px; min-height: 36px; min-width: 200px; color: var(--ink-3); }
.search input { border: 0 !important; box-shadow: none !important; padding: 6px 0 !important; min-height: 32px !important; background: transparent !important; }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.pop { position: absolute; z-index: 50; background: var(--surface); border: 1px solid var(--line-2); border-radius: 8px; box-shadow: var(--shadow-lg); }
.qs-pop { top: 42px; left: 0; right: 0; padding: 4px; max-height: 70vh; overflow: auto; }
.qs-pop a { display: flex; gap: 10px; padding: 8px; border-radius: 6px; color: var(--ink); text-decoration: none; align-items: flex-start; }
.qs-pop a:hover { background: var(--surface-2); }
.qs-pop a span { display: flex; flex-direction: column; min-width: 0; }
.qs-pop a small { color: var(--ink-3); }
.qs-kind { width: 64px; flex: none; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; padding-top: 2px; }
.bell { position: relative; }
.dot-badge { position: absolute; top: 3px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; }
.notif-pop { right: 0; top: 42px; width: min(380px, calc(100vw - 32px)); max-height: 70vh; overflow: auto; }
.pop-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.notif-pop ul { list-style: none; margin: 0; padding: 4px; }
.notif-pop li button { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; background: none; border: 0; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.notif-pop li button:hover { background: var(--surface-2); }
.notif-pop li.unread button { background: var(--accent-soft); }
.notif-pop small { color: var(--ink-3); }
.user-menu { position: relative; }
.user-btn { display: flex; align-items: center; gap: 8px; background: none; border: 0; cursor: pointer; padding: 3px 6px; border-radius: 6px; }
.user-btn:hover { background: var(--surface-2); }
.user-name { font-weight: 600; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-pop { right: 0; top: 44px; width: 230px; padding: 4px; }
.menu-pop a, .menu-pop button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 10px; border-radius: 6px; color: var(--ink); background: none; border: 0; cursor: pointer; text-decoration: none; }
.menu-pop a:hover, .menu-pop button:hover { background: var(--surface-2); }

/* ---------- page furniture ---------- */
.page { max-width: 1440px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.page.narrow { max-width: 1100px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 23px; font-weight: 700; letter-spacing: -.015em; line-height: 1.2; }
.page-head .sub { color: var(--ink-2); margin-top: 3px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ph-text { min-width: 0; }
.ph-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.back { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; color: var(--ink-3); margin-bottom: 4px; }
.section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; min-width: 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.section-head h2 { font-size: 15px; font-weight: 650; display: flex; align-items: center; gap: 6px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters > select { width: auto; max-width: 220px; }
.filters .search { flex: 1 1 240px; max-width: 380px; }
label.inline, .check.inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); }
.empty { display: flex; gap: 14px; align-items: flex-start; padding: 28px 22px; border: 1px dashed var(--line-2); border-radius: var(--radius); color: var(--ink-2); background: var(--surface); }
.empty .ic { color: var(--ink-3); margin-top: 2px; }
.empty b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 2px; }
.empty p { max-width: 62ch; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.callout { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-radius: var(--radius); background: var(--violet-soft); color: var(--violet); font-weight: 600; }
.callout span { flex: 1; }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.stat { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-align: left; cursor: pointer; min-width: 0; }
.stat:hover:not(.static) { border-color: var(--accent); }
.stat.static { cursor: default; }
.stat:disabled { opacity: 1; }
.stat-label { font-size: 12px; color: var(--ink-2); font-weight: 600; }
.stat-value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.stat-sub { font-size: 12px; color: var(--ink-3); }
.stat.s-red { border-left: 3px solid var(--red); } .stat.s-red .stat-value { color: var(--red); }
.stat.s-amber { border-left: 3px solid var(--amber); }
.stat.s-violet { border-left: 3px solid var(--violet); }
.stat.s-green .stat-value { color: var(--green); }

/* ---------- tables: ledger rules ---------- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); max-width: 100%; }
.section .table-wrap { border: 0; border-radius: 0; margin: 0 -16px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 650; padding: 9px 12px; border-bottom: 3px double var(--line-2); white-space: nowrap; cursor: pointer; user-select: none; background: var(--surface); }
.tbl th.nosort { cursor: default; }
.tbl th.r, .tbl td.r { text-align: right; }
.tbl th .sort { margin-left: 4px; font-size: 9px; color: var(--accent); }
.tbl td.mono, .tbl td .num { white-space: nowrap; }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tr.clickable { cursor: pointer; }
.tbl tbody tr.clickable:hover td { background: var(--surface-2); }
.tbl tfoot th, .tbl tfoot td { border-top: 1px solid var(--line-2); border-bottom: 0; background: var(--surface-2); cursor: default; color: var(--ink); font-size: 13px; text-transform: none; letter-spacing: 0; }
.tbl tbody th { text-align: left; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--ink); font-size: 13.5px; border-bottom: 1px solid var(--line); cursor: default; }
tr.row-overdue td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.task-title { color: var(--ink); font-weight: 600; }
.sub-line { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12.5px; color: var(--ink-2); margin-top: 2px; align-items: center; }
.due { display: flex; flex-direction: column; white-space: nowrap; }
.due small { font-size: 11.5px; color: var(--ink-3); }
.due.d-red, .due.d-red small { color: var(--red); font-weight: 600; }
.due.d-amber small { color: var(--amber); font-weight: 600; }
.due.d-muted { color: var(--ink-3); }
.prog { display: inline-block; width: 70px; height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; vertical-align: middle; }
.prog span { display: block; height: 100%; background: var(--accent); }
.meter { display: inline-block; width: 50px; height: 5px; background: var(--surface-3); border-radius: 3px; overflow: hidden; vertical-align: middle; }
.meter span { display: block; height: 100%; background: var(--green); }
.more-rows { padding: 10px; text-align: center; border-top: 1px solid var(--line); }

/* ---------- tabs, segmented, chips ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line-2); overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 9px 14px; cursor: pointer; font-weight: 600; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }
.tab-count { background: var(--red); color: #fff; font-size: 11px; border-radius: 999px; padding: 0 6px; line-height: 17px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 6px; overflow: hidden; background: var(--surface); flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 6px 11px; cursor: pointer; display: inline-flex; gap: 5px; align-items: center; font-weight: 600; font-size: 13px; color: var(--ink-2); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--accent-soft); color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 4px 11px; cursor: pointer; font-size: 13px; }
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* ---------- forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 14px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > label, .field > span { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field > label i { color: var(--red); font-style: normal; margin-left: 2px; }
.field small { font-size: 11.5px; color: var(--ink-3); }
.field.span2 { grid-column: span 2; }
.field.check { flex-direction: row; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 18px; }
.field.check span { font-size: 13.5px; color: var(--ink); font-weight: 500; }
.field.check small { flex-basis: 100%; margin-left: 24px; }
.form-section { grid-column: 1 / -1; font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); font-weight: 700; padding-top: 8px; border-top: 1px solid var(--line); margin-top: 4px; }
.form-grid > .form-section:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.money-in { display: flex; align-items: center; border: 1px solid var(--line-2); border-radius: 6px; background: var(--surface); }
.money-in span { padding-left: 10px; color: var(--ink-3); }
.money-in input { border: 0 !important; box-shadow: none !important; }
.money-in:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form-error { color: var(--red); background: var(--red-soft); padding: 8px 10px; border-radius: 6px; font-weight: 600; }
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 12px; }
.inline-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.inline-form label.grow { flex: 1 1 200px; }
.card-form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.combo { position: relative; }
.combo-clear { position: absolute; right: 6px; top: 7px; border: 0; background: none; color: var(--ink-3); cursor: pointer; padding: 2px; }
.combo-list { position: absolute; z-index: 60; top: calc(100% + 4px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--line-2); border-radius: 8px; box-shadow: var(--shadow-lg); max-height: 260px; overflow: auto; padding: 4px; }
.combo-list button { display: flex; justify-content: space-between; gap: 8px; width: 100%; text-align: left; background: none; border: 0; padding: 7px 9px; border-radius: 5px; cursor: pointer; }
.combo-list button.hi, .combo-list button:hover { background: var(--accent-soft); }
.combo-list small { color: var(--ink-3); }
.combo-none { padding: 10px; color: var(--ink-3); font-size: 13px; }
.people-pick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 4px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--surface); min-height: 36px; }
.people-pick select { border: 0 !important; width: auto; min-height: 28px !important; padding: 2px 4px !important; color: var(--accent); font-weight: 600; box-shadow: none !important; background: transparent; }
.tag { display: inline-flex; align-items: center; gap: 5px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 2px 4px 2px 3px; font-size: 13px; }
.tag button { border: 0; background: none; cursor: pointer; color: var(--ink-3); display: grid; place-items: center; padding: 2px; }
.lines { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.line { display: flex; gap: 6px; align-items: center; width: 100%; }
.inv-sum { display: grid; grid-template-columns: 1fr auto; gap: 4px 20px; margin: 14px 0; padding: 12px; background: var(--surface-2); border-radius: 6px; max-width: 360px; margin-left: auto; font-variant-numeric: tabular-nums; }
.inv-sum b { text-align: right; }
.inv-sum span:nth-last-child(2), .inv-sum b:last-child { border-top: 1px solid var(--line-2); padding-top: 4px; font-weight: 700; }
.check-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; max-height: 55vh; overflow: auto; }
.check-row { display: flex; align-items: center; gap: 10px; padding: 7px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.check-row:last-child { border-bottom: 0; }

/* ---------- modal & toasts ---------- */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgb(8 18 13 / .45); display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px; overflow-y: auto; }
.modal { background: var(--surface); border-radius: 10px; box-shadow: var(--shadow-lg); width: 100%; display: flex; flex-direction: column; max-height: 90vh; border: 1px solid var(--line); }
.m-s { max-width: 440px; } .m-m { max-width: 620px; } .m-l { max-width: 860px; } .m-xl { max-width: 1080px; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 16px 18px 12px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 18px; }
.modal-head .sub { color: var(--ink-2); font-size: 13px; margin-top: 2px; }
.modal-body { padding: 16px 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); align-items: center; flex-wrap: wrap; }
.dialog-text { color: var(--ink-2); }
.toasts { position: fixed; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast { display: flex; gap: 8px; align-items: flex-start; background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 8px; box-shadow: var(--shadow-lg); font-weight: 500; animation: rise .18s ease-out; }
.toast.error { background: var(--red); color: #fff; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }

/* ---------- tasks ---------- */
.status-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.status-steps { display: flex; flex-wrap: wrap; gap: 4px; }
.step { border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 5px 12px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--ink-2); }
.step:hover { border-color: var(--accent); color: var(--ink); }
.step.on { border-color: transparent; }
.step.on.t-neutral { background: var(--surface-3); color: var(--ink); } .step.on.t-blue { background: var(--blue-soft); color: var(--blue); }
.step.on.t-amber { background: var(--amber-soft); color: var(--amber); } .step.on.t-violet { background: var(--violet-soft); color: var(--violet); }
.step.on.t-green { background: var(--green-soft); color: var(--green); } .step.on.t-muted { background: var(--muted-soft); color: var(--ink-2); }
.prog-edit { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); font-weight: 600; }
.prog-edit input { width: 160px; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.detail-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.detail-side { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 72px; }
.facts { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 14px; }
.section .facts { border: 0; padding: 0; }
.fact { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.fact:last-child { border-bottom: 0; }
.fact > span { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 650; }
.fact > div { overflow-wrap: anywhere; }
.facts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 16px; }
.side-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.side-box h3 { font-size: 13px; font-weight: 650; display: flex; justify-content: space-between; }
.time-form { display: grid; grid-template-columns: 1fr 90px; gap: 6px; }
.time-form .span2 { grid-column: span 2; }
.mini-list { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.mini-list li { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; border-top: 1px solid var(--line); }
.checklist { list-style: none; margin: 0 0 10px; padding: 0; }
.checklist li { display: flex; align-items: center; gap: 8px; padding: 6px 2px; border-bottom: 1px solid var(--line); }
.checklist label { display: flex; align-items: flex-start; gap: 10px; flex: 1; cursor: pointer; min-width: 0; }
.checklist label input { margin-top: 2px; }
.checklist li.done span { text-decoration: line-through; color: var(--ink-3); }
.add-line input { flex: 1; }
.timeline { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.timeline .ev { display: flex; align-items: baseline; gap: 10px; font-size: 13px; color: var(--ink-2); padding-left: 9px; }
.timeline .ev .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); flex: none; transform: translateY(1px); }
.timeline .ev span:nth-child(2) { flex: 1; min-width: 0; }
.timeline time { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.timeline .cm { display: flex; gap: 10px; align-items: flex-start; }
.bubble { flex: 1; background: var(--surface-2); border-radius: 0 8px 8px 8px; padding: 8px 12px; min-width: 0; }
.bubble-head { display: flex; gap: 8px; align-items: center; margin-bottom: 2px; }
.bubble-head time { flex: 1; }
.comment-box { display: flex; gap: 8px; align-items: flex-end; }
.comment-box textarea { flex: 1; }

.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.board-col { background: var(--surface-2); border-radius: var(--radius); padding: 8px; min-height: 200px; display: flex; flex-direction: column; gap: 8px; border: 1px dashed transparent; }
.board-col.over { border-color: var(--accent); background: var(--accent-soft); }
.board-head { display: flex; justify-content: space-between; align-items: center; padding: 2px 4px; }
.board-list { display: flex; flex-direction: column; gap: 8px; }
.board-empty { font-size: 12px; color: var(--ink-3); text-align: center; padding: 16px 0; }
.card { display: flex; flex-direction: column; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 7px; padding: 10px; color: var(--ink); text-decoration: none !important; cursor: grab; box-shadow: var(--shadow); }
.card:hover { border-color: var(--accent); }
.card-overdue { border-left: 3px solid var(--red); }
.card-top, .card-meta, .card-foot { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.card-foot { justify-content: flex-start; font-size: 12px; color: var(--ink-3); }
.card-foot span { display: inline-flex; align-items: center; gap: 3px; }
.card-foot .prog { margin-left: auto; width: 50px; }

/* ---------- files ---------- */
.files { display: flex; flex-direction: column; gap: 10px; }
.files-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.folder-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.folder-tabs button { border: 1px solid var(--line); background: var(--surface); border-radius: 6px; padding: 4px 10px; font-size: 13px; cursor: pointer; color: var(--ink-2); }
.folder-tabs button span { color: var(--ink-3); font-size: 12px; margin-left: 3px; }
.folder-tabs button.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); font-weight: 600; }
.dropzone { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; border: 1.5px dashed var(--line-2); border-radius: var(--radius); padding: 12px 14px; color: var(--ink-2); background: var(--surface-2); }
.dropzone.drag { border-color: var(--accent); background: var(--accent-soft); }
.dz-text { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 4px; }
.dz-folder { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.dz-folder select { width: auto; min-height: 30px; padding: 3px 8px; }
.progress { height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--accent); transition: width .2s; }
.file-list { list-style: none; margin: 0; padding: 0; }
.file-list li { display: flex; align-items: center; gap: 10px; padding: 8px 2px; border-bottom: 1px solid var(--line); }
.file-list li:last-child { border-bottom: 0; }
.ext { flex: none; width: 40px; height: 40px; border-radius: 6px; display: grid; place-items: center; font: 600 10.5px var(--mono); background: var(--surface-3); color: var(--ink-2); }
.e-pdf { background: var(--red-soft); color: var(--red); } .e-xls, .e-csv { background: var(--green-soft); color: var(--green); } .e-doc { background: var(--blue-soft); color: var(--blue); } .e-img { background: var(--violet-soft); color: var(--violet); } .e-zip { background: var(--amber-soft); color: var(--amber); }
.file-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.file-name { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-main small { color: var(--ink-3); font-size: 12px; }
.file-actions { display: flex; align-items: center; gap: 2px; }

/* ---------- dashboard ---------- */
.dash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.dash-head h1 { font-size: 26px; letter-spacing: -.02em; }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 650; margin-bottom: 2px; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.punch { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; min-width: 280px; color: var(--accent); }
.punch b { color: var(--ink); }
.alerts { display: flex; flex-wrap: wrap; gap: 8px; }
.alert-chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: var(--amber-soft); color: var(--amber); font-weight: 600; font-size: 13px; }
.bars { display: flex; flex-direction: column; gap: 4px; }
.bar-row { display: grid; grid-template-columns: 150px 1fr 40px; gap: 10px; align-items: center; background: none; border: 0; padding: 5px 4px; border-radius: 6px; cursor: pointer; text-align: left; }
.bar-row:hover:not(:disabled) { background: var(--surface-2); }
.bar-row:disabled { cursor: default; opacity: 1; }
.bar-label { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { display: flex; height: 14px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.seg-fill { display: block; height: 100%; }
.seg-fill.t-neutral { background: var(--ink-3); } .seg-fill.t-blue { background: var(--blue); } .seg-fill.t-amber { background: var(--amber); } .seg-fill.t-violet { background: var(--violet); } .seg-fill.t-green { background: var(--green); } .seg-fill.t-muted { background: var(--line-2); }
.bar-num { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.legend i.t-neutral { background: var(--ink-3); } .legend i.t-blue { background: var(--blue); } .legend i.t-amber { background: var(--amber); } .legend i.t-violet { background: var(--violet); } .legend i.t-green { background: var(--green); }
.upcoming { list-style: none; margin: 0; padding: 0; }
.upcoming li a { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.upcoming li:last-child a { border-bottom: 0; }
.upcoming li a:hover .up-main span { text-decoration: underline; }
.up-date { width: 58px; flex: none; display: flex; flex-direction: column; }
.up-date small { font-size: 11px; color: var(--ink-3); }
.up-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.notice-mini .pill { align-self: flex-start; }
.up-main .pill { align-self: flex-start; font-size: 11px; line-height: 16px; }
.notice-mini { list-style: none; margin: 0; padding: 0; }
.notice-mini a { display: flex; flex-direction: column; padding: 7px 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.notice-mini li:last-child a { border-bottom: 0; }
.setup { border-color: var(--accent); background: var(--accent-soft); }
.setup-steps { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 16px; }
.setup-steps li { display: flex; gap: 8px; align-items: center; }
.setup-steps .tick { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--accent); display: grid; place-items: center; color: var(--accent-ink); flex: none; }
.setup-steps li.done .tick { background: var(--accent); }
.setup-steps li.done a { color: var(--ink-3); text-decoration: line-through; }
.link-list { list-style: none; margin: 0; padding: 0; }
.link-list li { display: flex; flex-direction: column; padding: 6px 0; border-bottom: 1px solid var(--line); }
.link-list li:last-child { border-bottom: 0; }
.link-list small { color: var(--ink-3); }

/* ---------- registers ---------- */
.obs-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.obs-list li { padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.obs-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.obs-head .muted.small { flex: 1; }
.dir-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.dir-card { display: flex; gap: 12px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; overflow-wrap: anywhere; }
.notice-list { display: flex; flex-direction: column; gap: 12px; max-width: 860px; }
.notice { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; display: flex; flex-direction: column; gap: 8px; }
.notice header { display: flex; align-items: center; gap: 8px; }
.notice h2 { font-size: 17px; }
.notice .btn { align-self: flex-start; }

/* ---------- calendar ---------- */
.cal-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cal-title { font-size: 18px; min-width: 170px; text-align: center; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--line); gap: 1px; }
.cal-wd { background: var(--surface-2); padding: 6px 8px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.cal-day { background: var(--surface); min-height: 108px; padding: 6px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cal-day.blank { background: var(--surface-2); }
.cal-day.is-sun, .cal-day.is-hol { background: color-mix(in srgb, var(--surface) 85%, var(--surface-3)); }
.cal-num { font-weight: 700; font-size: 13px; color: var(--ink-2); }
.cal-day.is-today .cal-num { background: var(--accent); color: var(--accent-ink); border-radius: 999px; width: 24px; height: 24px; display: grid; place-items: center; }
.cal-evs { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ev { display: block; font-size: 11.5px; line-height: 1.3; padding: 2px 5px; border-radius: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border: 0; text-align: left; width: 100%; cursor: pointer; text-decoration: none !important; font-weight: 600; }
.ev:disabled { cursor: default; }
.ev-due { background: var(--red-soft); color: var(--red); }
.ev-hol { background: var(--amber-soft); color: var(--amber); }
.ev-lit { background: var(--violet-soft); color: var(--violet); }
.ev-task { background: var(--blue-soft); color: var(--blue); }
.cal-legend i { width: 12px; height: 12px; border-radius: 3px; }
.cal-legend i.ev-due { background: var(--red); } .cal-legend i.ev-task { background: var(--blue); } .cal-legend i.ev-lit { background: var(--violet); } .cal-legend i.ev-hol { background: var(--amber); }
.gen-tbl td select { min-width: 160px; }
.client-sel { max-width: 320px; }
.import-list { margin: 0 0 12px; padding-left: 18px; line-height: 1.7; }
.master-row { margin-top: 10px; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; background: var(--surface-2); }

/* ---------- attendance ---------- */
.att-wrap { max-height: 70vh; }
.att { border-collapse: separate; border-spacing: 0; font-size: 12px; }
.att th, .att td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 0; text-align: center; }
.att thead th { position: sticky; top: 0; background: var(--surface); z-index: 2; padding: 4px 2px; font-weight: 700; min-width: 30px; }
.att thead th small { display: block; font-size: 9.5px; color: var(--ink-3); font-weight: 600; }
.att thead th.wo { color: var(--ink-3); }
.att thead th.tdy { background: var(--accent-soft); color: var(--accent); }
.att-name { position: sticky; left: 0; background: var(--surface); z-index: 1; text-align: left !important; padding: 6px 10px !important; white-space: nowrap; font-weight: 600; min-width: 150px; }
.att thead .att-name { z-index: 3; }
.att-cell button { width: 30px; height: 30px; border: 0; background: none; cursor: pointer; font: 600 11px var(--mono); color: inherit; }
.att-cell button:hover { outline: 2px solid var(--accent); outline-offset: -2px; }
.att td.num { padding: 0 8px; font-weight: 600; }
.a-P, .att-cell.a-P { background: var(--green-soft); color: var(--green); }
.a-WFH { background: var(--blue-soft); color: var(--blue); }
.a-HD { background: var(--amber-soft); color: var(--amber); }
.a-A, .a-LWP { background: var(--red-soft); color: var(--red); }
.a-L { background: var(--violet-soft); color: var(--violet); }
.a-H, .a-WO { background: var(--surface-2); color: var(--ink-3); }
.legend-code { display: inline-grid; place-items: center; min-width: 26px; height: 20px; border-radius: 4px; font: 600 10.5px var(--mono); }
.month-pick { display: inline-flex; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 6px; padding: 2px; }
.month-pick b { min-width: 86px; text-align: center; }
.pay input { min-height: 30px !important; padding: 3px 6px !important; }

/* ---------- reports ---------- */
.matrix td a { font-weight: 700; }
.tracker td { padding: 5px 6px; }
.trk { display: block; font-size: 11.5px; font-weight: 600; padding: 3px 6px; border-radius: 4px; white-space: nowrap; text-decoration: none !important; text-align: center; }
.cat-editor { display: flex; gap: 16px; align-items: flex-start; }
.cat-nav { display: flex; flex-direction: column; gap: 2px; width: 230px; flex: none; }
.cat-nav button { display: flex; justify-content: space-between; text-align: left; padding: 7px 10px; border-radius: 6px; border: 0; background: none; cursor: pointer; font-weight: 600; color: var(--ink-2); }
.cat-nav button small { color: var(--ink-3); }
.cat-nav button.on { background: var(--accent-soft); color: var(--accent); }
.sub-editor { display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.sub-editor input { font-weight: 600; }
.steps { padding-left: 20px; line-height: 1.8; }
.mail-preview { width: 100%; height: 60vh; border: 1px solid var(--line); border-radius: 6px; background: #fff; }

/* ---------- printable documents ---------- */
.print-doc { background: #fff; color: #111; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 32px; max-width: 900px; width: 100%; display: flex; flex-direction: column; gap: 14px; font-size: 13.5px; }
.print-doc .muted { color: #666; }
.doc-head { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 12px; border-bottom: 3px double #1d5a43; }
.doc-head h2 { font-size: 20px; color: #1d5a43; }
.doc-head p { color: #444; font-size: 12.5px; }
.doc-kind { font-size: 16px; letter-spacing: .08em; color: #1d5a43; }
.doc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px 16px; }
.doc-grid div { display: flex; flex-direction: column; }
.doc-grid span, .bill-to > span { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #666; }
.doc-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.doc-cols table, .doc-table { width: 100%; border-collapse: collapse; }
.doc-cols th, .doc-cols td, .doc-table th, .doc-table td { padding: 6px 8px; border-bottom: 1px solid #ddd; text-align: left; }
.doc-cols thead th, .doc-table thead th { border-bottom: 2px solid #1d5a43; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: #333; }
.doc-cols tfoot th { border-top: 2px solid #333; }
.print-doc th.r, .print-doc td.r { text-align: right; }
.doc-table .grand td { font-weight: 700; font-size: 15px; border-top: 2px solid #333; border-bottom: 3px double #333; }
.doc-total { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: #eef4f0; border-radius: 6px; font-size: 16px; }
.doc-total b { font-size: 20px; }
.bill-to { display: flex; flex-direction: column; }
.doc-foot { display: flex; justify-content: space-between; gap: 20px; margin-top: 18px; }
.sign { text-align: right; font-weight: 600; }
.lit-client h3 { font-size: 15px; color: #1d5a43; border-bottom: 1px solid #ccc; padding-bottom: 4px; margin: 10px 0 6px; }
.lit-item { padding: 6px 0 10px; border-bottom: 1px dashed #ddd; display: flex; flex-direction: column; gap: 4px; }
.lit-top { display: flex; justify-content: space-between; gap: 12px; }
.lit-meta { font-size: 12px; color: #555; }

/* ---------- sign-in ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(1200px 600px at 10% -10%, var(--accent-soft), transparent 60%), var(--bg); }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 28px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; }
.auth-card.wide { max-width: 720px; }
.auth-card h1 { font-size: 22px; }
.auth-brand { display: flex; align-items: center; gap: 12px; color: var(--accent); }
.auth-brand .mark { color: var(--accent); }
.auth-brand b { display: block; color: var(--ink); }
.auth-brand small { color: var(--ink-3); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .dash-grid, .detail-grid, .two-col { grid-template-columns: minmax(0, 1fr); }
  .detail-side { position: static; }
}
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 40; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); padding-top: calc(14px + env(safe-area-inset-top, 0px)); }
  .sidebar.open { transform: none; }
  .menu-btn { display: inline-grid; }
  .user-name { display: none; }
  #content { padding: 16px 16px 60px; }
  .topbar { padding: 0 12px; }
  .form-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .cat-editor { flex-direction: column; }
  .cat-nav { width: 100%; }
}
@media (max-width: 560px) {
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .field.span2 { grid-column: auto; }
  .search { min-width: 0; }
  .qs { width: auto; flex: 1; }
  .page-head h1 { font-size: 20px; }
  .bar-row { grid-template-columns: 100px 1fr 30px; }
  .punch { min-width: 0; width: 100%; }
  .doc-grid { grid-template-columns: 1fr 1fr; }
  .doc-cols { grid-template-columns: 1fr; }
  .print-doc { padding: 18px 16px; }
  .cal-day { min-height: 70px; padding: 3px; }
  .ev { font-size: 10px; padding: 1px 3px; }
  .filters > select { max-width: 100%; flex: 1 1 140px; }
  .line { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

@media print {
  @page { margin: 12mm; }
  body { background: #fff; color: #000; }
  .sidebar, .topbar, .no-print, .filters, .tabs, .ph-actions, .toasts, .back, .btn, .icon-btn, .modal-head, .modal-foot, .scrim { display: none !important; }
  body.print-modal .shell { display: none !important; }
  .overlay { position: static; background: none; padding: 0; display: block; }
  .modal { box-shadow: none; border: 0; max-height: none; max-width: none; }
  .modal-body { padding: 0; overflow: visible; }
  #content { padding: 0; }
  .print-doc { border: 0; padding: 0; max-width: none; }
  .table-wrap, .section { border: 0; overflow: visible; }
  .lit-item { break-inside: avoid; }
}
