/* Turning Point — Project Tracker & Management System
   Design: quiet, paper-toned UI; brand green for action, brand yellow as a sparing accent. */

:root {
  --bg: #F4F4F1;
  --surface: #FFFFFF;
  --surface-2: #FAFAF7;
  --surface-3: #F1F1ED;
  --line: #E6E5E0;
  --line-strong: #D5D4CD;
  --text: #151816;
  --text-2: #464B48;
  --muted: #7A7F7B;
  --brand: #0E6B3A;
  --brand-strong: #0A5530;
  --brand-soft: #E7F1EA;
  --brand-ink: #0E6B3A;
  --accent: #F2C200;
  --accent-soft: #FFF5D1;
  --on-brand: #FFFFFF;

  --green: #17784A;  --green-bg: #E5F3EA;
  --amber: #9A6200;  --amber-bg: #FCF1D9;
  --red:   #BE3328;  --red-bg:   #FBE8E5;
  --blue:  #2A5BB5;  --blue-bg:  #E8EEFA;
  --gray:  #5E6360;  --gray-bg:  #EEEEEA;
  --violet:#6A4BB0;  --violet-bg:#EFEAFA;

  --shadow-sm: 0 1px 2px rgba(20, 24, 22, .05);
  --shadow-md: 0 8px 24px -8px rgba(20, 24, 22, .14), 0 2px 6px rgba(20, 24, 22, .05);
  --shadow-lg: 0 24px 64px -16px rgba(20, 24, 22, .28);
  --radius: 10px;
  --radius-sm: 7px;
  --sidebar: 248px;
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E1110; --surface: #151918; --surface-2: #191E1C; --surface-3: #1E2421;
    --line: #252B28; --line-strong: #323935; --text: #E9ECEA; --text-2: #B6BDB8; --muted: #858D88;
    --brand: #2E9A5D; --brand-strong: #3FB574; --brand-soft: #142A1E; --brand-ink: #5CC98B; --accent: #F2C200; --accent-soft: #2D2710;
    --green: #5CC98B; --green-bg: #15291E; --amber: #E7B44A; --amber-bg: #2D2412; --red: #F07B70; --red-bg: #321917;
    --blue: #86A8F0; --blue-bg: #18213A; --gray: #A3AAA6; --gray-bg: #222826; --violet: #B49CF0; --violet-bg: #251E38;
    --shadow-md: 0 8px 24px -8px rgba(0,0,0,.6); --shadow-lg: 0 24px 64px -16px rgba(0,0,0,.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E1110; --surface: #151918; --surface-2: #191E1C; --surface-3: #1E2421;
  --line: #252B28; --line-strong: #323935; --text: #E9ECEA; --text-2: #B6BDB8; --muted: #858D88;
  --brand: #2E9A5D; --brand-strong: #3FB574; --brand-soft: #142A1E; --brand-ink: #5CC98B; --accent: #F2C200; --accent-soft: #2D2710;
  --green: #5CC98B; --green-bg: #15291E; --amber: #E7B44A; --amber-bg: #2D2412; --red: #F07B70; --red-bg: #321917;
  --blue: #86A8F0; --blue-bg: #18213A; --gray: #A3AAA6; --gray-bg: #222826; --violet: #B49CF0; --violet-bg: #251E38;
  --shadow-md: 0 8px 24px -8px rgba(0,0,0,.6); --shadow-lg: 0 24px 64px -16px rgba(0,0,0,.7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 14px/1.5 var(--font); letter-spacing: -0.003em;
  -webkit-font-smoothing: antialiased; font-feature-settings: "ss01", "cv11";
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.015em; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--accent-soft); }
svg.i { width: 16px; height: 16px; flex: none; }
.num, .tabular { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: 0; }
.muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
.small { font-size: 12.5px; }
.xs { font-size: 11.5px; }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pre { white-space: pre-line; }
.hidden { display: none !important; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 4px; }
.grow { flex: 1; min-width: 0; }
.spacer { flex: 1; }
.right { text-align: right; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ------------------------------------------------------------------ Boot */
.boot { min-height: 100vh; display: grid; place-items: center; }
.boot-mark img { animation: breathe 1.4s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .35; transform: scale(.94); } }

/* ------------------------------------------------------------------ Shell */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--line); z-index: 30;
}
.brand { padding: 20px 20px 18px; border-bottom: 1px solid var(--line); }
.brand-logo { display: block; }
.brand-logo img { width: 168px; height: auto; }
.brand-sub {
  margin-top: 10px; padding-left: 1px; font-size: 10.5px; line-height: 1.4; font-weight: 600;
  letter-spacing: .07em; text-transform: uppercase; color: var(--text-2);
  display: flex; align-items: center; gap: 7px;
}
.brand-sub::before { content: ""; width: 3px; height: 22px; border-radius: 2px; background: var(--accent); flex: none; }
/* Logo artwork per theme (light file has dark text; dark file has light text) */
.logo-dark { display: none !important; }
:root[data-theme="dark"] .logo-light { display: none !important; }
:root[data-theme="dark"] .logo-dark { display: block !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-light { display: none !important; }
  :root:not([data-theme="light"]) .logo-dark { display: block !important; }
}
.brand-logo img, .auth-form .logo img, .doc-logo img { height: auto; }
.nav { flex: 1; overflow-y: auto; padding: 10px 10px 16px; }
.nav-group { margin-top: 14px; }
.nav-label { padding: 0 10px 6px; font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: .02em; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px;
  border-radius: var(--radius-sm); color: var(--text-2); font-weight: 500; font-size: 13.5px;
}
.nav a svg { width: 17px; height: 17px; flex: none; color: var(--muted); }
.nav a:hover { background: var(--surface-3); color: var(--text); }
.nav a.active { background: var(--brand-soft); color: var(--brand-ink); }
.nav a.active svg { color: var(--brand-ink); }
.nav a.active::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.nav .count {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  display: inline-grid; place-items: center; font-size: 11px; font-weight: 600;
  background: var(--surface-3); color: var(--text-2); font-variant-numeric: tabular-nums;
}
.nav .count.alert { background: var(--accent); color: #2A2200; }
.sidebar-foot { padding: 10px; border-top: 1px solid var(--line); }
.me {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px; border: 0; border-radius: var(--radius-sm);
  background: transparent; text-align: left;
}
.me:hover { background: var(--surface-3); }
.me .who { min-width: 0; flex: 1; }
.me .who b { display: block; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me .who span { display: block; font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me > svg { width: 16px; height: 16px; color: var(--muted); flex: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  height: 60px; padding: 0 28px; background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.crumbs { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; color: var(--muted); }
.crumbs a:hover { color: var(--text); }
.crumbs b { color: var(--text); font-weight: 600; }
.crumbs .sep { opacity: .5; }
.search-btn {
  display: flex; align-items: center; gap: 8px; height: 34px; width: 260px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--muted); font-size: 13px;
}
.search-btn:hover { border-color: var(--line-strong); }
.search-btn svg { width: 15px; height: 15px; }
.search-btn kbd { margin-left: auto; }
kbd {
  font-family: var(--mono); font-size: 10.5px; padding: 1px 5px; border-radius: 4px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--muted);
}
.menu-btn { display: none; }
.view { padding: 8px 28px 56px; max-width: 1480px; width: 100%; }

.page-head { display: flex; align-items: flex-end; gap: 16px; margin: 10px 0 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; line-height: 1.2; letter-spacing: -0.025em; }
.page-head p { margin-top: 4px; color: var(--muted); font-size: 13.5px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ Buttons & inputs */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 13px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface);
  color: var(--text); font-size: 13px; font-weight: 500; white-space: nowrap;
  box-shadow: var(--shadow-sm); transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { background: var(--surface-2); border-color: color-mix(in srgb, var(--line-strong) 70%, var(--text)); }
.btn svg { width: 15px; height: 15px; flex: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); box-shadow: 0 1px 0 rgba(255,255,255,.12) inset, var(--shadow-sm); }
.btn.primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-3); color: var(--text); }
.btn.danger { color: var(--red); }
.btn.danger:hover { background: var(--red-bg); border-color: color-mix(in srgb, var(--red) 40%, transparent); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn.icon { width: 34px; padding: 0; }
.btn.sm.icon { width: 28px; }
.btn:disabled { opacity: .55; pointer-events: none; }
.btn.loading { position: relative; color: transparent !important; }
.btn.loading::after {
  content: ""; position: absolute; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid currentColor; border-color: var(--on-brand) var(--on-brand) transparent transparent; animation: spin .7s linear infinite;
}
.btn:not(.primary).loading::after { border-color: var(--text) var(--text) transparent transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

.input, .select, .textarea {
  width: 100%; height: 36px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font-size: 13.5px; outline: none; transition: border-color .12s, box-shadow .12s;
}
.textarea { height: auto; min-height: 84px; padding: 9px 11px; resize: vertical; line-height: 1.5; }
.select {
  appearance: none; padding-right: 30px; cursor: pointer;
  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='%237A7F7B' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 16%, transparent); }
.input::placeholder, .textarea::placeholder { color: var(--muted); opacity: .8; }
.input.sm, .select.sm { height: 30px; font-size: 12.5px; }
input[type="date"].input { padding-right: 6px; }
input[type="range"] { accent-color: var(--brand); width: 100%; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label { font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.field > label .req { color: var(--red); margin-left: 2px; }
.field .hint { font-size: 11.5px; color: var(--muted); }
.check { display: inline-flex; align-items: center; gap: 9px; font-size: 13.5px; cursor: pointer; user-select: none; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); margin: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 14px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-section { grid-column: 1 / -1; margin-top: 10px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; align-items: baseline; gap: 10px; }
.form-section:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.form-section h3 { font-size: 13px; font-weight: 600; }
.form-section span { font-size: 12px; color: var(--muted); }
.range-row { display: flex; align-items: center; gap: 12px; }
.range-row output { width: 44px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; font-size: 13px; }

/* ------------------------------------------------------------------ Surfaces */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card-head { display: flex; align-items: center; gap: 10px; padding: 15px 18px 0; }
.card-head h2, .card-head h3 { font-size: 14px; font-weight: 600; }
.card-head .sub { font-size: 12.5px; color: var(--muted); }
.card-head .link { margin-left: auto; font-size: 12.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.card-head .link:hover { color: var(--brand-ink); }
.card-body { padding: 14px 18px 18px; }
.card.pad { padding: 18px; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.main-side { grid-template-columns: minmax(0, 1.65fr) minmax(320px, 1fr); align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; }

/* KPI strip */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px; }
.kpi { padding: 16px 18px 15px; border-left: 1px solid var(--line); min-width: 0; }
.kpi:first-child { border-left: 0; }
.kpi .label { font-size: 12px; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.kpi .value { margin-top: 6px; font-size: 25px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .value small { font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.kpi .foot { margin-top: 6px; font-size: 12px; color: var(--muted); }
.kpi .foot.red { color: var(--red); }
.kpi .foot.green { color: var(--green); }
.kpi.link { cursor: pointer; }
.kpi.link:hover { background: var(--surface-2); }

/* Pills */
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 6px;
  font-size: 12px; font-weight: 500; white-space: nowrap; background: var(--gray-bg); color: var(--gray);
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.plain::before { display: none; }
.pill.green { background: var(--green-bg); color: var(--green); }
.pill.amber { background: var(--amber-bg); color: var(--amber); }
.pill.red { background: var(--red-bg); color: var(--red); }
.pill.blue { background: var(--blue-bg); color: var(--blue); }
.pill.violet { background: var(--violet-bg); color: var(--violet); }
.pill.brand { background: var(--brand-soft); color: var(--brand-ink); }
.pill.outline { background: transparent; border: 1px solid var(--line-strong); color: var(--text-2); }
.prio { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--text-2); }
.prio i { display: inline-flex; gap: 2px; align-items: flex-end; height: 11px; }
.prio i b { width: 3px; border-radius: 1px; background: var(--line-strong); }
.prio i b:nth-child(1) { height: 5px; } .prio i b:nth-child(2) { height: 8px; } .prio i b:nth-child(3) { height: 11px; }
.prio.High i b { background: var(--red); }
.prio.Medium i b:nth-child(-n+2) { background: var(--amber); }
.prio.Low i b:nth-child(1) { background: var(--gray); }

/* Progress */
.progress { display: flex; align-items: center; gap: 8px; min-width: 92px; }
.progress .bar { flex: 1; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.progress .bar i { display: block; height: 100%; border-radius: 3px; background: var(--brand); }
.progress span { font-size: 12px; color: var(--text-2); width: 32px; text-align: right; font-variant-numeric: tabular-nums; }

/* Avatar */
.avatar {
  width: 28px; height: 28px; border-radius: 50%; flex: none; display: inline-grid; place-items: center;
  font-size: 11px; font-weight: 600; letter-spacing: .02em; color: var(--text-2);
  background: var(--surface-3); border: 1px solid var(--line);
}
.avatar.sm { width: 22px; height: 22px; font-size: 9.5px; }
.avatar.lg { width: 36px; height: 36px; font-size: 13px; }
.person { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.person span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------------------------------------------ Toolbar & filters */
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .search { position: relative; width: 280px; max-width: 100%; }
.toolbar .search svg { position: absolute; left: 10px; top: 50%; width: 15px; height: 15px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.toolbar .search .input { padding-left: 32px; height: 34px; }
.toolbar .select { width: auto; height: 34px; font-size: 13px; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 8px; background: var(--surface-3); border: 1px solid var(--line); }
.seg button {
  height: 26px; padding: 0 11px; border: 0; border-radius: 6px; background: transparent; color: var(--text-2);
  font-size: 12.5px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px;
}
.seg button svg { width: 14px; height: 14px; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }
.seg button .n { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ Tables */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; }
table.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.table th {
  position: sticky; top: 0; z-index: 1; text-align: left; font-weight: 500; font-size: 12px; color: var(--muted);
  padding: 10px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; user-select: none;
}
.table th.sortable { cursor: pointer; }
.table th.sortable:hover { color: var(--text); }
.table th .arrow { opacity: .7; margin-left: 3px; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover td { background: var(--surface-2); }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.title-cell > b { display: block; font-weight: 550; color: var(--text); max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.title-cell > span { display: block; font-size: 12px; color: var(--muted); max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.title-cell .mono { font-size: 11.5px; }
.table .wrap-cell { white-space: normal; min-width: 200px; max-width: 420px; color: var(--text-2); }
.table tfoot td { background: var(--surface-2); font-weight: 600; border-top: 1px solid var(--line); border-bottom: 0; }
.table-foot { display: flex; align-items: center; gap: 12px; padding: 10px 14px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); background: var(--surface-2); }
.date-late { color: var(--red); font-weight: 500; }
.date-soon { color: var(--amber); font-weight: 500; }

/* Lists */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); min-width: 0; }
.list-item:first-child { border-top: 0; padding-top: 2px; }
a.list-item:hover .li-title { color: var(--brand-ink); }
.li-title { font-weight: 500; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-meta { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--gray); }
.dot.red { background: var(--red); } .dot.amber { background: var(--amber); } .dot.green { background: var(--green); } .dot.blue { background: var(--blue); }
.date-chip {
  flex: none; width: 42px; text-align: center; border: 1px solid var(--line); border-radius: 8px; padding: 4px 0 3px; background: var(--surface-2);
}
.date-chip b { display: block; font-size: 15px; line-height: 1.1; font-weight: 600; font-variant-numeric: tabular-nums; }
.date-chip span { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

/* Health bar */
.hbar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; gap: 2px; background: var(--surface-3); }
.hbar i { display: block; height: 100%; }
.hbar i.green { background: var(--green); } .hbar i.amber { background: var(--amber); } .hbar i.red { background: var(--red); }
.hbar i.gray { background: color-mix(in srgb, var(--gray) 55%, transparent); } .hbar i.slate { background: var(--line-strong); }
.legend { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.legend div { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
.legend b { display: block; font-size: 20px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.legend span { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }

.bars { display: flex; flex-direction: column; gap: 12px; }
.bars .b-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: 14px; align-items: center; font-size: 13px; }
.bars .b-track { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.bars .b-track i { display: block; height: 100%; background: var(--brand); border-radius: 4px; }
.bars .b-val { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 84px; text-align: right; }

.stages { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.stages div { padding: 11px 12px; border-left: 1px solid var(--line); min-width: 0; }
.stages div:first-child { border-left: 0; }
.stages b { display: block; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stages span { display: block; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stages em { display: block; font-style: normal; font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; margin-top: 2px; }

/* Activity feed */
.feed { display: flex; flex-direction: column; }
.feed-item { display: flex; gap: 11px; padding: 9px 0; position: relative; }
.feed-item .avatar { margin-top: 1px; }
.feed-item p { font-size: 13px; color: var(--text-2); line-height: 1.45; }
.feed-item p b { color: var(--text); font-weight: 550; }
.feed-item time { display: block; font-size: 11.5px; color: var(--muted); margin-top: 1px; }

/* Empty states */
.empty { padding: 44px 20px; text-align: center; color: var(--muted); }
.empty svg { width: 28px; height: 28px; margin: 0 auto 10px; color: var(--line-strong); }
.empty b { display: block; color: var(--text); font-weight: 600; margin-bottom: 4px; }
.empty .btn { margin-top: 14px; }

/* ------------------------------------------------------------------ Project detail */
.detail-head { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin: 6px 0 18px; }
.detail-head h1 { font-size: 24px; letter-spacing: -0.025em; line-height: 1.25; }
.detail-head .meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.detail-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 18px; }
.fact { padding: 13px 16px; border-left: 1px solid var(--line); border-top: 1px solid var(--line); margin: -1px 0 0 -1px; min-width: 0; }
.fact label { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 3px; }
.fact div { font-weight: 500; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  position: relative; height: 38px; padding: 0 12px; border: 0; background: none; color: var(--muted);
  font-size: 13.5px; font-weight: 500; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px;
}
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--text); }
.tabs button.on::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--brand); }
.tabs .n { font-size: 11px; padding: 0 6px; border-radius: 9px; background: var(--surface-3); color: var(--muted); font-variant-numeric: tabular-nums; }
.kv { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 10px 16px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; white-space: pre-line; }
.note-block { padding: 14px 16px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); white-space: pre-line; font-size: 13.5px; color: var(--text-2); }
.note-block.accent { border-left: 3px solid var(--accent); }
.section-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 10px; }

/* Milestones */
.ms { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); align-items: flex-start; }
.ms:first-child { border-top: 0; }
.ms-check {
  width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line-strong); background: var(--surface);
  display: grid; place-items: center; flex: none; margin-top: 1px; padding: 0; color: transparent;
}
.ms-check svg { width: 12px; height: 12px; }
.ms-check:hover { border-color: var(--brand); }
.ms.done .ms-check { background: var(--brand); border-color: var(--brand); color: #fff; }
.ms.done .ms-title { text-decoration: line-through; color: var(--muted); }
.ms-title { font-weight: 500; }
.ms .actions { margin-left: auto; display: flex; gap: 4px; opacity: 0; transition: opacity .12s; }
.ms:hover .actions { opacity: 1; }

/* Update timeline */
.timeline { display: flex; flex-direction: column; gap: 12px; }
.update-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 18px; }
.update-card header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.update-card header .who { font-weight: 600; font-size: 13.5px; }
.update-card header time { font-size: 12.5px; color: var(--muted); }
.update-card header .proj { font-size: 13px; color: var(--text-2); }
.update-card header .proj:hover { color: var(--brand-ink); }
.update-card .body { font-size: 13.5px; color: var(--text); white-space: pre-line; }
.update-card .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-top: 12px; }
.update-card .cols > div { padding: 10px 12px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; white-space: pre-line; }
.update-card .cols label { display: block; font-size: 11.5px; color: var(--muted); font-weight: 500; margin-bottom: 3px; }
.update-card .cols .warn { background: var(--red-bg); border-color: transparent; }
.update-card .cols .ask { background: var(--accent-soft); border-color: transparent; }
.update-card footer { display: flex; gap: 8px; align-items: center; margin-top: 12px; flex-wrap: wrap; }

/* Board */
.board { display: grid; grid-template-columns: repeat(4, minmax(250px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 6px; align-items: start; }
.lane { background: var(--surface-3); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; min-height: 200px; transition: background .12s, border-color .12s; }
.lane.drop { background: var(--brand-soft); border-color: var(--brand); }
.lane-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px 10px; font-size: 13px; font-weight: 600; }
.lane-head .n { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.lane-cards { display: flex; flex-direction: column; gap: 8px; }
.tcard { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 11px 12px; cursor: grab; box-shadow: var(--shadow-sm); }
.tcard:hover { border-color: var(--line-strong); }
.tcard.dragging { opacity: .5; }
.tcard .t-title { font-size: 13.5px; font-weight: 500; line-height: 1.4; }
.tcard .t-proj { font-size: 12px; color: var(--muted); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tcard .t-foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12px; color: var(--muted); }

/* Approval cards */
.approval { padding: 18px; }
.approval + .approval { border-top: 1px solid var(--line); }
.money-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 14px 0; }
.money-row div { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.money-row label { display: block; font-size: 11.5px; color: var(--muted); }
.money-row b { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Editable rows (weekly items, proposal scope) */
.rows-editor { display: flex; flex-direction: column; gap: 10px; }
.row-edit { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); position: relative; }
.row-edit .remove { position: absolute; top: 8px; right: 8px; }
.row-edit.items { grid-template-columns: minmax(0, 1.1fr) 140px minmax(0, 1.4fr) minmax(0, 1.2fr) 30px; align-items: start; }
.row-edit.scope { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) 140px minmax(0, 1.1fr) 30px; align-items: start; }
.row-edit.billing { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.6fr) 140px 130px 30px; align-items: start; }
.row-edit .remove { position: static; }
.row-edit .textarea { min-height: 64px; height: 64px; }
.row-headers { display: grid; gap: 8px; padding: 0 13px; font-size: 11.5px; color: var(--muted); font-weight: 500; }

/* ------------------------------------------------------------------ Document (weekly report / proposal) */
.doc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 34px 40px; max-width: 980px; }
.doc-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; padding-bottom: 20px; border-bottom: 2px solid var(--text); margin-bottom: 26px; }
.doc-head img { width: 150px; }
.doc-org { display: inline-block; font-size: 17px; font-weight: 700; letter-spacing: -0.02em; color: var(--brand-ink); padding-left: 10px; border-left: 3px solid var(--accent); }
.doc-head h1 { font-size: 20px; letter-spacing: -0.02em; }
.doc-head .doc-meta { text-align: right; font-size: 12.5px; color: var(--text-2); }
.doc-head .doc-meta b { color: var(--text); }
.doc section { margin-bottom: 26px; break-inside: avoid; }
.doc h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .07em; color: var(--brand-ink); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.doc h2 i { font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; }
.doc .prose { white-space: pre-line; font-size: 13.5px; line-height: 1.65; }
.doc ul.prose-list { margin: 0; padding-left: 18px; font-size: 13.5px; line-height: 1.65; }
.doc .table-wrap { border-radius: 8px; }
.health-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.health-strip div { padding: 10px 12px; border-left: 1px solid var(--line); }
.health-strip div:first-child { border-left: 0; }
.health-strip b { display: block; font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.health-strip span { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.signoff { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 30px; }
.signoff div { border-top: 1px solid var(--line-strong); padding-top: 10px; font-size: 12.5px; color: var(--muted); }
.signoff b { display: block; color: var(--text); font-size: 13.5px; margin-top: 2px; }
.banner { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 13.5px; }
.banner svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.banner.info { background: var(--blue-bg); color: var(--blue); }
.banner.ok { background: var(--green-bg); color: var(--green); }
.banner.warn { background: var(--accent-soft); color: var(--amber); }
.banner .grow { color: var(--text); }
.banner b { color: var(--text); }

/* ------------------------------------------------------------------ Overlays */
.scrim { position: fixed; inset: 0; background: rgba(12, 16, 14, .38); z-index: 60; animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } }
.drawer {
  position: fixed; top: 8px; right: 8px; bottom: 8px; width: min(620px, calc(100vw - 16px)); z-index: 61;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; animation: slidein .2s cubic-bezier(.2, .8, .2, 1);
}
.drawer.wide { width: min(820px, calc(100vw - 16px)); }
@keyframes slidein { from { transform: translateX(24px); opacity: 0; } }
.drawer-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 16px; }
.drawer-head p { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.drawer-head .btn { margin-left: auto; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px; }
.drawer-foot { display: flex; align-items: center; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 14px 14px; }
.drawer-foot .spacer { flex: 1; }
.form-error { display: none; padding: 10px 12px; border-radius: 8px; background: var(--red-bg); color: var(--red); font-size: 13px; margin-bottom: 16px; }
.form-error.show { display: block; }

.modal {
  position: fixed; left: 50%; top: 18vh; transform: translateX(-50%); width: min(440px, calc(100vw - 32px)); z-index: 62;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 20px; animation: pop .16s ease;
}
@keyframes pop { from { transform: translateX(-50%) scale(.97); opacity: 0; } }
.modal h3 { font-size: 16px; margin-bottom: 6px; }
.modal p { color: var(--text-2); font-size: 13.5px; }
.modal .modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

.palette { top: 12vh; width: min(600px, calc(100vw - 32px)); padding: 0; overflow: hidden; }
.palette .p-input { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.palette .p-input svg { width: 17px; height: 17px; color: var(--muted); }
.palette input { flex: 1; height: 52px; border: 0; outline: 0; background: none; font-size: 15px; }
.palette .p-list { max-height: 50vh; overflow-y: auto; padding: 6px; }
.palette .p-group { padding: 8px 10px 4px; font-size: 11.5px; color: var(--muted); font-weight: 500; }
.palette .p-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; cursor: pointer; font-size: 13.5px; }
.palette .p-item svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.palette .p-item.on { background: var(--surface-3); }
.palette .p-item .mono { margin-left: auto; color: var(--muted); }

.menu {
  position: fixed; z-index: 70; min-width: 220px; padding: 6px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow-md); animation: fade .1s ease;
}
.menu button, .menu a { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: 6px; background: none; text-align: left; font-size: 13px; color: var(--text); }
.menu button:hover, .menu a:hover { background: var(--surface-3); }
.menu svg { width: 15px; height: 15px; color: var(--muted); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.menu .menu-head { padding: 8px 10px; font-size: 12px; color: var(--muted); }

#toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 10px; background: var(--text); color: var(--bg);
  font-size: 13px; font-weight: 500; box-shadow: var(--shadow-md); animation: up .2s ease; max-width: 90vw;
}
.toast svg { width: 16px; height: 16px; }
.toast.error { background: var(--red); color: #fff; }
@keyframes up { from { transform: translateY(8px); opacity: 0; } }

/* ------------------------------------------------------------------ Login */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }
.auth-form { display: flex; flex-direction: column; padding: 40px 56px; background: var(--surface); }
.auth-form .inner { width: 100%; max-width: 360px; margin: auto; }
.auth-form .logo img { width: 210px; }
.auth-form .tag { margin-top: 14px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); display: flex; align-items: center; gap: 8px; }
.auth-form .tag::before { content: ""; width: 3px; height: 14px; border-radius: 2px; background: var(--accent); }
.auth-form h1 { font-size: 22px; margin-top: 46px; letter-spacing: -0.02em; }
.auth-form .lead { color: var(--muted); margin-top: 6px; font-size: 13.5px; }
.auth-form form { margin-top: 26px; display: flex; flex-direction: column; gap: 16px; }
.auth-form .btn.primary { height: 40px; margin-top: 4px; font-size: 14px; }
.auth-form .input { height: 40px; }
.auth-form footer { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; gap: 12px; }
.auth-side {
  position: relative; overflow: hidden; background: #0C3B22; color: #E9F1EC; padding: 48px 56px; display: flex; flex-direction: column; justify-content: flex-end;
}
.auth-side::before {
  content: ""; position: absolute; inset: 0; opacity: .5;
  background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 44px 44px; mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent);
}
.auth-side .mark { position: absolute; right: -60px; top: -40px; width: 380px; opacity: .1; filter: grayscale(1) brightness(3); }
.auth-side .quote { position: relative; max-width: 460px; }
.auth-side .quote h2 { font-size: 28px; line-height: 1.25; letter-spacing: -0.025em; font-weight: 600; color: #fff; }
.auth-side .quote h2 em { font-style: normal; color: var(--accent); }
.auth-side .quote p { margin-top: 14px; color: rgba(233, 241, 236, .7); font-size: 14px; line-height: 1.6; }
.auth-side ul { position: relative; list-style: none; padding: 0; margin: 30px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: rgba(255,255,255,.1); border-radius: 10px; overflow: hidden; max-width: 520px; }
.auth-side li { background: #0C3B22; padding: 14px 16px; font-size: 12.5px; color: rgba(233, 241, 236, .7); }
.auth-side li b { display: block; color: #fff; font-size: 13.5px; font-weight: 600; margin-bottom: 2px; }

.auth-alt { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 14px; }
.auth-alt .btn { height: 40px; width: 100%; }
.auth-alt .btn svg { color: var(--amber); }
.auth-alt p { font-size: 13px; color: var(--muted); text-align: center; }
.auth-alt a { color: var(--brand-ink); font-weight: 600; }
.auth-alt a:hover { text-decoration: underline; }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }

/* Workspace chip & demo bar */
.ws { margin: 4px 0 2px; padding: 9px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); min-width: 0; }
.ws span { display: block; font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ws b { display: block; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.demo-bar {
  display: flex; align-items: center; gap: 10px; margin: 0 28px; padding: 9px 12px 9px 14px; border-radius: var(--radius-sm);
  background: var(--accent-soft); color: var(--text); font-size: 13px; border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
}
.demo-bar > svg { color: var(--amber); }
.demo-bar span { flex: 1; min-width: 0; }
@media (max-width: 960px) { .demo-bar { margin: 0 16px; flex-wrap: wrap; } }

/* Settings */
.line-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.line-row:first-child { border-top: 0; }

/* ------------------------------------------------------------------ Guide */
.guide { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.guide .card-body ol, .guide .card-body ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 7px; font-size: 13.5px; color: var(--text-2); }
.legend-table { display: flex; flex-direction: column; gap: 10px; }
.legend-table div { display: grid; grid-template-columns: 140px 1fr; gap: 12px; align-items: center; font-size: 13.5px; color: var(--text-2); }

/* ------------------------------------------------------------------ Responsive */
@media (max-width: 1280px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi:nth-child(4) { border-left: 0; }
  .kpi:nth-child(n+4) { border-top: 1px solid var(--line); }
  .grid.main-side { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 960px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 272px; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  .shell.nav-open .sidebar { transform: none; }
  .shell.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(12,16,14,.35); z-index: 25; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 0 16px; }
  .view { padding: 4px 16px 48px; }
  .search-btn { width: auto; }
  .search-btn .label, .search-btn kbd { display: none; }
  .grid.cols-2, .grid.cols-3, .guide { grid-template-columns: minmax(0, 1fr); }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-side { display: none; }
  .auth-form { padding: 32px 20px; }
  .legend { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stages { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stages div:nth-child(4) { border-left: 0; }
  .stages div:nth-child(n+4) { border-top: 1px solid var(--line); }
  .row-edit.items, .row-edit.scope, .row-edit.billing { grid-template-columns: minmax(0, 1fr); }
  .row-headers { display: none; }
  .doc { padding: 22px 18px; }
  .health-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .money-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { border-left: 0 !important; border-top: 1px solid var(--line); }
  .kpi:nth-child(even) { border-left: 1px solid var(--line) !important; }
  .kpi:nth-child(-n+2) { border-top: 0; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
  .kv dd { margin-bottom: 10px; }
  .toolbar .search { width: 100%; }
  .card-head .sub { display: none; }
  .page-head h1 { font-size: 21px; }
  .drawer { top: 0; right: 0; bottom: 0; width: 100vw; border-radius: 0; }
  .signoff { grid-template-columns: minmax(0, 1fr); }
}

/* ------------------------------------------------------------------ Print (weekly report, proposal) */
@media print {
  @page { size: A4; margin: 14mm; }
  :root { --bg: #fff; --surface: #fff; --surface-2: #f7f7f5; --surface-3: #f0f0ed; --text: #111; }
  body { background: #fff; font-size: 12px; }
  .sidebar, .topbar, .no-print, #toasts, .page-head .actions { display: none !important; }
  .logo-dark { display: none !important; }
  .logo-light { display: block !important; }
  .shell { display: block; }
  .view { padding: 0; max-width: none; }
  .doc { border: 0; padding: 0; max-width: none; }
  .table-wrap { overflow: visible; }
  .table th { position: static; }
  a { color: inherit; }
}
