:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172b3a;
  background: #f4f7f8;
  --ink: #172b3a;
  --muted: #526575;
  --line: #dce5e9;
  --green: #14644d;
  --navy: #152c3a;
  --radius: 15px;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; }
a { color: var(--green); text-decoration: none; }
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #4a9d84; outline-offset: 3px; }
button { cursor: pointer; }
button:disabled { opacity: .6; cursor: wait; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 236px; background: var(--navy); color: white; display: flex; flex-direction: column; padding: 29px 20px; }
.brand { display: inline-flex; align-items: center; gap: 12px; padding-left: 8px; color: #fff; font-size: 18px; font-weight: 720; line-height: 1.13; letter-spacing: -.3px; }
.mark { width: 42px; height: 42px; border-radius: 12px; background: #9addc4; color: #143b32; display: grid; place-items: center; font-size: 24px; }
nav { display: grid; gap: 8px; margin-top: 49px; }
nav a { display: flex; align-items: center; gap: 12px; min-height: 45px; padding: 0 12px; color: #d5e2e9; border-radius: 9px; font-size: 15px; }
nav a span { font-size: 21px; width: 22px; text-align: center; }
nav a:hover, nav a[aria-current="page"] { background: #284854; color: #e2fff3; }
.sidebar-footer { margin-top: auto; border-top: 1px solid #38505d; padding: 18px 7px 0; display: flex; gap: 10px; align-items: center; color: #cadce5; font-size: 14px; }
.lock { display: inline-block; width: 12px; height: 9px; margin-top: 4px; border: 1px solid currentColor; border-radius: 2px; position: relative; }
.lock::before { content: ""; position: absolute; left: 2px; right: 2px; bottom: 7px; height: 6px; border: 1px solid currentColor; border-bottom: 0; border-radius: 5px 5px 0 0; }
.workspace { margin-left: 236px; padding: 40px clamp(24px, 4vw, 64px) 54px; min-height: 100vh; max-width: 1610px; }
.top { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 27px; }
.kicker { margin: 0 0 8px; color: var(--muted); font-size: 14px; font-weight: 600; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; letter-spacing: -.05em; font-size: clamp(30px, 4.2vw, 48px); line-height: 1.07; }
h2 { margin-bottom: 5px; font-size: 20px; letter-spacing: -.025em; }
.primary, .secondary, .danger { padding: 11px 15px; min-height: 43px; border-radius: 9px; font-weight: 650; border: 1px solid transparent; }
.primary { color: #fff; background: var(--green); }
.primary:hover { background: #104d3c; }
.primary span { margin-right: 4px; }
.secondary { background: white; border-color: var(--line); color: var(--ink); }
.danger { color: #8d252a; background: #fae8e8; }
.metrics, .charts { display: grid; gap: 16px; }
.metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 2px 4px #18374606; }
.metric { padding: 21px 22px; display: grid; gap: 9px; }
.metric span, .metric small { color: var(--muted); font-size: 14px; }
.metric strong { font-size: clamp(23px, 2.75vw, 38px); letter-spacing: -.045em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.remaining { background: #e8f6ee; border-color: #c3e5d2; color: #144e3c; }
.remaining span, .remaining small { color: #356451; }
.charts { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 18px 0; }
.chart { min-height: 284px; padding: 22px; }
.muted { color: var(--muted); font-size: 14px; line-height: 1.5; }
.chart p { margin-bottom: 18px; }
.graph-row { display: grid; grid-template-columns: minmax(75px, 1fr) minmax(45px, 1fr) auto; gap: 10px; align-items: center; margin-bottom: 12px; font-size: 14px; }
.graph-row b { font-variant-numeric: tabular-nums; font-size: 13px; text-align: right; }
progress { appearance: none; width: 100%; height: 8px; border: 0; border-radius: 8px; background: #eaf0f2; }
progress::-webkit-progress-bar { border-radius: 8px; background: #eaf0f2; }
progress::-webkit-progress-value { border-radius: 8px; background: #258268; }
progress::-moz-progress-bar { border-radius: 8px; background: #258268; }
#months progress::-webkit-progress-value { background: #487991; }
#months progress::-moz-progress-bar { background: #487991; }
.empty { padding: 20px; border: 1px dashed var(--line); border-radius: 10px; color: var(--muted); margin: 0; text-align: center; font-size: 15px; line-height: 1.5; }
.ledger { padding: 22px; }
.ledger > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.ledger > header a, .link { color: var(--green); background: none; border: 0; padding: 6px 0; font-weight: 650; font-size: 14px; }
.ledger > header a:hover, .link:hover { text-decoration: underline; }
.filters, .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.filters { grid-template-columns: 2fr 1fr; margin-bottom: 19px; }
label { display: grid; gap: 6px; color: var(--ink); font-size: 14px; font-weight: 650; }
label small { display: inline; color: var(--muted); font-size: 13px; font-weight: 400; }
input, select { width: 100%; min-height: 42px; padding: 8px 10px; color: var(--ink); background: #fff; border: 1px solid #bbcbd2; border-radius: 8px; }
select { appearance: none; padding-right: 34px; background-image: linear-gradient(45deg, transparent 50%, #456272 50%), linear-gradient(135deg, #456272 50%, transparent 50%); background-position: right 16px center, right 11px center; background-size: 5px 5px; background-repeat: no-repeat; }
.wide { grid-column: 1 / -1; }
.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; white-space: nowrap; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); }
th { font-weight: 650; color: var(--muted); background: #f4f7f8; }
tr:last-child td { border-bottom: 0; }
td:last-child { text-align: right; }
.status { color: #923338; font-size: 13px; padding-left: 5px; font-weight: 600; }
dialog { width: min(590px, calc(100vw - 24px)); border: 1px solid var(--line); border-radius: 19px; color: var(--ink); padding: 19px 23px 23px; max-height: calc(100dvh - 28px); box-shadow: 0 18px 65px #142d4250; }
dialog::backdrop { background: #132b3c83; }
.dialog-head, .signature-head, .dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-head { margin-bottom: 14px; }
.close { display: grid; place-items: center; border: 0; border-radius: 7px; background: #edf3f5; color: var(--ink); width: 36px; height: 36px; font-size: 24px; }
.signature-head { margin-top: 13px; }
#ack { margin: 3px 0 8px; }
#signature { display: block; width: 100%; height: 110px; border: 1px dashed #9ab3bf; border-radius: 8px; background: #f6fafb; touch-action: none; cursor: crosshair; }
.dialog-actions { justify-content: end; margin-top: 16px; }
.error, .notice { color: #923338; font-size: 14px; margin: 12px 0 0; }
.notice { color: var(--muted); }
.receipt-sheet { padding: 21px; border: 1px solid var(--line); border-radius: 12px; }
.receipt-amount { color: var(--green); font-size: 36px; margin-bottom: 4px; letter-spacing: -.04em; }
.receipt-id { margin-bottom: 18px; color: var(--muted); }
dl { margin: 0 0 15px; display: grid; grid-template-columns: minmax(80px, 1fr) 2fr; gap: 9px 13px; font-size: 15px; }
dt { color: var(--muted); }
dd { margin: 0; overflow-wrap: anywhere; }
.receipt-signature { display: block; width: 100%; max-width: 340px; height: auto; border-bottom: 1px solid var(--line); }
#void-form { margin-top: 15px; }
@media (max-width: 900px) {
  .sidebar { width: 190px; padding-inline: 13px; }
  .workspace { margin-left: 190px; padding-inline: 22px; }
  .metric { padding: 16px; }
}
@media (max-width: 690px) {
  .sidebar { position: static; width: 100%; padding: 12px 14px; flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; }
  .brand { font-size: 14px; gap: 7px; padding: 0; }
  .mark { width: 32px; height: 32px; font-size: 19px; }
  nav { display: flex; margin: 0; gap: 2px; }
  nav a { font-size: 13px; min-height: 38px; padding: 0 8px; }
  nav a span, .sidebar-footer { display: none; }
  .workspace { margin: 0; padding: 23px 14px 34px; }
  .top { margin-bottom: 18px; align-items: center; }
  .top .primary { font-size: 14px; padding-inline: 9px; }
  .metrics, .charts { grid-template-columns: 1fr; gap: 10px; }
  .metric { grid-template-columns: 1fr auto; align-items: center; }
  .metric strong { grid-row: span 2; }
  .chart { min-height: auto; }
  .filters { grid-template-columns: 1fr; }
  .ledger, .chart { padding: 15px; }
}
@media print {
  body { background: #fff; }
  .sidebar, main, .dialog-head, .dialog-actions, #receipt-error, #void-form { display: none !important; }
  dialog#receipt-dialog { position: static; width: 100%; max-width: 100%; max-height: none; margin: 0; border: 0; box-shadow: none; padding: 0; }
  dialog::backdrop { display: none; }
}

.login { min-height: 100dvh; display: grid; place-items: center; padding: 20px 14px; }
.login-card { width: min(100%, 420px); padding: clamp(20px, 6vw, 32px); }
.login-card .mark { margin-bottom: 14px; }
.login-card h1 { font-size: clamp(24px, 7vw, 32px); margin-bottom: 8px; }
.login-card form { display: grid; gap: 12px; }
.login-card .owner-sign-in { display: block; border-top: 1px solid var(--line); padding-top: 18px; margin-top: 20px; font-size: 14px; }
.header-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; }
.login-card .alternate-sign-in { margin-top: 12px; width: 100%; }
