:root {
  --ink: #19231d;
  --ink-soft: #34483d;
  --muted: #6f7a72;
  --faint: #98a39b;
  --line: #e4e0d4;
  --line-strong: #d2cdbf;
  --bg: #f4f2eb;
  --paper: #fffdf8;
  --white: #fff;
  --forest: #164a38;
  --forest-deep: #0e3126;
  --forest-soft: #dfeadf;
  --lime: #d9ecb8;
  --lime-deep: #aacd80;
  --coral: #d46a43;
  --coral-soft: #fae7de;
  --danger: #ad4034;
  --danger-soft: #fae6e2;
  --amber: #9b671c;
  --amber-soft: #fbf0d9;
  --blue: #315f7a;
  --blue-soft: #e4eef5;
  --shadow: 0 18px 50px rgba(30, 42, 34, .06);
  --shadow-soft: 0 8px 26px rgba(30, 42, 34, .05);
  --radius: 20px;
  --radius-sm: 13px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font: 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body::selection { background: var(--lime); color: var(--forest-deep); }
a { color: var(--forest); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: #0b3628; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
svg { width: 1em; height: 1em; }
h1, h2, h3, h4, p { margin-top: 0; }
h1, .display { font-family: var(--serif); font-weight: 600; letter-spacing: -.025em; }
h2, h3 { letter-spacing: -.01em; }
h1 { font-size: clamp(32px, 4vw, 45px); line-height: 1.08; margin-bottom: 12px; }
h2 { font-size: 22px; line-height: 1.25; }
h3 { font-size: 17px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small-text { font-size: 13px; }
.mono { font-family: "Cascadia Mono", Consolas, monospace; font-size: 13px; }
.nowrap { white-space: nowrap; }
.inline { display: inline; }
.hidden { display: none !important; }
.skip-link { position: absolute; left: -999px; top: 10px; background: var(--lime); color: var(--forest-deep); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 10px; }

/* App shell */
.app-body { background: var(--bg); }
.shell { display: grid; grid-template-columns: 258px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 24px 18px 18px;
  color: #edf4ec;
  background:
    radial-gradient(circle at 15% 0%, rgba(196, 227, 160, .12), transparent 32%),
    linear-gradient(160deg, #174c3a 0%, #0e3127 68%, #0b2a21 100%);
  display: flex; flex-direction: column; overflow-y: auto; z-index: 20;
}
.sidebar::after {
  content: ""; position: absolute; inset: auto -40px -70px auto; width: 190px; height: 190px;
  border: 1px solid rgba(217, 236, 184, .13); border-radius: 50%; pointer-events: none;
}
.brand { display: inline-flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; }
.sidebar .brand { color: #f4f8ef; padding: 2px 7px 22px; }
.brand-mark {
  display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 auto;
  background: var(--lime); color: var(--forest-deep); border-radius: 12px;
}
.brand-mark svg { width: 26px; height: 26px; fill: none; stroke: currentColor; }
.brand strong { display: block; font-size: 15px; letter-spacing: .01em; line-height: 1.15; }
.brand small { display: block; font-size: 11px; color: rgba(240, 248, 236, .62); letter-spacing: .05em; text-transform: uppercase; margin-top: 3px; }
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-nav a {
  display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 9px 11px; border-radius: 11px;
  color: rgba(241, 247, 238, .73); text-decoration: none; font-size: 13.5px; font-weight: 560;
  transition: background .15s ease, color .15s ease, transform .15s ease;
}
.side-nav a:hover { color: #fff; background: rgba(255,255,255,.07); }
.side-nav a.active { background: var(--lime); color: var(--forest-deep); box-shadow: 0 7px 18px rgba(3, 20, 14, .18); }
.side-nav a.active .nav-ico { color: var(--forest-deep); }
.nav-ico { width: 19px; height: 19px; display: grid; place-items: center; flex: 0 0 auto; color: rgba(235, 246, 231, .72); }
.nav-ico svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav-badge {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; display: grid; place-items: center;
  border-radius: 999px; background: var(--coral); color: #fff; font-size: 11px; font-weight: 700;
}
.side-nav a.active .nav-badge { background: var(--forest-deep); color: var(--lime); }
.side-bottom { margin-top: auto; padding-top: 20px; position: relative; z-index: 1; }
.profile-chip {
  display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px;
  background: rgba(255,255,255,.065); border: 1px solid rgba(255,255,255,.08);
}
.avatar {
  width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%;
  background: #d3e8ae; color: var(--forest-deep); font-weight: 800; font-size: 14px;
}
.profile-text { min-width: 0; }
.profile-text strong { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-text small { display: block; color: rgba(240,248,236,.55); font-size: 10.5px; margin-top: 2px; }
.side-links { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 7px 0; font-size: 12px; }
.side-links a { color: rgba(240,248,236,.68); text-decoration: none; }
.side-links a:hover { color: #fff; }
.text-button { border: 0; background: none; color: rgba(240,248,236,.68); padding: 0; font-size: 12px; }
.text-button:hover { color: #fff; }
.main-wrap { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 15; display: flex; align-items: center; gap: 16px;
  min-height: 74px; padding: 12px clamp(18px, 3.4vw, 44px);
  background: rgba(244, 242, 235, .84); backdrop-filter: blur(15px); border-bottom: 1px solid rgba(217, 212, 199, .65);
}
.topbar-title { min-width: 0; }
.topbar-kicker { display: block; font-size: 10px; letter-spacing: .13em; text-transform: uppercase; color: var(--faint); font-weight: 800; margin-bottom: 2px; }
.topbar-title strong { font-family: var(--serif); font-size: 22px; line-height: 1.1; font-weight: 600; }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.menu-button { display: none; }
.content { width: 100%; max-width: 1320px; margin: 0 auto; padding: clamp(22px, 3vw, 38px) clamp(16px, 3.4vw, 44px) 54px; flex: 1; }
.app-footer {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap; justify-content: center;
  padding: 22px 20px 30px; color: var(--faint); font-size: 11.5px;
}
.app-footer a { color: var(--muted); }
.footer-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--faint); }

/* Shared components */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-head h1 { margin-bottom: 5px; font-size: clamp(31px, 3.2vw, 42px); }
.page-head p { margin: 0; color: var(--muted); max-width: 62ch; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.eyebrow { margin: 0 0 8px; color: var(--forest); text-transform: uppercase; letter-spacing: .14em; font-size: 10px; font-weight: 800; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 40px; padding: 9px 16px; border: 1px solid var(--forest); border-radius: 11px;
  background: var(--forest); color: #fff; font-size: 13px; font-weight: 650; line-height: 1.2;
  text-decoration: none; transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.button:hover { color: #fff; background: var(--forest-deep); transform: translateY(-1px); box-shadow: 0 7px 18px rgba(22, 74, 56, .16); }
.button.ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.button.ghost:hover { background: var(--paper); color: var(--ink); box-shadow: none; }
.button.lime { background: var(--lime); border-color: var(--lime); color: var(--forest-deep); }
.button.lime:hover { background: #e4f4ca; color: var(--forest-deep); }
.button.danger { background: var(--danger); border-color: var(--danger); }
.button.danger:hover { background: #8f2f26; }
.button.small { min-height: 34px; padding: 7px 12px; font-size: 12px; border-radius: 9px; }
.button.tiny { min-height: 28px; padding: 5px 9px; font-size: 11px; border-radius: 8px; }
.button.wide { width: 100%; }
.button:disabled { opacity: .55; cursor: wait; }
.text-link { background: none; border: 0; padding: 0; color: var(--forest); font-weight: 650; text-decoration: underline; text-underline-offset: 3px; }
.icon-button { display: inline-grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); }
.icon-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-soft); }
.panel { padding: clamp(17px, 2.2vw, 26px); }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 17px; }
.panel-head h2, .panel-head h3 { margin: 0; }
.panel-head p { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; }
.panel-link { font-size: 12px; font-weight: 650; white-space: nowrap; text-decoration: none; }
.alert { padding: 12px 14px; border-radius: var(--radius-sm); font-size: 13px; margin: 0 0 18px; border: 1px solid transparent; }
.alert.error { background: var(--danger-soft); color: var(--danger); border-color: #efc9c3; }
.alert.success { background: var(--forest-soft); color: var(--forest); border-color: #c9dfcd; }
.alert.notice { background: var(--amber-soft); color: var(--amber); border-color: #ebd6a7; }
.alert.info { background: var(--blue-soft); color: var(--blue); border-color: #cadae5; }
.alert strong { display: block; margin-bottom: 2px; }
.alert a { color: inherit; }
.pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 999px;
  font-size: 10.5px; font-weight: 750; letter-spacing: .02em; white-space: nowrap;
  background: #eeede7; color: #5d675f;
}
.pill.good { background: var(--forest-soft); color: var(--forest); }
.pill.warn { background: var(--amber-soft); color: var(--amber); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }
.pill.info { background: var(--blue-soft); color: var(--blue); }
.pill.muted { background: #efeee9; color: #858d86; }
.pill.duplicate { background: #f5e8dc; color: #9b5b2d; }
.pill .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.pill-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.money.positive { color: var(--forest); }
.money.negative { color: var(--danger); }
.amount-lg { font-family: var(--serif); font-size: clamp(38px, 5vw, 58px); line-height: 1; letter-spacing: -.035em; }
.amount-md { font-family: var(--serif); font-size: 31px; line-height: 1.05; letter-spacing: -.025em; }
.amount-sm { font-weight: 700; font-variant-numeric: tabular-nums; }
.divider { height: 1px; background: var(--line); border: 0; margin: 18px 0; }
.hr-space { margin: 26px 0; }
.stack { display: grid; gap: 18px; }
.stack-sm { display: grid; gap: 10px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, .8fr); gap: 22px; align-items: start; }
.equal-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; align-items: start; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field-grid .span-2 { grid-column: span 2; }
label { display: block; font-size: 11.5px; font-weight: 750; color: var(--ink-soft); margin-bottom: 6px; }
label .hint { font-weight: 500; color: var(--faint); }
input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 10px;
  background: #fff; color: var(--ink); font-size: 13.5px; line-height: 1.35; outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus { border-color: var(--forest); box-shadow: 0 0 0 3px rgba(22, 74, 56, .11); }
input[type="checkbox"] { width: auto; }
textarea { min-height: 110px; resize: vertical; }
.form-actions { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; margin-top: 18px; }
.check { display: flex; align-items: flex-start; gap: 9px; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.check input { margin-top: 3px; }
.help { color: var(--muted); font-size: 12px; margin: 7px 0 0; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.metric-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.metric-row:last-child { border-bottom: 0; }
.metric-row span:first-child { color: var(--muted); font-size: 12.5px; }
.metric-row strong { font-variant-numeric: tabular-nums; }
.empty {
  padding: 38px 22px; text-align: center; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm);
  background: rgba(255,255,255,.34); color: var(--muted);
}
.empty strong { display: block; color: var(--ink); font-family: var(--serif); font-size: 21px; margin-bottom: 5px; }
.empty p { margin: 0 auto 14px; max-width: 50ch; font-size: 13px; }
.empty .button { margin: 3px; }
.tabs { display: flex; gap: 4px; padding: 4px; background: #e9e6dd; border-radius: 11px; overflow-x: auto; }
.tabs a { text-decoration: none; color: var(--muted); font-size: 12px; font-weight: 650; padding: 7px 10px; border-radius: 8px; white-space: nowrap; }
.tabs a.active { background: var(--paper); color: var(--ink); box-shadow: 0 2px 6px rgba(30,40,33,.07); }
.tabs a:hover { color: var(--ink); }

/* Dashboard */
.dashboard-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.dashboard-intro h1 { margin-bottom: 5px; }
.dashboard-intro p { margin: 0; color: var(--muted); }
.range-tabs { display: flex; gap: 3px; padding: 4px; border-radius: 10px; background: #e9e6dd; }
.range-tabs a { padding: 6px 9px; border-radius: 7px; text-decoration: none; color: var(--muted); font-size: 11.5px; font-weight: 650; white-space: nowrap; }
.range-tabs a.active { background: var(--paper); color: var(--ink); box-shadow: 0 2px 7px rgba(30,40,33,.07); }
.stat-grid { display: grid; grid-template-columns: 1.35fr repeat(3, minmax(0, 1fr)); gap: 14px; }
.stat-card { min-height: 152px; padding: 19px; display: flex; flex-direction: column; border-radius: 18px; background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow-soft); position: relative; overflow: hidden; }
.stat-card.primary { background: linear-gradient(145deg, var(--forest) 0%, var(--forest-deep) 100%); border-color: var(--forest); color: #f2f8ee; }
.stat-card.primary::after { content: ""; position: absolute; width: 180px; height: 180px; border-radius: 50%; right: -70px; bottom: -100px; border: 1px solid rgba(217,236,184,.22); }
.stat-card.primary::before { content: ""; position: absolute; width: 120px; height: 120px; border-radius: 50%; right: -28px; bottom: -55px; background: rgba(217,236,184,.06); }
.stat-label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.stat-card.primary .stat-label { color: rgba(233, 245, 227, .65); }
.stat-value { margin: auto 0 4px; font-family: var(--serif); font-size: clamp(27px, 2.6vw, 37px); letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-card.primary .stat-value { font-size: clamp(34px, 3.8vw, 52px); color: #f5faee; }
.stat-note { color: var(--muted); font-size: 11.5px; position: relative; z-index: 1; }
.stat-card.primary .stat-note { color: rgba(233,245,227,.6); }
.stat-split { display: flex; gap: 16px; margin-top: 10px; position: relative; z-index: 1; }
.stat-split div { display: grid; gap: 1px; }
.stat-split span { color: rgba(233,245,227,.55); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.stat-split strong { color: #f5faee; font-size: 13px; font-variant-numeric: tabular-nums; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(290px, .75fr); gap: 18px; margin-top: 18px; align-items: start; }
.attention-list { display: grid; gap: 1px; }
.attention-item { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 11px; align-items: center; padding: 11px 4px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.attention-item:last-child { border-bottom: 0; }
.attention-item:hover .attention-title { color: var(--forest); }
.attention-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--amber-soft); color: var(--amber); font-size: 13px; font-weight: 800; }
.attention-icon.danger { background: var(--danger-soft); color: var(--danger); }
.attention-icon.info { background: var(--blue-soft); color: var(--blue); }
.attention-title { font-size: 12.5px; font-weight: 650; line-height: 1.3; }
.attention-desc { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.attention-arrow { color: var(--faint); font-size: 17px; }
.chart-wrap { padding-top: 4px; }
.chart {
  height: 215px; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px;
  padding: 15px 8px 0; border-bottom: 1px solid var(--line); background-image: linear-gradient(to top, var(--line) 1px, transparent 1px);
  background-size: 100% 25%;
}
.chart-month { height: 100%; flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; min-width: 0; }
.chart-bars { height: calc(100% - 18px); width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 4px; }
.chart-bar { width: 38%; max-width: 24px; min-height: 3px; border-radius: 5px 5px 2px 2px; background: var(--forest); transition: height .3s ease; }
.chart-bar.out { background: var(--coral); }
.chart-month-label { font-size: 10px; color: var(--faint); text-align: center; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 11px; font-size: 11px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 7px; height: 7px; border-radius: 2px; background: var(--forest); display: inline-block; }
.legend i.out { background: var(--coral); }
.recent-list { display: grid; }
.recent-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.recent-row:last-child { border-bottom: 0; }
.recent-title { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-meta { font-size: 10.5px; color: var(--faint); margin-top: 2px; }
.recent-amount { text-align: right; font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.recent-amount small { display: block; font-size: 9.5px; color: var(--faint); font-weight: 500; margin-top: 2px; }
.top-parties { display: grid; gap: 9px; }
.party-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; font-size: 12px; }
.party-row span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.party-row strong { font-variant-numeric: tabular-nums; white-space: nowrap; }
.progress { height: 4px; background: #ece9df; border-radius: 99px; overflow: hidden; margin-top: 5px; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--forest); }
.welcome-card { background: linear-gradient(150deg, #fbfaf5, #f1f4e9); border-color: #dfe5d4; }
.welcome-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 25px; align-items: center; }
.welcome-grid h2 { font-family: var(--serif); font-size: 30px; font-weight: 600; }
.check-list { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 10px; }
.check-list li { display: flex; gap: 9px; align-items: flex-start; font-size: 13px; color: var(--ink-soft); }
.check-list li::before { content: ""; width: 18px; height: 18px; flex: 0 0 auto; margin-top: 1px; border-radius: 50%; background: var(--forest-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23164a38' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12 4 4 8-8'/%3E%3C/svg%3E") center / 12px no-repeat; }

/* Tables */
.table-wrap { overflow-x: auto; border-radius: 13px; border: 1px solid var(--line); background: var(--paper); }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
thead th { background: #f4f1e8; color: var(--muted); font-size: 9.5px; text-transform: uppercase; letter-spacing: .1em; text-align: left; padding: 9px 12px; font-weight: 800; white-space: nowrap; border-bottom: 1px solid var(--line); }
tbody td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(246, 244, 236, .65); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.actions { text-align: right; white-space: nowrap; }
.row-title { font-weight: 650; color: var(--ink); text-decoration: none; }
.row-title:hover { color: var(--forest); text-decoration: underline; }
.row-sub { display: block; color: var(--faint); font-size: 10.5px; margin-top: 2px; }
.row-link { color: var(--forest); font-size: 11.5px; font-weight: 650; text-decoration: none; white-space: nowrap; }
.table-empty { padding: 28px 18px; text-align: center; color: var(--muted); }
.tfoot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 13px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; background: #faf8f1; }

/* Filters and doc cells */
.filter-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); margin-bottom: 15px; box-shadow: var(--shadow-soft); }
.filter-bar input[type="search"] { flex: 1 1 180px; min-width: 150px; }
.filter-bar select { flex: 0 1 165px; }
.filter-bar .button { flex: 0 0 auto; }
.doc-cell { display: flex; align-items: center; gap: 9px; min-width: 190px; }
.file-badge { width: 34px; height: 34px; flex: 0 0 auto; border-radius: 9px; display: grid; place-items: center; background: var(--forest-soft); color: var(--forest); font-size: 9px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
.file-badge.pdf { background: var(--coral-soft); color: #a8522f; }
.file-badge.img { background: var(--blue-soft); color: var(--blue); }
.file-badge.sheet { background: var(--forest-soft); color: var(--forest); }
.file-badge.email { background: #f0ebfa; color: #65508a; }
.file-badge.bank { background: #e4f0ec; color: #2f6b5a; }
.doc-name { font-size: 12px; font-weight: 650; max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-meta { font-size: 10px; color: var(--faint); margin-top: 2px; }
.filter-count { font-size: 11px; color: var(--muted); margin-left: auto; }
.stat-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.mini-stat { padding: 13px 15px; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); }
.mini-stat span { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; font-weight: 750; }
.mini-stat strong { display: block; margin-top: 5px; font-family: var(--serif); font-size: 23px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.mini-stat strong.danger { color: var(--danger); }
.mini-stat strong.good { color: var(--forest); }

/* Upload */
.upload-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(270px, .7fr); gap: 20px; align-items: start; }
.dropzone {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; min-height: 210px; padding: 28px; border: 1.5px dashed #bdc8b9; border-radius: 17px;
  background: linear-gradient(145deg, #fbfaf4, #f2f6ea); cursor: pointer; transition: border-color .15s ease, background .15s ease;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--forest); background: #f1f7e7; }
.dropzone input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.drop-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; background: var(--forest); color: var(--lime); margin-bottom: 12px; }
.drop-icon svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.dropzone strong { font-family: var(--serif); font-size: 23px; font-weight: 600; }
.dropzone p { color: var(--muted); font-size: 12.5px; margin: 5px 0 0; max-width: 44ch; }
.file-list { display: grid; gap: 5px; margin-top: 12px; font-size: 11.5px; color: var(--muted); }
.file-list span { padding: 5px 8px; background: #edf1e5; border-radius: 7px; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-note { display: flex; gap: 9px; align-items: flex-start; padding: 12px; border-radius: 12px; background: var(--blue-soft); color: var(--blue); font-size: 11.5px; margin-top: 14px; }
.upload-note strong { display: block; margin-bottom: 2px; }
.result-list { display: grid; gap: 8px; margin-top: 14px; }
.result-row { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); font-size: 12px; }
.result-row .result-main { min-width: 0; flex: 1; }
.result-row strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-row span { display: block; color: var(--muted); font-size: 10.5px; margin-top: 1px; }
.type-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 8px; }
.type-card { display: none; }
.radio-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 7px; }
.radio-card { position: relative; }
.radio-card input { position: absolute; opacity: 0; }
.radio-card span { display: flex; min-height: 34px; align-items: center; justify-content: center; padding: 6px 8px; border: 1px solid var(--line); border-radius: 9px; font-size: 11px; font-weight: 600; color: var(--muted); text-align: center; background: #fff; cursor: pointer; }
.radio-card input:checked + span { border-color: var(--forest); background: var(--forest-soft); color: var(--forest); }
.radio-card input:focus-visible + span { box-shadow: 0 0 0 3px rgba(22,74,56,.12); }

/* Document detail */
.detail-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.detail-top h1 { margin-bottom: 4px; font-size: clamp(28px, 3vw, 38px); overflow-wrap: anywhere; }
.back-link { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 650; text-decoration: none; color: var(--muted); margin-bottom: 10px; }
.back-link:hover { color: var(--forest); }
.doc-layout { display: grid; grid-template-columns: minmax(260px, .88fr) minmax(0, 1.12fr); gap: 20px; align-items: start; }
.preview-card { overflow: hidden; }
.preview-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 15px; border-bottom: 1px solid var(--line); background: #f8f5ec; }
.preview-head strong { font-size: 12px; }
.preview-body { min-height: 280px; background: #e9e6dd; display: flex; align-items: center; justify-content: center; }
.preview-body img { display: block; width: 100%; height: auto; max-height: 560px; object-fit: contain; }
.preview-body iframe { width: 100%; height: 540px; border: 0; background: #fff; }
.preview-missing { padding: 40px 20px; text-align: center; color: var(--muted); font-size: 12px; }
.raw-preview { margin: 0; width: 100%; max-height: 460px; overflow: auto; padding: 18px; background: #fbfaf4; font: 11.5px/1.6 "Cascadia Mono", Consolas, monospace; color: var(--ink-soft); white-space: pre-wrap; overflow-wrap: anywhere; }
.email-meta { padding: 14px 15px; background: #f7f4eb; border-bottom: 1px solid var(--line); font-size: 11.5px; color: var(--muted); }
.email-meta strong { color: var(--ink); display: block; margin-bottom: 3px; }
.review-box { padding: 14px 15px; border-radius: 13px; background: var(--amber-soft); border: 1px solid #ead7a9; color: #765018; font-size: 12px; }
.review-box strong { display: block; margin-bottom: 5px; }
.review-box ul { margin: 5px 0 0; padding-left: 17px; }
.review-box li { margin: 2px 0; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 28px 0 11px; }
.section-title h2 { margin: 0; font-size: 20px; }
details.text-details { margin-top: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); overflow: hidden; }
details.text-details summary { padding: 11px 14px; cursor: pointer; font-size: 12px; font-weight: 650; color: var(--muted); }
details.text-details pre { margin: 0; max-height: 450px; overflow: auto; padding: 15px; border-top: 1px solid var(--line); font: 11px/1.6 "Cascadia Mono", Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; background: #fbfaf4; }
.danger-zone { margin-top: 30px; padding-top: 17px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.danger-zone p { margin: 0; color: var(--muted); font-size: 11px; }
.subtle-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Invoices */
.invoice-hero { padding: clamp(20px, 3vw, 32px); display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; background: linear-gradient(140deg, #fdfbf5, #f3f6ea); }
.invoice-hero h2 { font-family: var(--serif); font-size: clamp(27px, 3vw, 36px); font-weight: 600; margin-bottom: 4px; }
.invoice-hero .remaining { text-align: right; }
.invoice-hero .remaining span { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; font-weight: 800; margin-bottom: 4px; }
.invoice-hero .remaining strong { font-family: var(--serif); font-size: clamp(29px, 3vw, 42px); font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.invoice-hero .remaining small { display: block; color: var(--muted); margin-top: 5px; font-size: 11px; }
.invoice-detail-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(290px, .8fr); gap: 20px; align-items: start; margin-top: 18px; }
.detail-list { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 0; font-size: 12.5px; }
.detail-list dt, .detail-list dd { margin: 0; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.detail-list dt { color: var(--muted); }
.detail-list dd { font-weight: 600; overflow-wrap: anywhere; }
.allocation-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.allocation-row:last-child { border-bottom: 0; }
.allocation-main { min-width: 0; }
.allocation-main strong { display: block; font-size: 12px; }
.allocation-main span { display: block; color: var(--muted); font-size: 10.5px; margin-top: 2px; }
.allocation-side { display: flex; gap: 9px; align-items: center; white-space: nowrap; font-variant-numeric: tabular-nums; font-size: 12px; font-weight: 700; }
.match-candidates { display: grid; gap: 7px; }
.match-candidate { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 11.5px; }
.match-candidate > div { min-width: 0; }
.match-candidate strong { display: block; font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match-candidate span { display: block; color: var(--muted); font-size: 10px; }
.compact-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.compact-form input[type="number"] { width: 90px; padding: 6px 8px; }
.compact-form select { min-width: 120px; padding: 7px 9px; }
.compact-form input[type="date"] { width: 136px; padding: 7px 9px; }

/* Reconcile */
.recon-banner { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 17px; padding: 15px 17px; border-radius: 14px; background: var(--forest); color: #edf7e9; }
.recon-banner p { margin: 0; font-size: 12.5px; color: rgba(237,247,233,.72); max-width: 68ch; }
.recon-banner strong { color: #fff; }
.recon-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr); gap: 20px; align-items: start; }
.match-card { padding: 15px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); margin-bottom: 10px; }
.match-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.match-party { font-size: 13px; font-weight: 700; }
.match-desc { color: var(--muted); font-size: 10.5px; margin-top: 2px; overflow-wrap: anywhere; }
.match-amount { font-family: var(--serif); font-size: 22px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.match-amount small { display: block; font-family: var(--sans); font-size: 9px; color: var(--faint); font-weight: 500; text-align: right; text-transform: uppercase; letter-spacing: .08em; }
.suggestion { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 9px; padding: 9px 10px; border: 1px solid #dce4d6; border-radius: 10px; background: #f7faef; }
.suggestion-main { min-width: 0; }
.suggestion-main strong { display: block; font-size: 11.5px; }
.suggestion-main span { display: block; color: var(--muted); font-size: 10px; margin-top: 1px; }
.suggestion-score { font-size: 9px; color: var(--forest); background: var(--forest-soft); padding: 3px 6px; border-radius: 99px; font-weight: 700; white-space: nowrap; }
.no-suggestion { margin-top: 9px; color: var(--muted); font-size: 11px; }
.invoice-mini { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.invoice-mini:last-child { border-bottom: 0; }
.invoice-mini-main { min-width: 0; }
.invoice-mini-main strong { display: block; font-size: 11.5px; }
.invoice-mini-main span { display: block; color: var(--muted); font-size: 10px; margin-top: 1px; }
.manual-match { margin-top: 18px; padding: 16px; border-radius: 14px; background: #f1f3e9; border: 1px solid #dfe4d4; }
.manual-match h3 { margin-bottom: 4px; }
.manual-match p { color: var(--muted); font-size: 11.5px; margin-bottom: 12px; }

/* Issues */
.issue-summary { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 17px; }
.issue-card { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 13px; align-items: start; padding: 15px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); margin-bottom: 9px; box-shadow: 0 3px 12px rgba(30,42,34,.025); }
.issue-dot { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 15px; font-weight: 800; background: var(--amber-soft); color: var(--amber); }
.issue-dot.danger { background: var(--danger-soft); color: var(--danger); }
.issue-dot.info { background: var(--blue-soft); color: var(--blue); }
.issue-main h3 { margin: 0 0 3px; font-size: 13.5px; }
.issue-main p { margin: 0; color: var(--muted); font-size: 11.5px; max-width: 75ch; }
.issue-links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 7px; font-size: 11px; }
.issue-links a { font-weight: 650; text-decoration: none; }
.issue-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.issue-side .text-button { color: var(--muted); font-size: 10.5px; text-decoration: underline; }
.issue-card.resolved { opacity: .67; }

/* Settings */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(300px, .75fr); gap: 20px; align-items: start; }
.settings-section + .settings-section { margin-top: 18px; }
.settings-section h2 { font-size: 20px; margin-bottom: 3px; }
.settings-section > p { color: var(--muted); font-size: 12px; margin-bottom: 16px; }
.connection-state { display: flex; align-items: center; gap: 9px; padding: 10px 12px; border-radius: 10px; background: #f3f5ec; border: 1px solid #dfe5d5; font-size: 11.5px; margin-bottom: 15px; }
.connection-state.connected { background: var(--forest-soft); border-color: #c9dfc8; color: var(--forest); }
.connection-state.error { background: var(--danger-soft); border-color: #efc9c3; color: var(--danger); }
.connection-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.provider-list { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0 2px; }
.provider-list span { font-size: 10px; padding: 4px 7px; border-radius: 6px; background: #eeede7; color: var(--muted); }
.help-box { margin-top: 15px; padding: 13px 14px; border-radius: 11px; background: #f6f3e8; border: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.help-box strong { color: var(--ink); display: block; margin-bottom: 4px; }
.help-box ol { margin: 5px 0; padding-left: 17px; }
.help-box li { margin: 3px 0; }
.security-note { display: flex; gap: 8px; align-items: flex-start; color: var(--muted); font-size: 10.5px; margin-top: 13px; }
.security-note svg { width: 14px; height: 14px; flex: 0 0 auto; margin-top: 1px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.demo-box { padding: 15px; border-radius: 13px; background: linear-gradient(145deg, #f7f6ed, #eef3e3); border: 1px solid #dfe4d3; }
.demo-box h3 { margin-bottom: 4px; }
.demo-box p { margin-bottom: 12px; color: var(--muted); font-size: 11.5px; }

/* Auth & static pages */
.public-body { background: #f5f2e9; }
.public-nav { max-width: 1220px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px clamp(18px, 4vw, 40px); }
.public-nav .brand { color: var(--ink); }
.public-nav nav { display: flex; align-items: center; gap: 17px; font-size: 13px; }
.public-nav nav a { text-decoration: none; color: var(--ink-soft); font-weight: 600; }
.public-main { max-width: 1220px; margin: 0 auto; padding: 10px clamp(18px, 4vw, 40px) 70px; }
.auth-wrap { min-height: 62vh; display: grid; place-items: center; padding: 40px 0; }
.auth-card { width: min(440px, 100%); padding: clamp(24px, 3.5vw, 36px); }
.auth-card h1 { font-size: 36px; margin-bottom: 7px; }
.auth-card > p { color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.auth-card .button { margin-top: 18px; }
.auth-links { display: flex; flex-direction: column; gap: 6px; margin-top: 17px; font-size: 12px; color: var(--muted); }
.public-footer { max-width: 1220px; margin: 0 auto; padding: 30px clamp(18px, 4vw, 40px) 40px; border-top: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; color: var(--muted); font-size: 12px; }
.public-footer strong { color: var(--ink); font-family: var(--serif); font-size: 18px; }
.public-footer p { margin: 4px 0 0; }
.footer-links { display: flex; gap: 16px; align-items: flex-start; }
.footer-links a { color: var(--ink-soft); text-decoration: none; font-weight: 600; }
.fine-print { grid-column: 1 / -1; padding-top: 16px; border-top: 1px solid var(--line); color: var(--faint); font-size: 10.5px; }
.message-card { width: min(560px, 100%); margin: 10vh auto; padding: clamp(24px, 4vw, 38px); }
.message-card h1 { font-size: 38px; }
.message-card p { color: var(--muted); }

/* Public home */
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr); gap: clamp(30px, 5vw, 70px); align-items: center; padding: clamp(35px, 6vw, 78px) 0 55px; }
.hero-copy h1 { font-size: clamp(45px, 6vw, 75px); line-height: .99; letter-spacing: -.045em; max-width: 11ch; margin-bottom: 21px; }
.hero-copy .lead { color: var(--muted); font-size: clamp(16px, 1.7vw, 19px); max-width: 50ch; line-height: 1.55; margin-bottom: 28px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.hero-actions .button { min-height: 47px; padding: 12px 20px; font-size: 14px; }
.hero-note { margin-top: 18px; display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11.5px; }
.hero-note svg { width: 15px; height: 15px; fill: none; stroke: var(--forest); stroke-width: 1.8; }
.hero-visual { position: relative; }
.hero-visual::before { content: ""; position: absolute; inset: -20px -20px auto auto; width: 140px; height: 140px; border-radius: 50%; background: var(--lime); opacity: .55; z-index: 0; }
.hero-visual::after { content: ""; position: absolute; inset: auto auto -18px -20px; width: 95px; height: 95px; border: 1px solid #cfd8c4; border-radius: 50%; z-index: 0; }
.mock-app { position: relative; z-index: 1; border-radius: 24px; background: #fffdf8; border: 1px solid #ded9cd; box-shadow: 0 30px 70px rgba(34,50,40,.13); overflow: hidden; transform: rotate(1deg); }
.mock-top { display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; background: #f2efe5; border-bottom: 1px solid #e2ded2; }
.mock-brand { display: flex; align-items: center; gap: 7px; font-weight: 700; font-size: 11px; }
.mock-logo { width: 20px; height: 20px; border-radius: 6px; background: var(--forest); color: var(--lime); display: grid; place-items: center; font-size: 10px; }
.mock-dots { display: flex; gap: 3px; }
.mock-dots i { width: 5px; height: 5px; border-radius: 50%; background: #cfcabb; }
.mock-body { padding: 17px; }
.mock-hero { border-radius: 15px; padding: 17px; background: linear-gradient(145deg, var(--forest), var(--forest-deep)); color: #fff; margin-bottom: 11px; }
.mock-hero span { display: block; font-size: 8px; text-transform: uppercase; letter-spacing: .13em; color: rgba(255,255,255,.5); font-weight: 700; }
.mock-hero strong { display: block; font-family: var(--serif); font-size: 31px; letter-spacing: -.03em; margin: 5px 0 3px; font-weight: 600; }
.mock-hero small { font-size: 8.5px; color: rgba(255,255,255,.5); }
.mock-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 11px; }
.mock-card { border: 1px solid #e7e2d5; background: #faf8f1; border-radius: 11px; padding: 11px; }
.mock-card span { display: block; font-size: 7.5px; color: #8e978f; text-transform: uppercase; letter-spacing: .09em; font-weight: 700; }
.mock-card strong { display: block; margin-top: 5px; font-family: var(--serif); font-size: 19px; letter-spacing: -.02em; }
.mock-alert { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 9px; background: #fbf1df; margin-top: 6px; }
.mock-alert .dot { width: 18px; height: 18px; border-radius: 6px; background: #edcf99; color: #78501a; display: grid; place-items: center; font-size: 9px; font-weight: 800; }
.mock-alert div { flex: 1; }
.mock-alert strong { display: block; font-size: 8.5px; }
.mock-alert span { display: block; color: #8c774d; font-size: 7.5px; margin-top: 1px; }
.mock-check { width: 15px; height: 15px; border-radius: 50%; background: var(--forest); color: #fff; display: grid; place-items: center; font-size: 8px; }
.floating-chip { position: absolute; z-index: 2; right: -10px; bottom: 42px; padding: 9px 12px; background: #fff; border: 1px solid #ded9cd; border-radius: 12px; box-shadow: 0 12px 30px rgba(30,42,34,.12); display: flex; align-items: center; gap: 7px; font-size: 10px; font-weight: 650; transform: rotate(-2deg); }
.floating-chip .chip-check { width: 20px; height: 20px; border-radius: 50%; background: var(--forest-soft); color: var(--forest); display: grid; place-items: center; font-size: 10px; }
.section-block { padding: 70px 0 15px; }
.section-head { max-width: 650px; margin-bottom: 30px; }
.section-head h2 { font-family: var(--serif); font-size: clamp(32px, 4vw, 46px); font-weight: 600; line-height: 1.05; margin-bottom: 10px; }
.section-head p { color: var(--muted); font-size: 15px; max-width: 58ch; }
.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.feature-card { padding: 22px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,253,248,.75); }
.feature-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--forest-soft); color: var(--forest); margin-bottom: 14px; }
.feature-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.feature-card h3 { margin-bottom: 6px; font-size: 15px; }
.feature-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.messy-section { display: grid; grid-template-columns: .8fr 1.2fr; gap: 50px; align-items: start; padding: 75px 0 20px; }
.messy-list { display: grid; gap: 3px; }
.messy-item { display: grid; grid-template-columns: 40px 1fr; gap: 13px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.messy-item:last-child { border-bottom: 0; }
.messy-num { font-family: var(--serif); font-size: 21px; color: var(--faint); }
.messy-item h3 { margin-bottom: 2px; font-size: 14px; }
.messy-item p { margin: 0; color: var(--muted); font-size: 12px; }
.cta-band { margin: 80px 0 30px; padding: clamp(28px, 5vw, 55px); border-radius: 25px; background:
  radial-gradient(circle at 90% 15%, rgba(217,236,184,.18), transparent 30%),
  linear-gradient(145deg, var(--forest), var(--forest-deep)); color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 30px; }
.cta-band h2 { font-family: var(--serif); font-size: clamp(30px, 4vw, 45px); font-weight: 600; margin-bottom: 8px; line-height: 1.05; }
.cta-band p { color: rgba(237,247,233,.65); font-size: 13px; margin: 0; max-width: 55ch; }
.cta-band .button { background: var(--lime); border-color: var(--lime); color: var(--forest-deep); white-space: nowrap; }
.cta-band .button:hover { background: #e7f7cf; }
.trust-row { display: flex; gap: 26px; flex-wrap: wrap; padding: 18px 0 0; color: var(--muted); font-size: 11px; }
.trust-row span { display: inline-flex; align-items: center; gap: 6px; }
.trust-row svg { width: 14px; height: 14px; fill: none; stroke: var(--forest); stroke-width: 1.7; }

/* Loading */
.loading-screen { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: rgba(16, 36, 27, .55); backdrop-filter: blur(5px); }
.loader-card { width: min(360px, calc(100% - 32px)); padding: 28px; border-radius: 20px; background: var(--paper); text-align: center; box-shadow: 0 30px 80px rgba(0,0,0,.2); }
.loader-card strong { display: block; font-family: var(--serif); font-size: 23px; margin: 15px 0 4px; }
.loader-card p { color: var(--muted); font-size: 11.5px; margin: 0; }
.spinner { display: inline-block; width: 31px; height: 31px; border-radius: 50%; border: 3px solid #dce3d3; border-top-color: var(--forest); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Responsive */
@media (max-width: 1170px) {
  .stat-grid { grid-template-columns: 1.35fr 1fr 1fr; }
  .stat-card:nth-child(4) { grid-column: span 3; min-height: 105px; }
  .stat-card:nth-child(4) .stat-value { margin-top: 12px; }
}
@media (max-width: 1050px) {
  .dash-grid, .recon-grid, .settings-grid { grid-template-columns: 1fr; }
  .two-col, .invoice-detail-grid { grid-template-columns: 1fr; }
  .doc-layout { grid-template-columns: minmax(230px, .85fr) minmax(0, 1.15fr); }
  .hero { grid-template-columns: 1fr; gap: 38px; }
  .hero-copy h1 { max-width: 13ch; }
  .hero-visual { max-width: 530px; }
  .messy-section { grid-template-columns: 1fr; gap: 25px; }
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 880px) {
  .shell { display: block; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 270px; transform: translateX(-100%); transition: transform .22s ease; box-shadow: 20px 0 60px rgba(0,0,0,.25); }
  .sidebar.open { transform: translateX(0); }
  .menu-button { display: inline-grid; }
  .topbar { min-height: 66px; }
  .topbar-kicker { display: none; }
  .topbar-title strong { font-size: 19px; }
  .topbar-actions .ghost { display: none; }
  .content { padding-top: 22px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-card:first-child { grid-column: span 2; }
  .stat-card:nth-child(4) { grid-column: span 2; min-height: 115px; }
  .stat-card:nth-child(4) .stat-value { margin: 10px 0 4px; }
  .stat-card.primary .stat-value { font-size: 44px; }
  .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .doc-layout, .upload-grid { grid-template-columns: 1fr; }
  .preview-body iframe { height: 420px; }
  .public-footer { grid-template-columns: 1fr; }
  .footer-links { justify-content: flex-start; }
  .cta-band { flex-direction: column; align-items: flex-start; }
  .public-nav { padding-top: 18px; padding-bottom: 18px; }
}
@media (max-width: 680px) {
  body { font-size: 14px; }
  .content { padding-left: 13px; padding-right: 13px; }
  .topbar { padding-left: 13px; padding-right: 13px; }
  .topbar-actions .button { min-height: 33px; padding: 7px 9px; font-size: 11px; }
  .topbar-title strong { font-size: 17px; }
  .dashboard-intro { flex-direction: column; align-items: flex-start; gap: 12px; }
  .range-tabs { width: 100%; overflow-x: auto; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .stat-card { padding: 15px; min-height: 132px; border-radius: 15px; }
  .stat-card.primary { grid-column: span 2; }
  .stat-card:nth-child(4) { grid-column: span 2; min-height: 100px; }
  .stat-value { font-size: 26px; }
  .stat-card.primary .stat-value { font-size: 40px; }
  .field-grid, .field-grid.three { grid-template-columns: 1fr; }
  .field-grid .span-2 { grid-column: auto; }
  .equal-col { grid-template-columns: 1fr; }
  .page-head { flex-direction: column; align-items: flex-start; gap: 10px; margin-bottom: 17px; }
  .page-head h1 { font-size: 34px; }
  .page-actions { width: 100%; }
  .filter-bar { align-items: stretch; }
  .filter-bar input[type="search"] { flex-basis: 100%; }
  .filter-bar select { flex: 1 1 130px; min-width: 0; }
  .filter-count { margin-left: 0; width: 100%; }
  .stat-strip { gap: 7px; }
  .mini-stat { padding: 11px; }
  .mini-stat strong { font-size: 20px; }
  .invoice-hero { flex-direction: column; }
  .invoice-hero .remaining { text-align: left; }
  .detail-list { grid-template-columns: 96px minmax(0, 1fr); }
  .issue-card { grid-template-columns: 30px minmax(0, 1fr); }
  .issue-dot { width: 29px; height: 29px; }
  .issue-side { grid-column: 2; flex-direction: row; align-items: center; justify-content: flex-start; }
  .chart { height: 175px; }
  .hero-copy h1 { font-size: 49px; }
  .hero-visual { margin: 0 7px; }
  .floating-chip { right: -3px; bottom: 18px; }
  .feature-grid { grid-template-columns: 1fr; }
  .section-block { padding-top: 50px; }
  .cta-band { margin-top: 55px; }
  .public-footer { padding-bottom: 25px; }
  .public-nav nav { gap: 10px; }
  .public-nav .brand small { display: none; }
  .public-nav .button { padding: 7px 10px; font-size: 11px; min-height: 32px; }
  .public-nav { padding-left: 15px; padding-right: 15px; }
  .public-main { padding-left: 15px; padding-right: 15px; }
  .dropzone { min-height: 180px; padding: 21px 15px; }
  .radio-grid { grid-template-columns: 1fr 1fr; }
  .match-top { flex-direction: column; gap: 8px; }
  .match-amount { font-size: 20px; }
  .match-amount small { text-align: left; }
  .suggestion { flex-direction: column; align-items: flex-start; }
  .suggestion form { width: 100%; }
  .suggestion form .button { width: 100%; }
  .compact-form input, .compact-form select, .compact-form input[type="date"] { width: 100%; }
  .danger-zone { flex-direction: column; align-items: flex-start; }
  .table-wrap { border-radius: 10px; }
  thead th, tbody td { padding: 8px 9px; }
}
