:root {
    color-scheme: light;
    --ink: #1b2b26; --muted: #596961; --line: #e0e6df; --canvas: #f5f7f3;
    --nav: #172623; --nav-muted: #b7c8bd; --accent: #d3ef87; --forest: #23523f;
    --side: 254px;
    font: 15px/1.5 "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--canvas); color: var(--ink); }
a { color: var(--forest); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #599c75; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(2rem, 3.4vw, 3rem); line-height: 1.08; letter-spacing: -.05em; }
h2 { font-size: 1.17rem; line-height: 1.25; letter-spacing: -.023em; }
small { font-size: .83rem; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--side); z-index: 20; display: flex; flex-direction: column; background: var(--nav); color: #fff; padding: 28px 18px 17px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; font-size: 1.52rem; font-weight: 720; line-height: 1; letter-spacing: -.035em; }
.sidebar .brand { margin: 0 7px 34px; }
.brand-mark { width: 43px; height: 43px; display: grid; place-items: center; flex: none; border-radius: 12px; background: var(--accent); color: #223b27; font-family: Georgia, serif; font-size: 1.9rem; }
.brand small { display: block; font-size: .6rem; letter-spacing: .11em; font-weight: 600; color: var(--nav-muted); margin-top: 6px; }
.workspace-nav, .sidebar-end { display: grid; gap: 4px; }
.workspace-nav a, .sidebar-option { display: flex; align-items: center; gap: 12px; color: var(--nav-muted); background: transparent; border: 0; border-radius: 9px; padding: 10px 12px; min-height: 43px; text-align: left; }
.workspace-nav a:hover, .sidebar-option:hover { text-decoration: none; background: #243932; color: #fff; }
.workspace-nav [aria-current], .sidebar-option[aria-current] { background: #314a3e; color: #e4f6b6; font-weight: 650; }
.sidebar-end { margin-top: auto; padding-top: 22px; }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 15px 3px 0; border-top: 1px solid #31443b; margin-top: 10px; }
.sidebar-user > span:nth-child(2) { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.sidebar-user small { display: block; color: var(--nav-muted); }
.avatar { flex: none; width: 35px; height: 35px; display: grid; place-items: center; background: #425f4e; border-radius: 50%; color: #fff; font-weight: 700; }
.icon-button { min-width: 38px; min-height: 38px; display: grid; place-items: center; border: 1px solid transparent; background: transparent; color: inherit; border-radius: 8px; }
.icon-button:hover { border-color: currentColor; }
.topbar { margin-left: var(--side); display: flex; justify-content: space-between; align-items: center; gap: 16px; height: 69px; padding: 0 clamp(20px, 3.1vw, 48px); background: #fff; border-bottom: 1px solid var(--line); }
.breadcrumb, .top-date { color: var(--muted); display: flex; align-items: center; gap: 11px; }
.breadcrumb strong { color: var(--ink); }
.content { margin-left: var(--side); max-width: 1820px; padding: 29px clamp(20px, 3.1vw, 48px) 65px; }
.mobile-menu, .bottom-nav, .menu-scrim { display: none !important; }
.button { display: inline-flex; gap: 8px; align-items: center; justify-content: center; min-height: 43px; padding: 9px 15px; border: 1px solid transparent; border-radius: 9px; font-weight: 660; text-align: center; line-height: 1.25; color: #202f20; }
.button:hover { text-decoration: none; }
.primary { background: var(--accent); border-color: #bedc71; }
.primary:hover { background: #e2f6ad; }
.secondary { background: #fff; border-color: #cdd9ce; }
.secondary:hover { background: #eaf1e9; }
.hero { position: relative; overflow: hidden; min-height: 218px; isolation: isolate; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: clamp(24px, 3vw, 43px); border-radius: 17px; background: linear-gradient(115deg, #1d382d, #233e32 57%, #304e38); color: #fff; }
.hero-copy { position: relative; z-index: 1; }
.hero-date { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 13px; color: #cfe2c9; font-size: .88rem; font-weight: 600; }
.hero p { color: #d1e4d7; margin-top: 10px; }
.hero-button { white-space: nowrap; z-index: 1; }
.hero-lines { position: absolute; width: 535px; height: 535px; right: -70px; top: -105px; transform: rotate(-28deg); z-index: -1; opacity: .8; }
.hero-lines i { position: absolute; inset: 24px; border: 1px solid #8dac65; border-radius: 30%; }
.hero-lines i:nth-child(2) { inset: 52px; }
.hero-lines i:nth-child(3) { inset: 80px; }
.hero-lines i:nth-child(4) { inset: 108px; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 20px 0; }
.metric, .panel { background: #fff; border: 1px solid var(--line); border-radius: 13px; }
.metric { display: grid; align-content: end; gap: 6px; min-height: 128px; padding: 15px 17px; color: var(--muted); }
.metric:hover { border-color: #92ae9b; text-decoration: none; }
.metric strong { color: var(--ink); font-size: clamp(1.35rem, 2.2vw, 1.86rem); letter-spacing: -.045em; overflow-wrap: anywhere; line-height: 1.14; }
.metric-icon { width: 39px; height: 39px; display: inline-grid; flex: none; place-items: center; border-radius: 10px; }
.green { background: #e6f0dc; color: #285d38; }
.blue { background: #e6edf3; color: #335876; }
.yellow { background: #f4eedc; color: #715828; }
.violet { background: #eee8f5; color: #674884; }
.dashboard-grid, .split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; gap: 18px; }
.dashboard-grid .panel { min-height: 278px; }
.panel { padding: clamp(16px, 2vw, 26px); min-width: 0; }
.section-title, .page-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.section-title { margin-bottom: 15px; }
.section-title a, .empty a { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; font-size: .89rem; }
.page-heading { margin: 0 0 21px; }
.page-heading h1 { font-size: clamp(1.85rem, 3vw, 2.65rem); overflow-wrap: anywhere; }
.empty { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 28px 12px; color: var(--muted); }
.empty strong { color: var(--ink); }
.quick-link, .timeline-row { display: flex; align-items: center; gap: 11px; color: var(--ink); border-top: 1px solid var(--line); padding: 10px 0; }
.quick-link > :nth-child(2), .timeline-row > :nth-child(2) { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.quick-link small, .timeline-row small, .muted { color: var(--muted); }
.quick-link small, .timeline-row small { display: block; }
.stack { display: grid; gap: 15px; }
.stack + .stack, .panel + .page-heading, .panel + .panel.full { margin-top: 18px; }
.stack > .button { justify-self: start; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.wide { grid-column: 1 / -1; }
label { display: grid; gap: 5px; font-weight: 620; }
label.check { display: flex; align-items: flex-start; gap: 8px; }
label.check input { width: 17px; height: 17px; min-height: 0; margin-top: 4px; }
input, select, textarea { width: 100%; min-width: 0; min-height: 43px; border: 1px solid #cbd6cc; border-radius: 8px; padding: 8px 10px; background: #fff; color: var(--ink); font-weight: 400; }
textarea { resize: vertical; }
.form-actions, .actions, .inline-group { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.form-actions form, .actions form { margin: 0; }
.inline-group { align-items: flex-end; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-size: .82rem; font-weight: 670; }
td.amount, th.amount { text-align: right; white-space: nowrap; }
td a { font-weight: 650; }
.tag { display: inline-block; border-radius: 5px; background: #edf2eb; color: #365341; font-size: .82rem; padding: 3px 7px; white-space: nowrap; }
.notice { border-radius: 9px; margin-bottom: 15px; padding: 10px 13px; background: #e9f4e1; border: 1px solid #c9dec0; }
.notice.error { background: #fff1ed; border-color: #eac0b1; color: #842e20; }
.notice ul { margin: 0; padding-left: 18px; }
.details { display: grid; grid-template-columns: repeat(auto-fit, minmax(138px, 1fr)); gap: 12px; margin: 0; }
.details div { min-width: 0; }
.details dt { color: var(--muted); }
.details dd { margin: 2px 0 0; overflow-wrap: anywhere; font-weight: 650; }
.items-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.items { display: grid; gap: 10px; }
.item-row { display: grid; grid-template-columns: minmax(150px, 3fr) repeat(3, minmax(100px, 1fr)) auto; gap: 8px; align-items: end; background: var(--canvas); border: 1px solid var(--line); padding: 10px; border-radius: 9px; }
.item-row button { min-height: 43px; }
.totals { display: grid; gap: 5px; margin: 0 0 0 auto; max-width: 285px; width: 100%; }
.totals div { display: flex; justify-content: space-between; gap: 12px; }
.totals dd { margin: 0; }
.totals div:last-child { border-top: 1px solid var(--line); padding-top: 6px; font-weight: 750; }
.preline { white-space: pre-line; overflow-wrap: anywhere; }
.pagination { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 15px; }
.guest { min-height: 100svh; display: grid; place-items: center; padding: 22px; background: radial-gradient(ellipse at top right, #dcebcf, var(--canvas) 62%); }
.login-panel { width: min(100%, 430px); border: 1px solid var(--line); border-radius: 18px; background: #fff; padding: clamp(22px, 4vw, 39px); display: grid; gap: 23px; }
.login-panel .brand small { color: var(--muted); }
.login-panel h1 { font-size: 2.25rem; }
.login-panel form .button { width: 100%; }
@media (max-width: 1100px) {
    :root { --side: 218px; }
    .metrics { gap: 10px; }
    .metric { padding: 13px; }
    .item-row { grid-template-columns: repeat(3, minmax(0, 1fr)) auto; }
    .item-row label:first-child { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
    .topbar, .content { margin-left: 0; }
    .topbar { height: 59px; padding: 0 16px; }
    .top-date, .breadcrumb > :not(strong) { display: none; }
    .mobile-menu { display: inline-flex !important; }
    .sidebar { display: none; padding-bottom: max(17px, env(safe-area-inset-bottom)); width: min(285px, 82vw); }
    .sidebar.is-open { display: flex; }
    .menu-scrim:not([hidden]) { display: block !important; position: fixed; inset: 0; background: #14251eb3; border: 0; z-index: 19; }
    .bottom-nav { display: flex !important; justify-content: space-around; position: fixed; z-index: 10; inset: auto 0 0; padding: 5px 5px max(5px, env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); }
    .bottom-nav a { display: grid; place-items: center; gap: 2px; min-height: 49px; padding: 3px 8px; color: var(--muted); font-size: .72rem; }
    .bottom-nav [aria-current] { color: #21573b; font-weight: 760; }
    .content { padding: 15px 15px calc(88px + env(safe-area-inset-bottom)); }
    .hero { display: grid; justify-items: start; gap: 16px; min-height: auto; padding: 21px; }
    .hero-lines { right: -315px; opacity: .48; }
    .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 12px 0; }
    .metric { min-height: 115px; }
    .dashboard-grid, .split { grid-template-columns: 1fr; gap: 12px; }
    .dashboard-grid .panel { min-height: 0; }
    .page-heading { margin-bottom: 14px; align-items: flex-start; }
    input, select, textarea { font-size: 16px; }
}
@media (max-width: 400px) {
    .form-grid { grid-template-columns: 1fr; }
    .item-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .item-row button { justify-self: end; }
}
