:root {
  --bg: #f4f7f5;
  --ink: #10231c;
  --ink-soft: #2a4338;
  --muted: #5d7469;
  --muted-2: #8aa396;
  --green: #1f8a4c;
  --green-deep: #166b3a;
  --green-soft: #e5f4eb;
  --teal: #1c7c74;
  --teal-2: #2a9d8f;
  --teal-soft: #e4f3f1;
  --card: #ffffff;
  --line: #d7e3db;
  --line-strong: #b9cdc2;
  --danger: #c44b32;
  --danger-soft: #fbecea;
  --warn: #b8862a;
  --warn-soft: #f8efd9;
  --info: #2b6b8a;
  --shadow: 0 1px 2px rgba(16, 35, 28, 0.05), 0 10px 28px rgba(16, 35, 28, 0.05);
  --shadow-lg: 0 16px 48px rgba(16, 35, 28, 0.14);
  --radius: 14px;
  --radius-sm: 8px;
  --font-ui: "Outfit", system-ui, sans-serif;
  --font-display: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sidebar: 232px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 14.5px;
  line-height: 1.45;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, select, textarea { font: inherit; color: inherit; }

button { cursor: pointer; }

a { color: var(--green); }

#app { min-height: 100%; }

.boot {
  min-height: 100vh;
  display: grid;
  place-content: center;
  gap: 12px;
  text-align: center;
  color: var(--muted);
}
.boot-mark {
  width: 36px;
  height: 36px;
  margin: 0 auto;
  border-radius: 10px;
  background: var(--ink);
  position: relative;
}
.boot-mark::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: 12px;
  height: 2px;
  background: var(--green);
  box-shadow: 0 6px 0 var(--green), 0 12px 0 #4aa36a;
}

.shell {
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
  min-height: 100vh;
}

/* ——— Sidebar ——— */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 14px 16px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, #f7faf8 0%, var(--bg) 100%);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 18px;
  text-decoration: none;
  color: inherit;
}
.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--ink);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.brand-mark svg { display: block; }
.brand-name {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.02em;
}
.brand-tag {
  font-size: 11px;
  color: var(--muted);
  margin-top: 1px;
}

.company-chip {
  margin: 0 8px 14px;
  padding: 10px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.company-chip strong {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
}
.company-chip span {
  font-size: 11px;
  color: var(--muted);
}

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
  padding: 12px 12px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  border-radius: 9px;
  color: var(--ink-soft);
  text-align: left;
  width: 100%;
  transition: background 140ms var(--ease), color 140ms var(--ease);
}
.nav-item svg { flex-shrink: 0; opacity: 0.75; }
.nav-item:hover { background: rgba(16, 35, 28, 0.05); color: var(--ink); }
.nav-item.is-active {
  background: var(--ink);
  color: #f4f7f5;
}
.nav-item.is-active svg { opacity: 1; }
.nav-item span { flex: 1; }
.nav-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--green-soft);
  color: var(--green-deep);
  font-size: 10.5px;
  font-weight: 600;
  display: grid;
  place-items: center;
  font-variant-numeric: tabular-nums;
}
.nav-item.is-active .nav-badge {
  background: var(--green);
  color: white;
}

.nav-foot {
  margin-top: auto;
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.period-pill {
  margin: 0 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px dashed var(--line-strong);
  font-size: 12px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.period-pill b { color: var(--ink); font-weight: 600; }
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--warn);
  box-shadow: 0 0 0 3px var(--warn-soft);
}
.dot.ok {
  background: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
}

/* ——— Stage ——— */
.stage {
  padding: 28px 36px 80px;
  max-width: 1240px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.kicker {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 4px;
}
h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 32px;
  letter-spacing: -0.03em;
  margin: 0;
  line-height: 1.15;
}
.sub {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13.5px;
}

.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.btn {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 10px;
  padding: 8px 14px;
  font-weight: 500;
  font-size: 13.5px;
  transition: transform 120ms var(--ease), background 120ms var(--ease), border-color 120ms var(--ease);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn:hover { border-color: var(--line-strong); background: #fbfdfc; }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.btn-primary:hover { background: var(--green-deep); border-color: var(--green-deep); }
.btn-ink {
  background: var(--ink);
  border-color: var(--ink);
  color: #f4f7f5;
}
.btn-ink:hover { background: #1c382c; }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--danger); border-color: #ead4cf; background: var(--danger-soft); }
.btn-sm { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-run {
  width: 100%;
  justify-content: center;
  padding: 12px 16px;
  font-size: 15px;
  border-radius: 12px;
}

button:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

/* ——— Cards / grids ——— */
.grid-3 {
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.85fr;
  gap: 16px;
}
.grid-2 {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 16px;
  margin-top: 16px;
}
.grid-2.even { grid-template-columns: 1fr 1fr; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px 16px;
}
.card-h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.card-title {
  font-weight: 600;
  font-size: 13.5px;
  margin: 0;
}
.card-more {
  font-size: 12px;
  color: var(--muted);
  background: none;
  border: 0;
  padding: 0;
  font-weight: 500;
}
.card-more:hover { color: var(--green); }

/* ——— Hero ——— */
.hero {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 16px;
}
.hero-cash { padding: 22px 32px 18px; }
.cash-kicker {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 6px;
}
.cash-figure {
  font-family: var(--font-display);
  font-size: 56px;
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  margin: 0;
}
.cash-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}
.cash-meta b { color: var(--ink); font-weight: 600; }
.delta-up { color: var(--green); font-weight: 600; }
.delta-down { color: var(--danger); font-weight: 600; }

.spark { margin-top: 18px; }
.spark svg { display: block; width: 100%; height: 56px; }

.close-cta {
  background: linear-gradient(180deg, #1a3a2c 0%, #10231c 100%);
  color: #e7f3ec;
  padding: 26px 24px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
}
.close-cta h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 28px;
  letter-spacing: -0.03em;
  margin: 0 0 8px;
  color: #fff;
  line-height: 1.15;
}
.close-cta p { margin: 0; color: #b7cfc3; font-size: 13px; }
.close-cta .steps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}
.close-cta .steps i {
  font-style: normal;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 99px;
  background: rgba(255,255,255,0.08);
  color: #d5eadc;
}

/* ——— Money / tables ——— */
.money, .td-num, .cash-figure, .stmt-row b, .aging-col strong, .receipt-amt {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
}
.td-num, .money.r, .stmt-row span:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.02em;
}
.td-num { font-size: 16px; }
.txn-row .amt, .ap-row .amt {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.table-wrap { overflow: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
table.data th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.data th.num, table.data td.td-num { text-align: right; }
table.data td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr { cursor: pointer; transition: background 120ms var(--ease); }
table.data tbody tr:hover { background: #f7fbf8; }
table.data .muted { color: var(--muted); font-size: 12.5px; }
table.data .entity { font-weight: 550; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: #eef3f0;
  color: var(--muted);
}
.pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.pill-draft { background: #eef3f0; color: var(--muted); }
.pill-sent { background: var(--teal-soft); color: var(--teal); }
.pill-paid { background: var(--green-soft); color: var(--green-deep); }
.pill-overdue { background: var(--danger-soft); color: var(--danger); }
.pill-open { background: var(--warn-soft); color: var(--warn); }
.pill-matched { background: var(--green-soft); color: var(--green-deep); }
.pill-suggested { background: #e8f0fb; color: var(--info); }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.chip {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 99px;
  padding: 5px 12px;
  font-size: 12.5px;
  color: var(--ink-soft);
}
.chip:hover { border-color: var(--line-strong); }
.chip.is-on {
  background: var(--ink);
  color: #f4f7f5;
  border-color: var(--ink);
}
.search {
  margin-left: auto;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 99px;
  padding: 6px 12px 6px 32px;
  min-width: 220px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238aa396' stroke-width='1.6'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='M11 11l3 3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 10px 50%;
}

/* ——— Aging / P&L mini ——— */
.aging-bar {
  display: flex;
  height: 10px;
  border-radius: 99px;
  overflow: hidden;
  background: #e7eee9;
  margin-bottom: 16px;
}
.aging-seg { height: 100%; }
.aging-seg.c0 { background: var(--green); }
.aging-seg.c1 { background: var(--teal-2); }
.aging-seg.c2 { background: var(--warn); }
.aging-seg.c3 { background: var(--danger); }

.aging-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
}
.aging-col small {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
  margin-bottom: 2px;
}
.aging-col strong {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.pl-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}
.pl-stats div small { color: var(--muted); font-size: 11px; display: block; }
.pl-stats div b {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.pl-stats .net b { color: var(--green); }
.pl-stats .net.neg b { color: var(--danger); }

.chart { width: 100%; height: 168px; display: block; }
.legend {
  display: flex;
  gap: 14px;
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 8px;
}
.legend i {
  font-style: normal;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.legend i::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--sw, var(--green));
}

/* ——— Close ring ——— */
.ring-wrap {
  display: grid;
  justify-items: center;
  text-align: center;
  padding: 8px 0 4px;
}
.ring-wrap svg { width: 132px; height: 132px; }
.ring-caption { margin-top: 4px; color: var(--muted); font-size: 12.5px; }
.ring-caption b { color: var(--ink); }

/* ——— Lists ——— */
.txn-row, .ap-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  align-items: center;
}
.txn-row:last-child, .ap-row:last-child { border-bottom: 0; }
.txn-row .who, .ap-row .who { font-weight: 550; }
.txn-row .when, .ap-row .when { color: var(--muted); font-size: 12px; }
.txn-row .amt.in { color: var(--green-deep); }
.txn-row .amt.out { color: var(--ink); }
.txn-row .amt, .ap-row .amt {
  font-variant-numeric: tabular-nums;
  font-weight: 550;
  text-align: right;
}

/* ——— Receipts ——— */
.toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.receipt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.receipt {
  background: #fffef9;
  border: 1px solid #e3ddd0;
  border-radius: 6px 6px 10px 10px;
  padding: 0;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 180ms var(--ease), box-shadow 180ms var(--ease);
}
.receipt:hover { transform: translateY(-1px); }
.receipt.is-flash {
  animation: flashGreen 0.7s var(--ease);
}
@keyframes flashGreen {
  0% { box-shadow: 0 0 0 0 rgba(31, 138, 76, 0.45); }
  100% { box-shadow: 0 0 0 12px rgba(31, 138, 76, 0); }
}
.receipt-top {
  padding: 14px 14px 10px;
  background:
    repeating-linear-gradient(
      -12deg,
      transparent,
      transparent 8px,
      rgba(16, 35, 28, 0.015) 8px,
      rgba(16, 35, 28, 0.015) 9px
    );
}
.receipt-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.mono {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--ink);
  color: #e7f3ec;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: -0.03em;
}
.receipt-amt {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.03em;
  text-align: right;
}
.receipt-vendor { font-weight: 600; margin-top: 12px; }
.receipt-desc { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.receipt-meta {
  display: flex;
  justify-content: space-between;
  color: var(--muted-2);
  font-size: 11.5px;
  margin-top: 10px;
  font-variant-numeric: tabular-nums;
}
.receipt-dash {
  height: 1px;
  margin: 0 12px;
  background-image: linear-gradient(to right, #cfc6b6 60%, transparent 0%);
  background-size: 8px 1px;
  background-repeat: repeat-x;
}
.receipt-foot {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #fff;
}
.receipt select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  background: #fff;
}
.conf {
  font-size: 11.5px;
  color: var(--green-deep);
  font-weight: 600;
}
.conf.mid { color: var(--warn); }
.conf.low { color: var(--danger); }

.receipt-perforation {
  height: 10px;
  background:
    radial-gradient(circle at 8px 0, var(--bg) 6px, transparent 6.5px) 0 0 / 16px 10px;
  background-color: #fff;
}

/* ——— Banking ——— */
.bank-list { display: flex; flex-direction: column; gap: 8px; }
.bank-row {
  display: grid;
  grid-template-columns: 150px 1fr 140px 280px;
  gap: 12px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}
.bank-row.is-accepted { opacity: 0.72; }
.bank-date { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.bank-desc { font-weight: 550; }
.bank-desc small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.bank-amt {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  text-align: right;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.bank-amt.in { color: var(--green-deep); }
.match-box {
  background: #f7fbf8;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  padding: 8px 10px;
  min-height: 58px;
}
.match-box.ok {
  border-style: solid;
  background: var(--green-soft);
  border-color: #b7deC6;
}
.match-box h4 { margin: 0 0 2px; font-size: 12.5px; font-weight: 600; }
.match-box p { margin: 0; font-size: 11.5px; color: var(--muted); }
.match-actions { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }

.queue-note {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 12px;
}

/* ——— COA ——— */
.coa-group { margin-bottom: 8px; }
.coa-group h3 {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 16px 0 6px;
}
.coa-row {
  display: grid;
  grid-template-columns: 64px 1fr 140px;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  align-items: center;
}
.coa-row code {
  font-family: var(--font-ui);
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.coa-row .bal {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 550;
  font-family: var(--font-display);
  font-size: 17px;
}
.coa-total {
  display: flex;
  justify-content: space-between;
  padding: 12px;
  font-weight: 600;
}

/* ——— Reports ——— */
.report-switch { display: flex; gap: 6px; }
.statement {
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 36px 48px 48px;
  box-shadow: var(--shadow);
  max-width: 720px;
}
.statement header { margin-bottom: 28px; }
.statement .co { font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; font-size: 12px; }
.statement h2 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 500;
  margin: 6px 0 4px;
  letter-spacing: -0.03em;
}
.statement .asof { color: var(--muted); font-size: 13px; }

.stmt-row {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 5px 0;
  font-size: 14px;
}
.stmt-row.indent { padding-left: 18px; color: var(--ink-soft); }
.stmt-row.section {
  margin-top: 16px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 11.5px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
}
.stmt-row.total {
  border-top: 1px solid var(--ink);
  margin-top: 4px;
  padding-top: 8px;
  font-weight: 600;
}
.stmt-row.net {
  border-top: 3px double var(--ink);
  margin-top: 8px;
  padding-top: 10px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
}
.stmt-row span:last-child {
  min-width: 120px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.stmt-row.net span:last-child { font-variant-numeric: tabular-nums; }

/* ——— Close ——— */
.check-list { display: flex; flex-direction: column; gap: 10px; }
.check-item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.check-item .mark {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  display: grid;
  place-items: center;
}
.check-item.is-done .mark {
  background: var(--green);
  border-color: var(--green);
  color: white;
}
.check-item h3 { margin: 0; font-size: 14px; }
.check-item p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }

.lock-seal {
  margin-top: 20px;
  padding: 32px;
  border-radius: 18px;
  background: linear-gradient(180deg, #1a3a2c, #10231c);
  color: #e7f3ec;
  text-align: center;
}
.lock-seal h2 {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 500;
  color: white;
  margin: 8px 0 6px;
  letter-spacing: -0.03em;
}
.lock-seal p { margin: 0; color: #b7cfc3; }

/* ——— Drawer / modal ——— */
.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(16, 35, 28, 0.38);
  z-index: 40;
  display: flex;
  justify-content: flex-end;
  animation: fade 160ms var(--ease);
}
.backdrop.center { justify-content: center; align-items: center; padding: 24px; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.drawer {
  width: min(960px, 100%);
  height: 100%;
  background: var(--bg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  animation: slide 240ms var(--ease);
}
@keyframes slide { from { transform: translateX(24px); opacity: 0.6; } to { transform: none; opacity: 1; } }

.drawer-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--card);
}
.drawer-h h2 { font-size: 16px; margin: 0; font-weight: 600; }
.drawer-body {
  overflow: auto;
  padding: 20px;
  flex: 1;
}
.drawer-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

.modal {
  width: min(520px, 100%);
  background: var(--card);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow-lg);
  animation: pop 200ms var(--ease);
}
@keyframes pop { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal h2 { margin: 0 0 8px; font-family: var(--font-display); font-weight: 500; font-size: 26px; }
.modal p { color: var(--muted); margin: 0 0 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }

.close-x {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: white;
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.form-grid .full { grid-column: 1 / -1; }
label.fld { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 500; }
label.fld input, label.fld select, label.fld textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: white;
  color: var(--ink);
}
.lines { width: 100%; }
.lines input { width: 100%; }
.line-row {
  display: grid;
  grid-template-columns: 1fr 70px 100px 28px;
  gap: 6px;
  margin-bottom: 6px;
}

.preview {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px 28px 32px;
  min-height: 480px;
  box-shadow: var(--shadow);
}
.preview .co-name {
  font-family: var(--font-display);
  font-size: 22px;
  margin: 0;
  letter-spacing: -0.03em;
}
.preview .inv-label {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.preview-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}
.preview table { width: 100%; border-collapse: collapse; margin-top: 18px; }
.preview th {
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--ink);
  padding: 6px 0;
}
.preview td { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.preview td.num { text-align: right; font-variant-numeric: tabular-nums; }
.preview .totals { margin-top: 12px; margin-left: auto; width: 220px; }
.preview .totals div {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-variant-numeric: tabular-nums;
}
.preview .totals .grand {
  border-top: 3px double var(--ink);
  margin-top: 6px;
  padding-top: 8px;
  font-family: var(--font-display);
  font-size: 20px;
}

/* ——— Close run modal ——— */
.progress-modal { width: min(460px, 100%); }
.step-row {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  padding: 10px 0;
  align-items: start;
}
.step-ico {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  display: grid;
  place-items: center;
  font-size: 12px;
}
.step-row.run .step-ico {
  border-color: var(--green);
  box-shadow: 0 0 0 4px var(--green-soft);
}
.step-row.done .step-ico { background: var(--green); border-color: var(--green); color: white; }
.step-row h3 { margin: 0; font-size: 14px; }
.step-row p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }

/* ——— Toast ——— */
.toast-root {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--ink);
  color: #e7f3ec;
  padding: 12px 16px;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: pop 180ms var(--ease);
  min-width: 240px;
}
.toast::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #5dce86;
  flex-shrink: 0;
}

.lock-banner {
  background: var(--green-soft);
  border: 1px solid #b7dec6;
  color: var(--green-deep);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 13.5px;
  font-weight: 500;
}

.empty {
  text-align: center;
  padding: 40px 16px;
  color: var(--muted);
}

.icon-btn {
  border: 0;
  background: transparent;
  padding: 4px;
  color: var(--muted);
  border-radius: 6px;
}
.icon-btn:hover { background: #eef3f0; color: var(--ink); }

.menu-btn {
  display: none;
  border: 1px solid var(--line);
  background: white;
  border-radius: 8px;
  padding: 6px 10px;
}

@media (max-width: 1100px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-3 .span-last { grid-column: 1 / -1; }
  .hero { grid-template-columns: 1fr; }
  .bank-row { grid-template-columns: 1fr 1fr; }
  .bank-amt { text-align: left; }
  .drawer-split { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    z-index: 30;
    transform: translateX(-110%);
    transition: transform 220ms var(--ease);
    box-shadow: var(--shadow-lg);
    background: var(--bg);
  }
  .sidebar.open { transform: none; }
  .stage { padding: 18px 16px 64px; }
  .menu-btn { display: inline-flex; }
  .cash-figure { font-size: 42px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .filters .search { margin-left: 0; width: 100%; }
  .statement { padding: 24px 20px; }
  h1 { font-size: 26px; }
}

@media print {
  body { background: white; }
  .sidebar, .topbar .actions, .filters, .btn, .toast-root, .menu-btn, .nav-foot, .close-cta {
    display: none !important;
  }
  .shell { display: block; }
  .stage { padding: 0; max-width: none; }
  .statement { box-shadow: none; border: 0; padding: 0; max-width: none; }
  .report-switch { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
