:root {
  color-scheme: light;
  --ink: #202b3a;
  --muted: #617082;
  --line: #dce3eb;
  --panel: #fff;
  --canvas: #f3f6fa;
  --accent: #164e7a;
  --accent-dark: #0f3b5d;
  --danger: #9b2635;
  --good: #216547;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); }
a { color: var(--accent); }
.topbar { background: #fff; border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1180px; margin: auto; padding: 1rem 1.25rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.brand { color: var(--ink); text-decoration: none; font-weight: 750; font-size: 1.05rem; }
.property { display: block; color: var(--muted); font-weight: 400; font-size: .8rem; margin-top: .2rem; }
nav { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
nav a, nav button { border: 0; border-radius: .45rem; padding: .55rem .7rem; color: var(--ink); background: transparent; text-decoration: none; font: inherit; font-size: .92rem; cursor: pointer; }
nav a:hover, nav button:hover { background: var(--canvas); }
main { max-width: 1180px; margin: 2rem auto; padding: 0 1.25rem 3rem; }
h1 { font-size: clamp(1.55rem, 3vw, 2.15rem); margin: 0 0 .35rem; }
h2 { font-size: 1.15rem; margin: 0 0 1rem; }
h3 { font-size: 1rem; margin: 0 0 .8rem; }
.muted { color: var(--muted); }
.small { font-size: .84rem; }
.grid { display: grid; gap: 1rem; }
.cards { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin: 1.5rem 0; }
.two-col { grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); }
.card, .panel { background: var(--panel); border: 1px solid var(--line); border-radius: .8rem; padding: 1.15rem; box-shadow: 0 4px 16px #14283d08; }
.metric { font-size: 1.8rem; font-weight: 750; margin-top: .45rem; }
.metric.good { color: var(--good); }
.metric.danger { color: var(--danger); }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1rem 0; }
button, .button { display: inline-flex; justify-content: center; align-items: center; border: 1px solid var(--accent); border-radius: .5rem; padding: .68rem .95rem; background: var(--accent); color: #fff; text-decoration: none; font: inherit; font-weight: 650; cursor: pointer; }
button:hover, .button:hover { background: var(--accent-dark); }
.button.secondary, button.secondary { color: var(--accent); background: #fff; }
.button.danger, button.danger { background: #fff; color: var(--danger); border-color: #d8a6ad; }
form { margin: 0; }
label { display: block; font-weight: 650; font-size: .9rem; margin: .85rem 0 .35rem; }
input, select, textarea { display: block; width: 100%; border: 1px solid #b9c5d2; border-radius: .45rem; padding: .68rem .72rem; color: var(--ink); background: #fff; font: inherit; }
input[type=checkbox] { display: inline-block; width: auto; margin-right: .45rem; }
textarea { min-height: 6rem; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 3px solid #79b7e5; outline-offset: 2px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .75rem; }
.form-actions { margin-top: 1rem; display: flex; gap: .5rem; flex-wrap: wrap; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 680px; }
th, td { padding: .75rem .65rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
td.amount { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.amount-positive { color: var(--good); }
.amount-negative { color: var(--danger); }
.table-total th, .table-total td { background: #f7f9fb; font-weight: 650; }
.table-grand-total th, .table-grand-total td { background: #eaf1f7; color: var(--ink); font-weight: 750; border-top: 2px solid var(--line); }
dialog { width: min(760px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); overflow: auto; border: 1px solid var(--line); border-radius: .8rem; padding: 1.25rem; color: var(--ink); background: var(--panel); box-shadow: 0 20px 60px #14283d33; }
dialog::backdrop { background: #14283d88; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.dialog-heading h2 { margin: 0; }
.badge { display: inline-block; padding: .22rem .52rem; background: #e9f0f6; color: #284963; border-radius: 999px; font-size: .78rem; font-weight: 650; white-space: nowrap; }
.badge.good { background: #e5f3ec; color: #216547; }
.badge.warn { background: #fff2d9; color: #75520f; }
.badge.danger { background: #fbe8ea; color: #8d2432; }
.alert { border: 1px solid #c8d8e7; background: #edf6fc; border-radius: .55rem; padding: .9rem 1rem; margin: 1rem 0; }
.alert.error { border-color: #e2b7bd; background: #fff0f1; color: #76202c; }
.alert.success { border-color: #b8d8c5; background: #edf8f1; color: #20553a; }
.inline-form { display: inline; }
.inline-form button { padding: .4rem .6rem; font-size: .85rem; }
details { margin-top: .65rem; }
summary { color: var(--accent); cursor: pointer; font-weight: 650; }
.details-form { background: #f7f9fb; border: 1px solid var(--line); padding: .8rem; border-radius: .6rem; margin-top: .55rem; }
.auth-shell { max-width: 480px; margin: 3rem auto; }
.auth-shell .panel { padding: clamp(1.3rem, 5vw, 2rem); }
.audit-json { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 34rem; font-size: .8rem; }
.footer { color: var(--muted); font-size: .8rem; text-align: center; padding: 1rem; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 1.5rem; }
.narrow-card { max-width: 24rem; }
.issue-card { margin: .8rem 0; }
.issue-heading { display: flex; justify-content: space-between; align-items: center; gap: .7rem; }
.issue-heading h3 { margin-bottom: 0; }
@media (max-width: 650px) { .topbar-inner { align-items: flex-start; } nav { width: 100%; } main { margin-top: 1.25rem; } table { min-width: 620px; } }
