:root {
    color-scheme: light;
    --text: #28221f;
    --muted: #63554e;
    --background: #f6f0e6;
    --panel: #fffdf7;
    --line: #e8d9c3;
    --accent: #79531f;
    font: 16px/1.5 "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--background); color: var(--text); }
a { color: var(--accent); text-underline-offset: .2em; }
.shell { display: flex; min-height: 100vh; }
aside { flex: 0 0 235px; padding: 2rem 1.25rem; background: #24201d; color: #f8ecda; }
.brand { display: flex; align-items: center; gap: .8rem; color: inherit; font-size: 1.25rem; font-weight: 700; text-decoration: none; }
.brand small { display: block; font-size: .78rem; font-weight: 500; opacity: .87; }
.mark { display: grid; place-items: center; width: 2.8rem; height: 2.8rem; border-radius: .8rem; background: #e7c78c; color: #3d2915; font: bold 1.18rem Georgia, serif; }
aside nav { display: grid; gap: .35rem; margin: 2rem 0; }
aside nav a { color: inherit; text-decoration: none; padding: .64rem .8rem; border-radius: .55rem; }
aside nav a:hover, aside nav .selected { background: #473829; }
main { flex: 1; min-width: 0; margin: 0 auto; padding: clamp(1rem, 4vw, 3rem); max-width: 1250px; width: 100%; }
.guest { display: grid; align-content: center; justify-items: center; }
.login { width: min(100%, 440px); }
.login h1 { font-size: 1.95rem; margin: 1.7rem 0 1rem; }
h1, h2, p { margin: 0; }
h1 { font: 500 clamp(1.85rem, 4vw, 3rem)/1.15 Georgia, serif; }
h2 { font-size: 1.15rem; }
.heading, .section { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.heading > div > :first-child { margin-bottom: .35rem; display: block; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: .95rem; margin-bottom: 1rem; padding: clamp(1rem, 3vw, 1.65rem); }
.panel > h2 { margin-bottom: .8rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(175px, 100%), 1fr)); gap: .8rem; }
.stats strong { display: block; font-size: clamp(1.2rem, 3vw, 1.85rem); }
.stats p, .muted { color: var(--muted); }
.stats.inner { margin-bottom: .75rem; }
button, .button { appearance: none; display: inline-block; border: 1px solid transparent; border-radius: .55rem; padding: .64rem .95rem; background: var(--accent); color: white; font: inherit; font-weight: 650; text-decoration: none; cursor: pointer; }
button:hover, .button:hover { filter: brightness(.91); }
.secondary { background: #f1e5d1; color: #654619; border-color: var(--line); }
.signout { background: transparent; border-color: #9c815c; }
input, select { display: block; width: 100%; border: 1px solid #cbb89f; border-radius: .48rem; padding: .63rem; margin-top: .27rem; background: #fff; color: var(--text); font: inherit; }
label { display: block; font-size: .89rem; font-weight: 650; }
:focus-visible { outline: 3px solid #ab752d; outline-offset: 3px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr)); gap: .8rem; align-items: end; }
.actions { align-self: end; }
.stack { display: grid; gap: .8rem; max-width: 420px; }
.filter { display: flex; align-items: end; flex-wrap: wrap; gap: .8rem; margin-bottom: 1rem; }
.filter label { flex: 1 1 155px; }
.ledger { display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: baseline; gap: .6rem; border-top: 1px solid var(--line); padding: .65rem 0; }
.ledger strong, .receipt-total { text-align: right; }
.status { color: #365c47; background: #e6efe7; border-radius: 2rem; padding: .25rem .7rem; font-size: .83rem; }
.status.inactive { color: #65505a; background: #f1e7ea; }
details { border-top: 1px solid var(--line); padding: .75rem 0; }
details summary { cursor: pointer; color: var(--accent); }
details[open] summary { margin-bottom: .7rem; }
.row { padding: .7rem 0; }
.notice, .error { margin-bottom: 1rem; padding: .75rem 1rem; border-radius: .55rem; }
.notice { background: #e6efe7; color: #254c39; }
.error { background: #fbe9ec; color: #7c233b; }
.error ul { padding-left: 1.4rem; margin: .3rem 0 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; white-space: nowrap; padding: .6rem; border-bottom: 1px solid var(--line); }
.pagination { display: flex; align-items: center; flex-wrap: wrap; gap: .8rem; margin-top: .85rem; }
dl { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1rem; }
dt { color: var(--muted); }
dd { margin: 0; }
.receipt-total { margin-top: .85rem; }
@media (max-width: 720px) {
    .shell { display: block; }
    aside { padding: .9rem 1rem; }
    aside nav { display: flex; flex-wrap: wrap; gap: .22rem; margin: .65rem 0; }
    aside nav a { padding: .4rem; }
    .guest { min-height: 100vh; }
}

.brand span:last-child { line-height: 1.24; }
.mark { flex: 0 0 2.8rem; }
.login { padding: clamp(1.4rem, 5vw, 2.35rem); background: var(--panel); border: 1px solid var(--line); border-radius: 1rem; }
