:root {
    color-scheme: light;
    font: 15px/1.55 system-ui, "Segoe UI", sans-serif;
    color: #1a2938;
    background: #f3f6fa;
    --nav: #132538;
    --accent: #145f53;
    --border: #dce4ed;
    --muted: #526478;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: #10594f; text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid #258e83; outline-offset: 3px; }
h1,h2,p { margin: 0 0 .8rem; }
h1 { font-size: clamp(1.7rem, 4vw, 2.55rem); line-height: 1.12; letter-spacing: -.035em; }
h2 { font-size: 1.18rem; letter-spacing: -.018em; }
.app { display: grid; grid-template-columns: 225px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--nav); color: #e7eff8; padding: 1.5rem 1.1rem; display: flex; flex-direction: column; gap: 2rem; }
.wordmark { display: flex; align-items: center; gap: .7rem; font-size: 1.15rem; font-weight: 760; text-decoration: none; color: inherit; }
.wordmark span { display: grid; place-items: center; width: 2.15rem; aspect-ratio: 1; border-radius: .55rem; color: #093b31; background: #9ee6cd; }
.sidebar nav { display: grid; gap: .25rem; }
.sidebar nav a { padding: .65rem .8rem; border-radius: .45rem; text-decoration: none; color: #d9e6f3; }
.sidebar nav a:hover,.sidebar nav a[aria-current] { background: #284760; color: #fff; }
.sidebar-footer { margin-top: auto; overflow-wrap: anywhere; }
.sidebar-footer button { background: transparent; border: 1px solid #75899e; }
.workspace { width: 100%; max-width: 1510px; margin: 0 auto; padding: clamp(1rem, 3vw, 2.6rem); min-width: 0; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.1rem; }
.organization { color: var(--muted); font-weight: 650; margin-bottom: .3rem; }
.panel,.stat { background: #fff; border: 1px solid var(--border); border-radius: .75rem; padding: 1.25rem; min-width: 0; }
.panel { margin-bottom: 1rem; }
.purchase-title h2 { font-size: 1.6rem; margin-top: .3rem; }
.meta,.muted,.empty { color: var(--muted); }
.empty { margin: .55rem 0 0; }
.stats,.split { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; }
.stats { grid-template-columns: repeat(auto-fit,minmax(145px,1fr)); margin-bottom: 1rem; }
.stat span { display: block; color: var(--muted); }
.stat strong { display: block; font-size: 1.55rem; letter-spacing: -.035em; }
summary { cursor: pointer; font-weight: 720; }
.fold-body,details form { margin-top: .9rem; }
form { display: flex; align-items: end; flex-wrap: wrap; gap: .75rem; }
label { display: grid; gap: .3rem; font-weight: 600; flex: 1 1 170px; min-width: 0; }
label:has(textarea) { flex-basis: 100%; }
input,select,textarea { width: 100%; min-width: 0; background: #fff; border: 1px solid #aebccc; border-radius: .4rem; padding: .58rem; color: inherit; font: inherit; }
textarea { min-height: 5.5rem; resize: vertical; }
.check { display: flex; align-items: center; flex-basis: 100%; font-weight: 500; }
.check input { width: auto; }
button,.primary { display: inline-block; background: var(--accent); color: #fff; border: 1px solid transparent; border-radius: .42rem; padding: .58rem .85rem; font: inherit; font-weight: 670; text-decoration: none; cursor: pointer; }
button:hover,.primary:hover { background: #104c44; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th,td { padding: .65rem .55rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
th { font-size: .84rem; color: #42546a; background: #f2f6fa; }
td { min-width: 65px; white-space: pre-line; }
tr:last-child td { border-bottom: 0; }
.pill { display: inline-block; color: #235548; background: #e1f5ee; border-radius: 1rem; padding: .18rem .65rem; font-size: .84rem; font-weight: 650; }
.notice,.alert { border-radius: .45rem; padding: .65rem .85rem; background: #e0f5eb; color: #11543b; }
.alert { background: #fee9e7; color: #8a271e; }
.preserve { white-space: pre-wrap; overflow-wrap: anywhere; }
.guest { display: grid; place-items: center; min-height: 100vh; padding: 1rem; background: #eaf0f5; }
.sign-in { width: min(100%, 430px); margin: 0; padding: clamp(1.3rem,5vw,2.2rem); }
.sign-in .wordmark { margin-bottom: 1.3rem; }
.sign-in form { display: grid; }
.print main { max-width: 800px; margin: 2rem auto; }
@media (max-width: 890px) {
    .app { display: block; }
    .sidebar { gap: .8rem; padding: .85rem 1rem; }
    .sidebar nav { display: flex; flex-wrap: wrap; }
    .sidebar nav a { padding: .35rem .55rem; }
    .sidebar-footer { display: flex; gap: .6rem; align-items: center; }
    .sidebar-footer button { padding: .28rem .55rem; }
}
@media (max-width: 650px) {
    .split { grid-template-columns: 1fr; gap: 0; }
    .page-heading { align-items: flex-start; }
    .panel,.stat { padding: .85rem; }
    td { min-width: 90px; }
}
@media print {
    body { color: #111; background: #fff; }
    .print main { width: auto; max-width: none; margin: 0; border: 0; padding: 0; }
    .print-instruction { display: none; }
    .print p { orphans: 2; widows: 2; }
}
