/* =====================================================================
   Sextant: stylesheet
   Palette: petrol (process plant), olive (product), signal amber/crimson.
   Type: Archivo. Expanded widths for headings, condensed for figures.
   ===================================================================== */
:root {
  --ink: #17212b;
  --ink-2: #4a5866;
  --ink-3: #7d8a96;
  --canvas: #edf0ec;
  --surface: #ffffff;
  --surface-2: #f6f8f5;
  --line: #d8ded8;
  --line-2: #e7ebe6;
  --petrol: #0f5257;
  --petrol-d: #0b3e42;
  --petrol-l: #e3eeec;
  --olive: #6e9f1a;
  --olive-l: #eef5e1;
  --lime: #c9e265;
  --amber: #b86f00;
  --amber-l: #fbf0dc;
  --crimson: #b3261e;
  --crimson-l: #fbe6e4;
  --slate: #4b6584;
  --radius-s: 6px;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(23, 33, 43, .06), 0 4px 14px rgba(23, 33, 43, .05);
  --font: "Archivo", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --fs-xs: .75rem; --fs-s: .844rem; --fs-b: .9375rem; --fs-m: 1.125rem; --fs-l: 1.4rem; --fs-xl: 1.85rem; --fs-xxl: 2.4rem;
  --sidebar: 248px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: var(--fs-b); line-height: 1.5;
  color: var(--ink); background: var(--canvas);
  font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-stretch: 112%; line-height: 1.2; margin: 0; letter-spacing: -.01em; }
a { color: var(--petrol); }
p { margin: 0 0 .75em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--petrol); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--petrol); color: #fff; padding: 8px 12px; z-index: 100; border-radius: var(--radius-s); }
.skip:focus { left: 8px; }
.muted { color: var(--ink-2); }
.num { text-align: right; white-space: nowrap; font-stretch: 92%; }
.ico { width: 18px; height: 18px; flex: none; }

/* ------------------------------------------------------------- shell */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar); flex: none; background: var(--petrol-d); color: #cfe0dd;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 20px 18px 18px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand-mark rect { fill: var(--petrol); }
.sidebar .brand-mark rect { fill: #14666c; }
.brand-mark .m1 { fill: none; stroke: var(--lime); stroke-width: 3; stroke-linejoin: round; }
.brand-mark .m2 { fill: none; stroke: #fff; stroke-width: 2; }
.brand-name { color: #fff; font-weight: 700; font-stretch: 118%; font-size: 1.12rem; letter-spacing: .01em; }
.brand-co { font-size: var(--fs-xs); color: #9dbdb8; max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar nav { padding: 10px 10px 20px; flex: 1; }
.nav-group { font-size: var(--fs-xs); color: #86aaa5; padding: 16px 10px 6px; font-weight: 600; }
.nav-link {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-s);
  color: #d6e6e3; text-decoration: none; font-size: var(--fs-s); margin-bottom: 1px;
}
.nav-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-link.is-active { background: rgba(201, 226, 101, .14); color: #fff; box-shadow: inset 3px 0 0 var(--lime); }
.nav-link.is-active .ico { color: var(--lime); }
.nav-badge { margin-left: auto; background: var(--lime); color: var(--petrol-d); font-size: .7rem; font-weight: 700; border-radius: 99px; padding: 1px 7px; }
.sidebar-foot { padding: 12px 20px; font-size: var(--fs-xs); color: #6f9590; }
.nav-scrim { display: none; }

.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 14px; padding: 12px 28px; background: var(--surface);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; min-height: 64px;
}
.page-title { font-size: var(--fs-l); font-weight: 700; }
.topbar-tools { margin-left: auto; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
.range { display: flex; align-items: center; gap: 6px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 3px 6px; }
.range select { border: 0; background: transparent; padding: 4px 2px; font-weight: 600; cursor: pointer; }
.range-sep { color: var(--ink-3); font-size: var(--fs-s); }
.content { padding: 24px 28px 48px; max-width: 1480px; width: 100%; }
.content:focus { outline: none; }

.icon-btn { background: none; border: 0; padding: 6px; border-radius: var(--radius-s); cursor: pointer; display: inline-flex; color: inherit; }
.icon-btn:hover { background: rgba(0,0,0,.06); }
.only-mobile { display: none; }

/* user menu */
.usermenu { position: relative; }
.user-btn { display: flex; align-items: center; gap: 9px; background: none; border: 0; cursor: pointer; padding: 4px 6px; border-radius: var(--radius-s); text-align: left; }
.user-btn:hover { background: var(--surface-2); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--petrol); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .9rem; }
.user-meta { display: flex; flex-direction: column; line-height: 1.2; }
.user-name { font-size: var(--fs-s); font-weight: 600; }
.user-role { font-size: var(--fs-xs); color: var(--ink-2); }
.user-pop { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 190px; padding: 6px; z-index: 30; }
.user-pop a, .user-pop button { display: flex; gap: 8px; align-items: center; width: 100%; padding: 8px 10px; border: 0; background: none; text-decoration: none; color: var(--ink); border-radius: var(--radius-s); cursor: pointer; font-size: var(--fs-s); }
.user-pop a:hover, .user-pop button:hover { background: var(--surface-2); }
.user-pop form { margin: 0; }

/* switch */
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: var(--fs-s); color: var(--ink-2); }
.switch input { position: absolute; opacity: 0; }
.switch-track { width: 34px; height: 20px; border-radius: 99px; background: #c5ccc6; position: relative; transition: background .15s; flex: none; }
.switch-track::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; background: #fff; top: 2px; left: 2px; transition: transform .15s; }
.switch input:checked + .switch-track { background: var(--amber); }
.switch input:checked + .switch-track::after { transform: translateX(14px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--petrol); outline-offset: 2px; }

/* ------------------------------------------------------------- buttons & forms */
.btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px; border-radius: var(--radius-s);
  border: 1px solid transparent; font-weight: 600; font-size: var(--fs-s); cursor: pointer; text-decoration: none; line-height: 1.2;
  background: var(--surface); color: var(--ink); white-space: nowrap;
}
.btn .ico { width: 16px; height: 16px; }
.btn-primary { background: var(--petrol); color: #fff; }
.btn-primary:hover { background: var(--petrol-d); }
.btn-approve { background: var(--olive); color: #fff; }
.btn-approve:hover { background: #5a8513; }
.btn-danger { background: var(--crimson); color: #fff; }
.btn-danger:hover { background: #8f1d17; }
.btn-ghost { border-color: var(--line); background: var(--surface); }
.btn-ghost:hover { border-color: var(--petrol); color: var(--petrol); }
.btn-sm { padding: 6px 11px; font-size: var(--fs-xs); }
.btn-block { width: 100%; justify-content: center; }
.btn[disabled], .btn.is-disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn.is-busy { opacity: .7; pointer-events: none; }

.field { margin-bottom: 16px; }
.field label, .label { display: block; font-weight: 600; font-size: var(--fs-s); margin-bottom: 5px; }
.field .hint { font-size: var(--fs-xs); color: var(--ink-2); margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], input[type=date], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid #c4ccc5; border-radius: var(--radius-s); background: var(--surface);
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--petrol); outline: 2px solid rgba(15,82,87,.15); outline-offset: 0; }
.has-error input, .has-error select, input.is-invalid { border-color: var(--crimson); background: #fffafa; }
.err { color: var(--crimson); font-size: var(--fs-xs); margin-top: 4px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 20px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding-top: 8px; }
.check-inline { display: inline-flex; align-items: center; gap: 7px; font-size: var(--fs-s); cursor: pointer; }
.check-inline input { width: auto; }
.inline-select { width: auto; display: inline-block; padding: 2px 6px; font-weight: 600; }

/* ------------------------------------------------------------- flashes, toasts */
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: var(--radius-s); margin-bottom: 16px; font-size: var(--fs-s); border: 1px solid; }
.flash span { flex: 1; }
.flash-success { background: var(--olive-l); border-color: #c7dea0; color: #3c5a0b; }
.flash-error { background: var(--crimson-l); border-color: #efbdb8; color: #85190f; }
.flash-info { background: var(--petrol-l); border-color: #bcd6d2; color: var(--petrol-d); }
.flash-warning { background: var(--amber-l); border-color: #edd3a4; color: #7a4a00; }
.flash-x { background: none; border: 0; cursor: pointer; color: inherit; padding: 0; opacity: .6; }
.toast-zone { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 90; }
.toast { background: var(--ink); color: #fff; padding: 11px 16px; border-radius: var(--radius-s); font-size: var(--fs-s); box-shadow: var(--shadow); max-width: 360px; animation: toast-in .2s ease-out; }
.toast-error { background: var(--crimson); }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

/* ------------------------------------------------------------- loading / empty */
.loading { display: flex; align-items: center; gap: 12px; padding: 60px 0; justify-content: center; color: var(--ink-2); }
.spinner { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--petrol); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state { text-align: center; padding: 70px 20px; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }
.empty-state h2 { font-size: var(--fs-l); margin-bottom: 8px; }
.empty-state p { color: var(--ink-2); }

/* ------------------------------------------------------------- panels & grid */
.grid { display: grid; gap: 20px; margin-bottom: 20px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 20px; min-width: 0; }
.grid > .panel { margin-bottom: 0; }
.panel-head { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; padding: 16px 20px 0; flex-wrap: wrap; }
.panel-head h2 { font-size: var(--fs-m); font-weight: 650; }
.panel-sub { font-size: var(--fs-xs); color: var(--ink-2); margin: 3px 0 0; max-width: 70ch; }
.panel-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.panel-body { padding: 14px 20px 18px; }
.chart { position: relative; width: 100%; }
.chart-sm { height: 220px; }
.chart-md { height: 280px; }
.chart-lg { height: 340px; }
.split-donuts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ------------------------------------------------------------- hero / year strip (signature) */
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 28px; align-items: center; margin-bottom: 22px; }
.strip { display: grid; grid-template-columns: repeat(var(--n, 6), minmax(0, 1fr)); gap: 6px; height: 188px; }
.strip-year {
  border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-s); cursor: pointer;
  display: flex; flex-direction: column; justify-content: flex-end; padding: 10px 8px 9px; text-align: left; position: relative; overflow: hidden;
  transition: border-color .15s, background .15s;
}
.strip-year:hover { border-color: var(--petrol); }
.strip-bar { position: absolute; left: 8px; right: 8px; bottom: 60px; background: #cfdcc0; border-radius: 3px 3px 0 0; }
.strip-y { font-weight: 700; font-stretch: 85%; font-size: 1.15rem; position: relative; }
.strip-m { font-size: var(--fs-xs); color: var(--ink-2); position: relative; }
.strip-year.is-on { background: var(--petrol); border-color: var(--petrol); color: #fff; }
.strip-year.is-on .strip-bar { background: var(--lime); }
.strip-year.is-on .strip-m { color: #cde3df; }
.strip-year.is-cmp { border-color: var(--petrol); border-style: dashed; }
.strip-flag { position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); }
.hero-kicker { font-size: var(--fs-s); color: var(--ink-2); margin-bottom: 6px; font-weight: 600; }
.headline { font-size: var(--fs-xl); font-weight: 600; font-stretch: 108%; line-height: 1.22; letter-spacing: -.015em; margin-bottom: 14px; max-width: 30ch; }
.headline .up { color: var(--olive); }
.headline .down { color: var(--crimson); }
.hero-meta { display: flex; align-items: center; gap: 10px; font-size: var(--fs-s); color: var(--ink-2); flex-wrap: wrap; }
.hero-meta select { width: auto; padding: 5px 8px; }

/* ------------------------------------------------------------- KPI ledger */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 20px; overflow: hidden; }
.kpi { padding: 14px 18px 12px; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); cursor: pointer; background: none; border-top: 0; border-left: 0; text-align: left; position: relative; }
.kpi:hover { background: var(--surface-2); }
.kpi-label { font-size: var(--fs-xs); color: var(--ink-2); font-weight: 600; display: block; }
.kpi-value { font-size: 1.65rem; font-weight: 700; font-stretch: 82%; line-height: 1.15; display: block; margin: 3px 0 2px; letter-spacing: -.01em; }
.kpi-unit { font-size: .8rem; font-weight: 500; color: var(--ink-2); margin-left: 3px; font-stretch: 100%; }
.kpi-delta { font-size: var(--fs-xs); font-weight: 600; display: inline-flex; gap: 4px; align-items: center; }
.kpi-delta.good { color: var(--olive); }
.kpi-delta.bad { color: var(--crimson); }
.kpi-delta.flat { color: var(--ink-3); }
.kpi-spark { position: absolute; right: 14px; top: 13px; width: 56px !important; height: 20px !important; }
.kpi-label { padding-right: 62px; }
.kpi.alert::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--crimson); }

/* ------------------------------------------------------------- insights */
.insights { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.insight { display: grid; grid-template-columns: 10px 1fr; gap: 10px; padding: 10px 12px; border-radius: var(--radius-s); background: var(--surface-2); cursor: default; }
.insight::before { content: ""; width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; background: var(--ink-3); }
.insight.critical::before { background: var(--crimson); }
.insight.warning::before { background: var(--amber); }
.insight.good::before { background: var(--olive); }
.insight.info::before { background: var(--slate); }
.insight strong { display: block; font-size: var(--fs-s); }
.insight span { font-size: var(--fs-xs); color: var(--ink-2); }
.insights-empty { color: var(--ink-2); font-size: var(--fs-s); }

/* ------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line-2); border-radius: var(--radius-s); }
.table-tools { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.table-search { max-width: 280px; }
table.data { width: 100%; border-collapse: collapse; font-size: var(--fs-s); }
table.data th, table.data td { padding: 8px 12px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
table.data thead th { background: var(--surface-2); font-weight: 650; text-align: left; position: sticky; top: 0; white-space: nowrap; font-size: var(--fs-xs); color: var(--ink-2); }
table.data thead th.num { text-align: right; }
table.data th.sortable { cursor: pointer; user-select: none; }
table.data th.sortable::after { content: " ⇅"; color: var(--ink-3); font-size: .7rem; }
table.data th.sort-asc::after { content: " ↑"; color: var(--petrol); }
table.data th.sort-desc::after { content: " ↓"; color: var(--petrol); }
table.data tbody tr:hover td { background: #f8faf7; }
table.data td:first-child, table.data th:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; }
table.data thead th:first-child { background: var(--surface-2); z-index: 2; }
table.data tr.total td { font-weight: 700; border-top: 1px solid var(--ink-3); }
table.data tr.section td { background: var(--petrol-l); color: var(--petrol-d); font-weight: 650; font-size: var(--fs-xs); padding-top: 6px; padding-bottom: 6px; }
table.data td.focus, table.data th.focus { background: #f3f8e8; }
table.data tr:hover td.focus { background: #ecf3dc; }
table.data .unit { color: var(--ink-3); font-size: var(--fs-xs); white-space: nowrap; }
.neg { color: var(--crimson); }
.pos { color: var(--olive); }
.heat { border-radius: 3px; }
.tag { display: inline-block; font-size: .65rem; font-weight: 700; padding: 1px 5px; border-radius: 3px; vertical-align: middle; margin-right: 2px; }
.tag-p { background: var(--petrol-l); color: var(--petrol); }
.tag-c { background: var(--olive-l); color: #4d7310; }
.recon-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--amber); margin-left: 4px; vertical-align: middle; }
td.empty-row { text-align: center; color: var(--ink-2); padding: 28px; }

/* status badges */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-xs); font-weight: 650; padding: 2px 9px; border-radius: 99px; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-draft { background: #eceeef; color: #4a5866; }
.badge-submitted { background: var(--amber-l); color: #8a5300; }
.badge-reviewed { background: #e4ebf3; color: var(--slate); }
.badge-approved { background: var(--olive-l); color: #4d7310; }
.badge-pending, .badge-revision { background: var(--amber-l); color: #8a5300; }
.badge-sample { background: #f1e6f5; color: #6b2f86; }
.badge-error { background: var(--crimson-l); color: var(--crimson); }
.badge-warning { background: var(--amber-l); color: #8a5300; }
.badge-pass { background: var(--olive-l); color: #4d7310; }

/* ------------------------------------------------------------- tabs, segmented, chips */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tab { background: none; border: 0; padding: 10px 14px; font-weight: 600; color: var(--ink-2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-size: var(--fs-s); }
.tab:hover { color: var(--ink); }
.tab.is-on { color: var(--petrol); border-bottom-color: var(--petrol); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; }
.seg button { border: 0; background: var(--surface); padding: 6px 11px; font-size: var(--fs-xs); font-weight: 600; cursor: pointer; color: var(--ink-2); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.is-on { background: var(--petrol); color: #fff; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 99px; padding: 4px 11px; font-size: var(--fs-xs); cursor: pointer; background: var(--surface); font-weight: 600; color: var(--ink-2); }
.chip .sw { width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--ink-3)); }
.chip.is-on { border-color: var(--c, var(--petrol)); color: var(--ink); background: var(--surface-2); }
.chip:not(.is-on) .sw { background: transparent; border: 1px solid var(--ink-3); }

/* ------------------------------------------------------------- ratio cards */
.ratio-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 12px; margin-bottom: 20px; }
.rcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 12px; cursor: pointer; text-align: left; position: relative; }
.rcard:hover { border-color: var(--petrol); }
.rcard-label { font-size: var(--fs-xs); font-weight: 650; color: var(--ink-2); display: flex; justify-content: space-between; gap: 6px; }
.rcard-value { font-size: 1.5rem; font-weight: 700; font-stretch: 82%; display: block; margin: 4px 0 0; }
.rcard-foot { display: flex; justify-content: space-between; align-items: end; gap: 8px; margin-top: 4px; }
.rcard canvas { width: 90px !important; height: 30px !important; }
.rcard.breach { border-color: #e7b3ae; box-shadow: inset 3px 0 0 var(--crimson); }

/* ------------------------------------------------------------- variance / dupont */
.variance-pick { display: flex; gap: 16px; align-items: end; margin-bottom: 18px; flex-wrap: wrap; }
.variance-pick label { font-size: var(--fs-s); font-weight: 600; display: flex; flex-direction: column; gap: 4px; }
.variance-pick select { width: 140px; }
.dupont { overflow-x: auto; padding: 6px 0 4px; }
.dp-inner { width: max-content; margin: 0 auto; display: flex; justify-content: center; }
.dp-level { display: flex; justify-content: center; gap: 18px; position: relative; padding-top: 22px; }
.dp-level:first-child { padding-top: 0; }
.dp-group { display: flex; flex-direction: column; align-items: center; }
.dp-row { display: flex; gap: 12px; align-items: flex-start; justify-content: center; position: relative; padding-top: 22px; }
.dp-row::before { content: ""; position: absolute; top: 10px; left: 22%; right: 22%; height: 12px; border: 1.5px solid var(--line); border-bottom: 0; border-radius: 6px 6px 0 0; }
.dp-op { position: absolute; top: 2px; left: 50%; transform: translateX(-50%); background: var(--surface); padding: 0 6px; font-weight: 700; color: var(--petrol); font-size: .9rem; line-height: 1; }
.dp-node { border: 1px solid var(--line); background: var(--surface-2); border-radius: var(--radius-s); padding: 7px 10px; text-align: center; min-width: 108px; position: relative; white-space: nowrap; }
.dp-node::before { content: ""; position: absolute; top: -12px; left: 50%; height: 12px; border-left: 1.5px solid var(--line); }
.dp-inner > .dp-group > .dp-node::before { display: none; }
.dp-node.key { background: var(--petrol); border-color: var(--petrol); color: #fff; }
.dp-node.key .dp-delta { color: #cde3df; }
.dp-node.mid { background: var(--petrol-l); border-color: #bcd6d2; }
.dp-name { font-size: var(--fs-xs); font-weight: 650; display: block; }
.dp-val { font-size: 1.05rem; font-weight: 700; font-stretch: 85%; display: block; }
.dp-delta { font-size: .7rem; color: var(--ink-2); display: block; }
.dupont-note { margin-top: 18px; font-size: var(--fs-s); color: var(--ink-2); max-width: 85ch; }

/* ------------------------------------------------------------- modal / drawer */
.modal { position: fixed; inset: 0; background: rgba(15, 30, 35, .45); z-index: 80; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow-y: auto; }
.modal[hidden] { display: none; }
.modal-card { background: var(--surface); border-radius: var(--radius); width: 100%; max-width: 760px; box-shadow: 0 20px 50px rgba(0,0,0,.25); animation: modal-in .18s ease-out; }
.modal-card.wide { max-width: 980px; }
@keyframes modal-in { from { transform: translateY(10px); opacity: 0; } }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.modal-head h2 { font-size: var(--fs-m); }
.modal-body { padding: 18px 20px 22px; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 18px; margin-bottom: 16px; }
.kv div { border-left: 2px solid var(--line); padding-left: 10px; }
.kv dt { font-size: var(--fs-xs); color: var(--ink-2); }
.kv dd { margin: 0; font-weight: 700; font-stretch: 88%; font-size: 1.05rem; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }

/* ------------------------------------------------------------- data management */
.toolbar { display: flex; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar-left { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.section-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 18px; }
.section-card > h2 { font-size: var(--fs-m); padding: 16px 20px 0; }
.section-card > .intro { font-size: var(--fs-xs); color: var(--ink-2); padding: 3px 20px 0; margin: 0; }
.section-card > .inner { padding: 16px 20px 6px; }
.money-input { position: relative; }
.money-input input { text-align: right; padding-right: 54px; font-stretch: 92%; }
.money-input .u { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: var(--fs-xs); color: var(--ink-3); pointer-events: none; }
.field.subtotal label::after { content: " (subtotal)"; color: var(--ink-3); font-weight: 400; }
.live-check { font-size: var(--fs-xs); margin-top: 4px; }
.live-check.ok { color: var(--olive); }
.live-check.bad { color: var(--crimson); }
.sticky-actions { position: sticky; bottom: 0; background: rgba(237,240,236,.94); backdrop-filter: blur(4px); padding: 12px 0; border-top: 1px solid var(--line); margin-top: 8px; z-index: 5; }
.checks { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.checks li { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; padding: 9px 12px; border-radius: var(--radius-s); background: var(--surface-2); font-size: var(--fs-s); }
.checks li small { display: block; color: var(--ink-2); font-size: var(--fs-xs); }
.timeline { list-style: none; margin: 0; padding: 0 0 0 16px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 16px 14px; font-size: var(--fs-s); }
.timeline li::before { content: ""; position: absolute; left: -22px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--petrol); }
.timeline .when { color: var(--ink-3); font-size: var(--fs-xs); }
.timeline .comment { background: var(--surface-2); padding: 7px 10px; border-radius: var(--radius-s); margin-top: 5px; font-size: var(--fs-xs); white-space: pre-wrap; }
.stepper { display: flex; gap: 0; margin: 0 0 20px; padding: 0; list-style: none; counter-reset: s; flex-wrap: wrap; }
.step { flex: 1; min-width: 120px; padding: 10px 12px 10px 38px; position: relative; background: var(--surface); border: 1px solid var(--line); font-size: var(--fs-xs); color: var(--ink-2); }
.step + .step { border-left: 0; }
.step:first-child { border-radius: var(--radius-s) 0 0 var(--radius-s); }
.step:last-child { border-radius: 0 var(--radius-s) var(--radius-s) 0; }
.step::before { counter-increment: s; content: counter(s); position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--line-2); font-weight: 700; color: var(--ink-2); }
.step strong { display: block; color: var(--ink); font-size: var(--fs-s); }
.step.done::before { background: var(--olive); color: #fff; content: "✓"; }
.step.current { background: var(--petrol-l); border-color: #bcd6d2; }
.step.current::before { background: var(--petrol); color: #fff; }
.two-col { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat b { display: block; font-size: 1.6rem; font-stretch: 82%; }
.stat span { font-size: var(--fs-xs); color: var(--ink-2); }
.pager { display: flex; gap: 6px; align-items: center; justify-content: flex-end; margin-top: 12px; font-size: var(--fs-s); }
.filters-bar { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; align-items: end; margin-bottom: 14px; }
.filters-bar label { font-size: var(--fs-xs); font-weight: 600; display: flex; flex-direction: column; gap: 4px; }

/* reports */
.report-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.report-opt { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; cursor: pointer; background: var(--surface); display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; }
.report-opt:hover { border-color: var(--petrol); }
.report-opt input { margin-top: 4px; }
.report-opt strong { display: block; font-size: var(--fs-s); }
.report-opt span { font-size: var(--fs-xs); color: var(--ink-2); }
.report-opt:has(input:checked) { border-color: var(--petrol); background: var(--petrol-l); }
.format-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ------------------------------------------------------------- auth */
.auth-body { background: var(--surface); }
.auth { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.auth-art { background: var(--petrol-d); color: #fff; display: flex; align-items: center; padding: 48px; position: relative; overflow: hidden; }
.auth-art-inner { max-width: 460px; }
.brand-mark.lg { width: 52px; height: 52px; margin-bottom: 28px; }
.brand-mark.lg rect { fill: #14666c; }
.auth-claim { font-size: 2.3rem; font-weight: 650; font-stretch: 115%; line-height: 1.12; letter-spacing: -.02em; margin-bottom: 40px; }
.auth-strip { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; height: 150px; align-items: end; }
.auth-bar { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; gap: 6px; }
.auth-bar span { background: rgba(201, 226, 101, .85); border-radius: 3px 3px 0 0; display: block; }
.auth-bar:last-child span { background: var(--lime); }
.auth-bar em { font-style: normal; font-size: .75rem; color: #9dbdb8; text-align: center; font-stretch: 85%; }
.auth-caption { font-size: .75rem; color: #86aaa5; margin-top: 10px; }
.auth-form-wrap { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-form { width: 100%; max-width: 360px; }
.auth-form h1 { font-size: var(--fs-xl); margin-bottom: 6px; }
.auth-form .muted { margin-bottom: 24px; }
.fine { font-size: var(--fs-xs); color: var(--ink-2); margin-top: 16px; }

/* ------------------------------------------------------------- responsive */
@media (max-width: 1180px) {
  .g-2-1 { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 60; transform: translateX(-100%); transition: transform .2s ease-out; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .nav-scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 55; }
  .only-mobile { display: inline-flex; }
  .brand .only-mobile { margin-left: auto; color: #fff; }
  .g-2, .g-3 { grid-template-columns: 1fr; }
  .topbar { padding: 10px 16px; flex-wrap: wrap; }
  .content { padding: 18px 16px 40px; }
  .user-meta { display: none; }
}
@media (max-width: 640px) {
  .topbar-tools { width: 100%; justify-content: space-between; }
  .switch-text { display: none; }
  .headline { font-size: var(--fs-l); }
  .strip { height: 150px; gap: 4px; }
  .strip-m { display: none; }
  .strip-y { font-size: .8rem; }
  .strip-year { padding: 8px 4px; }
  .strip-bar { bottom: 34px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-spark { display: none; }
  .split-donuts { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { padding: 32px 24px; }
  .auth-claim { font-size: 1.6rem; margin-bottom: 20px; }
  .auth-strip { height: 90px; }
  .chart-lg { height: 300px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media print {
  .sidebar, .topbar, .toast-zone, .panel-tools, .table-tools, .btn, .tabs, .chip-row { display: none !important; }
  body { background: #fff; }
  .content { padding: 0; max-width: none; }
  .panel { break-inside: avoid; border-color: #bbb; }
  .grid { display: block; }
}
