:root {
    color-scheme: light;
    --olive-950: #202719;
    --olive-900: #2c3524;
    --olive-800: #38442d;
    --olive-700: #526340;
    --olive-600: #64754d;
    --olive-100: #e7eddc;
    --cream: #f6f6ef;
    --surface: #fffffb;
    --line: #e0e4d8;
    --text: #252c21;
    --muted: #5c6654;
    --radius: 13px;
    font-family: "Inter", "DM Sans", Arial, sans-serif;
    font-size: 15px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--cream); color: var(--text); }
h1, h2, h3, p, dl, dd { margin: 0; }
h1 { font: 500 clamp(2.1rem, 4vw, 3.25rem)/1.08 Georgia, serif; letter-spacing: -.045em; }
h2 { font-size: 1.14rem; line-height: 1.3; font-weight: 680; }
h3 { font-size: 1rem; line-height: 1.35; font-weight: 680; }
p, small { color: var(--muted); line-height: 1.5; }
a { color: #475b35; text-underline-offset: 4px; }
a:hover { color: #26371c; }
a, button, input, select, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #889d5f; outline-offset: 3px; }
img { max-width: 100%; }
button, input, select { font: inherit; }
button, .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 15px;
    border: 1px solid transparent;
    border-radius: 8px;
    text-decoration: none;
    font-size: .92rem;
    font-weight: 650;
    cursor: pointer;
}
.primary { background: var(--olive-700); color: #fff; }
.primary:hover { background: var(--olive-900); color: #fff; }
.secondary { border-color: #ccd4c2; background: var(--surface); color: #3c4a31; }
.secondary:hover { background: #edf1e6; color: #26371c; }
.layout { display: grid; grid-template-columns: 244px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
    background: var(--olive-950);
    color: #f8f8ef;
    padding: 25px 17px;
    display: flex;
    flex-direction: column;
    gap: 28px;
    position: sticky;
    top: 0;
    height: 100vh;
}
.brand {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 4px;
    font-size: 1.12rem;
    font-weight: 700;
}
.brand:hover { color: #fff; }
.brand img { width: 56px; height: 49px; object-fit: cover; border-radius: 8px; }
.brand small, .side-footer small { display: block; color: #bcc8b4; font-size: .79rem; font-weight: 400; }
.sidebar nav { display: grid; gap: 5px; }
.sidebar nav a { color: #dce4d5; border: 1px solid transparent; border-radius: 8px; padding: 11px 12px; text-decoration: none; font-size: .91rem; }
.sidebar nav a:hover, .sidebar nav a[aria-current="page"] { color: #fff; background: var(--olive-800); border-color: #56684a; }
.sidebar nav a[aria-current="page"] { font-weight: 700; }
.side-footer { display: grid; gap: 14px; margin-top: auto; border-top: 1px solid #3e4935; padding: 17px 5px 0; }
.side-footer a { color: #dce7d0; font-size: .86rem; }
.signout { background: transparent; color: #edf3e7; border-color: #647459; width: 100%; }
.signout:hover { background: var(--olive-800); }
.workspace { max-width: 1460px; width: 100%; margin: 0 auto; padding: 26px clamp(18px, 4vw, 52px) 60px; min-width: 0; }
.workspace-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; color: var(--muted); font-size: .84rem; margin-bottom: 23px; }
.demo { background: #eee6cd; color: #604815; border: 1px solid #dfd2a9; border-radius: 20px; padding: 5px 10px; font-weight: 650; white-space: nowrap; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 23px; }
.section-head p { margin-top: 7px; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 23px; }
.metric {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 7px;
    min-height: 121px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 15px;
    text-decoration: none;
}
.metric:hover { background: #eef2e6; }
.metric span { font-size: .87rem; font-weight: 630; }
.metric strong { font: 500 clamp(1.55rem, 2.25vw, 2.5rem)/1.1 Georgia, serif; letter-spacing: -.04em; overflow-wrap: anywhere; }
.metric small { font-size: .76rem; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 21px; min-width: 0; overflow: hidden; }
.panel.selected { border-color: #aab994; }
.panel-head { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; padding: 17px 19px; }
.panel-head p { font-size: .87rem; margin-top: 4px; }
.panel-head > span { color: var(--muted); font-size: .84rem; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; font-size: .89rem; }
th, td { padding: 11px 15px; text-align: left; border-top: 1px solid var(--line); }
th { background: #f3f5ed; color: #4e5946; font-weight: 650; white-space: nowrap; }
td:first-child, th:first-child { padding-left: 19px; }
td:last-child, th:last-child { padding-right: 19px; }
tbody tr:hover { background: #f8faf3; }
.pill { display: inline-block; white-space: nowrap; border-radius: 16px; padding: 5px 9px; font-size: .75rem; font-weight: 650; background: #ecefe8; color: #414d3b; }
.pill.delivered, .pill.paid, .pill.received, .pill.active { background: #e3efdb; color: #355a2a; }
.pill.partial, .pill.part_paid, .pill.paused { background: #f4ecd5; color: #685420; }
.pill.missed, .pill.void, .pill.cancelled, .pill.reversed, .pill.disabled { background: #f2e6e1; color: #824437; }
.pill.subscription { background: #e7ebdc; color: #4a5537; }
.empty { padding: 15px 19px 22px; font-size: .91rem; }
.notice { padding: 12px 15px; border: 1px solid; border-radius: 8px; margin-bottom: 15px; font-size: .92rem; }
.notice.success { background: #e9f2e3; border-color: #bad0ad; color: #354f2b; }
.notice.error { background: #fbebe6; border-color: #dfb5aa; color: #7f352a; }
.form-pad { padding: 0 19px 19px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.form-grid .span { grid-column: 1 / -1; }
label { display: flex; flex-direction: column; gap: 5px; font-size: .86rem; font-weight: 650; }
input:not([type="checkbox"]), select {
    border: 1px solid #cbd4c2; border-radius: 7px; background: #fff; color: var(--text); width: 100%; min-width: 0;
    padding: 9px 10px; min-height: 42px; font-size: .93rem; font-weight: 400;
}
input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--olive-700); margin: 0; }
.check { display: inline-flex; flex-direction: row; align-items: center; gap: 8px; }
.calculation { display: block; padding: 10px 12px; border-radius: 7px; color: #415035; background: var(--olive-100); font-size: .88rem; }
.weekdays { min-width: 0; border: 1px solid var(--line); border-radius: 7px; padding: 10px; display: flex; flex-wrap: wrap; gap: 10px 16px; margin: 0; }
legend { padding: 0 4px; color: var(--muted); font-size: .83rem; }
.inline-form { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; }
.inline-form label { min-width: 145px; }
.inline-form output { align-self: center; font-size: .9rem; font-weight: 700; }
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; align-items: start; }
.inset { border: 1px solid var(--line); background: #f8faf3; border-radius: 8px; padding: 13px; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.facts div { border-radius: 8px; padding: 10px 12px; background: #f3f6ec; }
.facts dt { color: var(--muted); font-size: .8rem; }
.facts dd { font-size: .96rem; font-weight: 700; margin-top: 4px; }
.facts dd small { display: block; font-weight: 400; }
.pause-line { display: flex; flex-wrap: wrap; gap: 8px 17px; align-items: center; font-size: .87rem; margin: 8px 0; }
.delivery { border-top: 1px solid var(--line); padding: 17px 19px; }
.delivery-main { display: grid; grid-template-columns: 1.5fr 1fr .8fr; gap: 16px; }
.delivery p, .delivery small, .delivery a { font-size: .85rem; }
.delivery h3 { margin-bottom: 3px; }
.delivery-note { margin-top: 7px; }
details { margin-top: 12px; }
summary { cursor: pointer; color: #425536; font-size: .88rem; font-weight: 650; }
details > form { margin-top: 9px; }
.back { margin-bottom: 15px; }
.invoice h1 { font-size: clamp(1.7rem, 3vw, 2.6rem); }
.sr-only { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
[hidden] { display: none !important; }
.access { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(320px, 1.25fr); max-width: 950px; margin: clamp(24px, 9vh, 90px) auto; border: 1px solid var(--line); border-radius: 17px; overflow: hidden; background: var(--surface); }
.access-brand { display: flex; flex-direction: column; gap: 25px; justify-content: space-between; padding: 28px; background: #6b7834; color: #fff; }
.access-brand img { width: 160px; border-radius: 8px; }
.access-brand a, .access-brand p { color: #fff; }
.access-brand p { margin-top: 9px; }
.access-form { padding: 29px; }
.access-form h2 { margin-bottom: 17px; font-size: 1.35rem; }
@media (max-width: 1050px) {
    .layout { grid-template-columns: 194px minmax(0, 1fr); }
    .sidebar { padding: 18px 10px; }
    .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .access { margin-inline: 18px; }
}
@media (max-width: 710px) {
    .layout { display: block; }
    .sidebar { position: static; height: auto; gap: 12px; padding: 12px; }
    .sidebar nav { display: flex; flex-wrap: wrap; gap: 4px; }
    .sidebar nav a { padding: 8px; font-size: .8rem; }
    .side-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 9px 13px; padding-top: 8px; }
    .side-footer form { margin-left: auto; }
    .signout { min-height: 34px; padding: 4px 9px; }
    .workspace { padding: 14px 12px 30px; }
    .workspace-top { margin-bottom: 13px; }
    .section-head { align-items: start; flex-direction: column; gap: 10px; margin-bottom: 15px; }
    .metrics { gap: 8px; }
    .metric { min-height: 104px; padding: 11px; }
    .split, .form-grid, .delivery-main, .access { grid-template-columns: 1fr; }
    .delivery-main { gap: 8px; }
    .facts { gap: 5px; }
    .facts div { padding: 7px; }
    .access { margin: 13px; }
    .access-brand { gap: 12px; padding: 17px; }
    .access-brand img { width: 100px; }
    .access-form { padding: 17px; }
}
@media print {
    body, .panel { background: white; }
    .sidebar, .workspace-top, .print-hide, .notice { display: none !important; }
    .layout { display: block; }
    .workspace { padding: 0; }
    .panel { border: 0; }
}
