@font-face {
  font-family: "Literata";
  src: url("fonts/literata-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Literata";
  src: url("fonts/literata-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("fonts/sans-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("fonts/sans-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #1c2421;
  --muted: #5c675f;
  --forest: #14352c;
  --forest-deep: #0c241e;
  --copper: #8d4318;
  --copper-bright: #b8612d;
  --gold: #e0b15a;
  --paper: #f3efe6;
  --card: #fffdf8;
  --line: #e4d9c8;
  --good: #0c5c3b;
  --good-bg: #e7f5ee;
  --warn: #6d4a0b;
  --warn-bg: #fff3d6;
  --bad: #8a2424;
  --bad-bg: #fdecea;
  --shadow: 0 18px 40px rgba(20, 36, 32, 0.08);
  --sans: "Source Sans 3", "Segoe UI", sans-serif;
  --serif: "Literata", "Iowan Old Style", Palatino, Georgia, serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(1200px 400px at 10% -10%, rgba(224, 177, 90, 0.18), transparent 50%),
    var(--paper);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
}
a { color: var(--copper); }
a:hover { color: var(--forest); }
img { max-width: 100%; }

.skip {
  position: absolute;
  left: -999px;
  top: 0;
}
.skip:focus { left: 12px; top: 12px; background: white; padding: 8px 12px; z-index: 5; }

.site-header {
  background: var(--forest);
  color: #f7f3ea;
}
.header-inner, .wrap, .site-footer .wrap {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}
.header-inner {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding: 16px 0 14px;
}
.brand { display: flex; gap: 12px; align-items: center; color: inherit; text-decoration: none; }
.brand strong { font-family: var(--serif); font-size: 1.45rem; letter-spacing: -0.03em; display: block; }
.brand small { display: block; color: #d9c7a2; font-size: 0.78rem; letter-spacing: 0.04em; }
.mark { width: 36px; height: 36px; }
nav { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
nav a, .linkish {
  color: #f7f3ea;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}
nav a:hover, .linkish:hover { color: var(--gold); }
.linkish {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}
.demo-banner {
  background: #f3d48a;
  color: #3f2a05;
  text-align: center;
  padding: 8px 16px;
  font-weight: 600;
}

main { padding: 28px 0 64px; }
.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 40px;
  color: var(--muted);
  font-size: 0.95rem;
}
.site-footer strong { color: var(--ink); }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.03em; line-height: 1.15; }
h1 { font-size: clamp(2rem, 4vw, 3.1rem); margin: 0 0 12px; }
h2 { font-size: 1.55rem; margin: 0 0 8px; }
h3 { font-size: 1.15rem; margin: 0 0 8px; }
.lede { font-size: 1.15rem; max-width: 42rem; margin-top: 0; }

.route {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 18px 0 8px;
  font-weight: 600;
}
.route span {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
}
.route .here { background: var(--forest); color: white; border-color: var(--forest); }
.route i { color: var(--copper-bright); font-style: normal; }

.grid-2 { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 22px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 16px 0; }
.stat, .card, .ledger, .panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.stat { padding: 16px 16px 14px; }
.stat .k { color: var(--muted); font-size: 0.86rem; font-weight: 600; }
.stat .v {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  font-variant-numeric: tabular-nums;
  margin-top: 4px;
}
.stat.main { background: var(--forest); color: white; }
.stat.main .k { color: #e7d7b0; }
.card, .panel { padding: 18px 18px 8px; }
.panel { padding: 18px; margin: 16px 0; }

.ledger { padding: 8px 18px 18px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 10px 8px; vertical-align: top; border-bottom: 1px solid var(--line); }
th { font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
td.num, th.num { text-align: right; white-space: nowrap; }
tr.subtotal td { font-weight: 700; background: #faf6ee; }
tr.grand td { font-weight: 700; font-size: 1.05rem; background: var(--good-bg); }
small, .hint { color: var(--muted); display: block; font-size: 0.86rem; font-weight: 400; }
.note {
  background: var(--warn-bg);
  color: var(--warn);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 12px 0;
}
.banner-bad, .flash-error {
  background: var(--bad-bg);
  color: var(--bad);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 10px 0;
}
.banner-soon, .flash-info { background: var(--warn-bg); color: var(--warn); border-radius: 12px; padding: 12px 14px; margin: 10px 0; }
.flash-success, .banner-ok { background: var(--good-bg); color: var(--good); border-radius: 12px; padding: 12px 14px; margin: 10px 0; }

label { display: block; font-weight: 600; margin: 12px 0 4px; }
input, select, textarea {
  width: 100%;
  font: inherit;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #cbbfaa;
  background: white;
  color: var(--ink);
}
textarea { min-height: 90px; }
input:focus, select:focus, textarea:focus {
  outline: 3px solid rgba(184, 97, 45, 0.35);
  border-color: var(--copper-bright);
}
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.field-error { color: var(--bad); font-size: 0.9rem; margin: 4px 0 0; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 16px 0; }
button, .button {
  appearance: none;
  border: 0;
  background: var(--copper);
  color: white;
  font: inherit;
  font-weight: 600;
  padding: 11px 16px;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
button.secondary, .button.secondary { background: var(--forest); }
button.ghost, .button.ghost { background: transparent; color: var(--forest); border: 1px solid var(--line); }
button:hover, .button:hover { filter: brightness(1.05); }
.checks { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0; }
.checks input { width: auto; margin-top: 4px; }

.pill {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.82rem;
  font-weight: 700;
  background: #efe7da;
}
.pill.submitted, .pill.under_review { background: #fff1cc; color: #6a4b09; }
.pill.approved { background: #e7f0ff; color: #1d3f86; }
.pill.disbursed { background: #e7f5ee; color: var(--good); }
.pill.repaid { background: #e7efe9; color: #24523a; }
.pill.declined, .pill.overdue, .pill.expired { background: var(--bad-bg); color: var(--bad); }
.pill.draft { background: #eee; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.filters a { text-decoration: none; border: 1px solid var(--line); background: white; border-radius: 999px; padding: 6px 10px; color: var(--ink); }
.filters a.on { background: var(--forest); color: white; border-color: var(--forest); }

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 8px 0 8px 14px; border-left: 3px solid var(--gold); margin-left: 4px; }

.split { display: grid; grid-template-columns: 1.4fr 0.8fr; gap: 18px; }
.muted { color: var(--muted); }
.right { text-align: right; }
.search { display: flex; gap: 8px; align-items: end; }
.search input { width: 220px; }

details { background: #faf6ee; border-radius: 12px; padding: 8px 14px 14px; margin-top: 8px; }
summary { cursor: pointer; font-weight: 700; }

.people td form { display: flex; gap: 6px; }
.people input[type="password"] { width: 160px; }

@media (max-width: 860px) {
  .grid-2, .stats, .split, .fields { grid-template-columns: 1fr; }
  .header-inner { flex-direction: column; align-items: flex-start; }
  .search { flex-direction: column; align-items: stretch; }
  .search input { width: 100%; }
}
@media print {
  .site-header, .site-footer, .demo-banner, .no-print, nav, .actions { display: none !important; }
  body { background: white; }
  .ledger, .stat { box-shadow: none; }
}
