:root {
  color-scheme: light;
  --ink: #1e2922;
  --muted: #788078;
  --line: #e8ece6;
  --paper: #ffffff;
  --canvas: #f5f7f3;
  --green: #287554;
  --green-dark: #1d5f43;
  --green-soft: #e9f3ec;
  --lime: #d8e5a9;
  --red: #b94338;
  --amber: #98661b;
  --shadow: 0 16px 45px rgba(34, 53, 38, .07);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); font-size: 14px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.app-shell { min-height: 100vh; }
.sidebar { width: 252px; position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; padding: 25px 15px 16px; background: #fff; border-right: 1px solid var(--line); z-index: 5; overflow-y: auto; overscroll-behavior: contain; }
.brand { display: flex; gap: 11px; align-items: center; color: var(--ink); text-decoration: none; padding: 0 9px 32px; }
.brand-mark { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--green); color: #fff; font-size: 21px; font-weight: 750; box-shadow: inset 0 -4px 0 rgba(0,0,0,.1); }
.brand strong, .brand small, .signed-copy strong, .signed-copy small { display: block; }
.brand strong { font-size: 14px; letter-spacing: -.25px; }
.brand small { font-size: 11px; color: var(--muted); margin-top: 3px; }
.nav-kicker, .eyebrow { font-size: 10px; font-weight: 750; color: #859086; letter-spacing: .12em; }
.nav-kicker { padding: 0 12px 10px; }
.main-nav { display: grid; gap: 5px; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 12px; padding: 11px 12px; border: 0; color: #657067; background: transparent; text-align: left; border-radius: 9px; transition: .15s ease; }
.nav-item:hover { background: #f5f8f4; color: var(--ink); }
.nav-item.active { color: var(--green-dark); background: var(--green-soft); font-weight: 680; }
.nav-icon { width: 20px; color: #66806c; text-align: center; font-size: 17px; line-height: 1; }
.sidebar-bottom { margin-top: auto; }
.signed-in { display: flex; align-items: center; gap: 10px; padding: 13px 10px 16px; border-top: 1px solid var(--line); }
.avatar { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: #ecf1e6; color: var(--green-dark); font-weight: 700; }
.signed-copy { min-width: 0; }
.signed-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.signed-copy small { font-size: 11px; color: var(--muted); margin-top: 2px; }
.logout-button { border-top: 1px solid #f3f4f1; border-radius: 0 0 8px 8px; }
.main-area { min-height: 100vh; margin-left: 252px; }
.topbar { height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 42px; background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line); }
.topbar-copy { display: grid; gap: 4px; }
.top-title { font-size: 17px; font-weight: 680; letter-spacing: -.3px; }
.top-actions { display: flex; align-items: center; gap: 18px; }
.secure-pill { display: flex; align-items: center; gap: 7px; color: #748077; font-size: 11px; }
.secure-dot { width: 7px; height: 7px; border-radius: 50%; background: #51a56f; box-shadow: 0 0 0 3px #e7f2e9; }
.page-wrap { max-width: 1440px; margin: 0 auto; padding: 35px 42px 60px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 24px; }
.page-heading h1 { margin: 0; font-size: clamp(24px, 3vw, 30px); letter-spacing: -.8px; font-weight: 690; }
.page-heading p { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.heading-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 0 14px; border: 1px solid #dfe5df; border-radius: 8px; background: #fff; color: #46524a; text-decoration: none; font-weight: 620; font-size: 12px; transition: .15s ease; white-space: nowrap; }
.button:hover { border-color: #c5d3c7; box-shadow: 0 3px 10px rgba(31,65,41,.07); }
.button-primary { border-color: var(--green); background: var(--green); color: #fff; }
.button-primary:hover { border-color: var(--green-dark); background: var(--green-dark); }
.button-small { min-height: 31px; padding: 0 10px; font-size: 11px; }
.button-quiet { border-color: transparent; background: transparent; color: #6d786f; }
.button-danger { color: var(--red); }
.icon-button { width: 37px; height: 37px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; color: #566258; background: #fff; }
.mobile-menu { display: none; }
.stats-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card, .panel { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 4px 16px rgba(44,62,45,.025); }
.stat-card { padding: 18px 19px; min-height: 111px; }
.stat-label { color: #768078; font-size: 11px; font-weight: 600; }
.stat-value { font-size: 27px; line-height: 1; font-weight: 690; letter-spacing: -.8px; margin-top: 15px; }
.stat-foot { margin-top: 8px; font-size: 10px; color: #879087; }
.panel { overflow: hidden; }
.panel + .panel { margin-top: 18px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 20px; border-bottom: 1px solid #edf0eb; }
.panel-title { margin: 0; font-size: 14px; font-weight: 680; }
.panel-subtitle { color: var(--muted); margin-top: 5px; font-size: 11px; }
.panel-body { padding: 18px 20px; }
.quick-actions { display: grid; gap: 10px; justify-items: start; }
.quick-actions .notice { width: 100%; margin-top: 7px; }
.table-wrap { min-width: 0; max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; min-width: 620px; }
th { color: #8a938b; font-size: 9px; text-transform: uppercase; letter-spacing: .09em; font-weight: 720; text-align: left; padding: 11px 14px; border-bottom: 1px solid #edf0eb; background: #fbfcfa; white-space: nowrap; }
td { padding: 13px 14px; border-bottom: 1px solid #f0f2ee; color: #49544c; vertical-align: middle; font-size: 12px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fcfdfa; }
.table-name { color: #27342b; font-weight: 620; }
.table-note { max-width: 280px; color: #8a938b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.table-actions { display: flex; justify-content: flex-end; gap: 4px; white-space: nowrap; }
.table-actions .button { min-height: 29px; }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 20px; color: #52755c; background: #eff5ee; font-size: 10px; font-weight: 650; white-space: nowrap; }
.tag-muted { color: #7d857f; background: #f1f2ef; }
.tag-amber { color: var(--amber); background: #fbf3e1; }
.filters { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; }
.field { display: grid; gap: 6px; min-width: 0; }
.field label { color: #606b62; font-size: 11px; font-weight: 620; }
.field input, .field select, .field textarea { width: 100%; min-height: 39px; border: 1px solid #dfe5df; border-radius: 7px; background: #fff; padding: 9px 11px; color: var(--ink); outline: none; }
.field textarea { min-height: 82px; resize: vertical; }
.checkbox-row { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border: 1px solid #e3eae0; border-radius: 8px; background: #f8faf7; cursor: pointer; }
.checkbox-row input { margin: 2px 0 0; accent-color: var(--green); }
.checkbox-row strong, .checkbox-row small { display: block; }
.checkbox-row strong { color: #455148; font-size: 11px; }
.checkbox-row small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.field input:disabled { background: #f2f4f1; color: #939b94; }
.notice.under-heading { margin-bottom: 16px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #70a287; box-shadow: 0 0 0 3px rgba(66,139,96,.12); }
.filter-field { min-width: 130px; }
.filter-field.wide { min-width: 190px; }
.empty-state { padding: 42px 20px; text-align: center; color: #808981; }
.empty-icon { font-size: 27px; color: #9aab9d; }
.empty-state strong { display: block; margin-top: 10px; color: #455148; font-size: 13px; }
.empty-state p { margin: 6px 0 14px; font-size: 11px; }
.notice { padding: 12px 14px; border: 1px solid #e3e9df; border-radius: 8px; background: #f7faf5; color: #6a756c; font-size: 11px; line-height: 1.5; }
.notice + .notice { margin-top: 10px; }
.two-column { display: grid; grid-template-columns: minmax(0,1.25fr) minmax(0,.75fr); gap: 18px; }
.two-column > * { min-width: 0; }
.select-inline { min-width: 126px; min-height: 35px; padding: 0 9px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.annual-summary { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: 16px; }
.annual-summary .stat-card { min-height: 92px; padding: 15px 16px; }
.annual-summary .stat-value { font-size: 21px; margin-top: 12px; }
.month-name { text-transform: capitalize; }
.balance-positive { color: var(--green-dark); font-weight: 680; }
.balance-negative { color: var(--red); font-weight: 680; }
.modal-backdrop { position: fixed; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(20,31,23,.42); z-index: 20; animation: fadein .12s ease; }
.modal { width: min(100%, 520px); max-height: min(90vh, 780px); overflow: auto; border-radius: 13px; background: #fff; box-shadow: 0 25px 90px rgba(17,31,21,.23); }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 20px 22px 16px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 18px; letter-spacing: -.3px; }
.modal-head p { margin: 6px 0 0; color: var(--muted); font-size: 11px; }
.modal-close { border: 0; background: transparent; color: #758078; font-size: 22px; line-height: 1; }
.modal-form { display: grid; gap: 14px; padding: 20px 22px 22px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.form-grid .full { grid-column: 1 / -1; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 7px; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 14px); padding: 11px 16px; color: #fff; background: #27382c; border-radius: 8px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: .18s ease; z-index: 40; font-size: 12px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 22px; background: radial-gradient(ellipse at 52% 20%, #eaf3e8 0, #f5f7f3 51%, #eff3ec 100%); }
.auth-card { width: min(100%, 430px); padding: 34px; border: 1px solid #e6ebe4; border-radius: 16px; background: #fff; box-shadow: 0 22px 75px rgba(39,65,42,.1); }
.auth-brand { display: flex; gap: 11px; align-items: center; }
.auth-brand .brand-mark { width: 42px; height: 42px; }
.auth-brand strong, .auth-brand small { display: block; }
.auth-brand strong { font-size: 14px; }
.auth-brand small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.auth-card h1 { margin: 29px 0 7px; font-size: 26px; letter-spacing: -.7px; }
.auth-lead { color: #727d74; line-height: 1.55; font-size: 12px; margin: 0 0 21px; }
.auth-form { display: grid; gap: 13px; }
.auth-error { min-height: 17px; color: var(--red); font-size: 11px; }
.auth-form .button { min-height: 42px; width: 100%; }
.auth-foot { border-top: 1px solid var(--line); padding-top: 15px; margin-top: 20px; color: #89918a; font-size: 10px; line-height: 1.55; }
.auth-secondary { margin-top: 12px; }
.auth-small { color: #778078; font-size: 11px; line-height: 1.5; margin: -2px 0 0; }
.passkey-list { display: grid; gap: 8px; margin-top: 18px; }
.passkey-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 10px; background: #f7f9f6; border-radius: 7px; font-size: 11px; }
.passkey-row strong, .passkey-row small { display: block; }
.passkey-row small { margin-top: 4px; }
.muted { color: var(--muted); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.spacer { height: 18px; }
.print-only { display: none; }
.user-table { min-width: 1180px; }
.user-table td { vertical-align: top; }
.user-permissions { display: flex; flex-wrap: wrap; gap: 6px; max-width: 370px; }
.user-permission { display: inline-flex; align-items: center; gap: 5px; padding: 5px 7px; border: 1px solid #e2e9e2; border-radius: 7px; background: #fbfcfa; color: #58635b; font-size: 10px; white-space: nowrap; cursor: pointer; }
.user-permission input { margin: 0; accent-color: var(--green); }
.user-no-users { width: 100%; font-size: 10px; }
.user-table .button:disabled { cursor: not-allowed; opacity: .48; }
#guide-root { position: fixed; inset: 0; z-index: 100; pointer-events: none; }
.guide-shade { position: fixed; z-index: 100; background: rgba(16, 29, 20, .64); pointer-events: auto; }
.guide-shade-full { inset: 0; }
.guide-highlight { position: fixed; z-index: 101; border: 3px solid #74bd91; border-radius: 11px; box-shadow: 0 0 0 5px #fff, 0 8px 26px rgba(17,39,24,.32); pointer-events: none; transition: top .12s ease, left .12s ease, width .12s ease, height .12s ease; }
.guide-pointer { position: fixed; z-index: 104; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--green); color: #fff; box-shadow: 0 5px 15px rgba(17,39,24,.3); font-size: 23px; font-weight: 750; line-height: 1; pointer-events: none; }
.guide-dialog { position: fixed; z-index: 102; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(480px, calc(100vw - 32px)); max-height: min(82dvh, 700px); overflow: auto; border: 1px solid #dfe9df; border-radius: 15px; background: #fff; box-shadow: 0 24px 80px rgba(17,31,21,.4); pointer-events: auto; }
.guide-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 22px 15px; }
.guide-eyebrow { margin: 0 0 7px; color: var(--green-dark); font-size: 10px; font-weight: 750; letter-spacing: .12em; }
.guide-header h2 { margin: 0; font-size: 19px; letter-spacing: -.3px; }
.guide-close { display: grid; place-items: center; flex: 0 0 auto; width: 34px; height: 34px; border: 0; border-radius: 8px; background: transparent; color: #68756b; font-size: 24px; line-height: 1; }
.guide-close:hover { background: var(--green-soft); color: var(--green-dark); }
.guide-progress { height: 4px; background: #edf2ec; }
.guide-progress span { display: block; height: 100%; background: linear-gradient(90deg, #77b989, var(--green)); transition: width .2s ease; }
.guide-body { display: flex; align-items: flex-start; gap: 14px; padding: 22px; }
.guide-icon { display: grid; place-items: center; flex: 0 0 auto; width: 42px; height: 42px; border-radius: 12px; background: var(--green-soft); color: var(--green-dark); font-size: 21px; font-weight: 750; }
.guide-body p { margin: 0; color: #59655c; font-size: 13px; line-height: 1.65; }
.guide-label { display: inline-flex; margin-top: 13px; padding: 5px 9px; border-radius: 6px; background: var(--green-soft); color: var(--green-dark); font-size: 10px; font-weight: 700; }
.guide-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 20px; border-top: 1px solid var(--line); background: #f8faf7; }
.guide-skip { padding: 8px 0; border: 0; background: transparent; color: #67736a; font-size: 11px; font-weight: 620; }
.guide-skip:hover { color: var(--green-dark); }
.guide-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.guide-actions .button { min-height: 36px; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 1100px) {
  .sidebar { width: 220px; }
  .main-area { margin-left: 220px; }
  .topbar { padding: 0 27px; }
  .page-wrap { padding: 30px 27px 50px; }
  .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 760px) {
  .sidebar { width: 260px; transform: translateX(-100%); transition: transform .2s ease; box-shadow: none; }
  .sidebar.open { transform: translateX(0); box-shadow: 10px 0 35px rgba(22,38,25,.14); }
  .main-area { margin-left: 0; }
  .topbar { height: 66px; padding: 0 15px; gap: 10px; }
  .mobile-menu { display: grid; flex: 0 0 auto; }
  .topbar-copy { margin-right: auto; }
  .topbar-copy .eyebrow, .secure-pill { display: none; }
  .top-title { font-size: 14px; }
  .top-actions { gap: 0; }
  .top-actions .button { min-height: 35px; padding: 0 10px; font-size: 11px; }
  .page-wrap { padding: 23px 15px 40px; }
  .page-heading { align-items: flex-start; flex-direction: column; margin-bottom: 18px; }
  .page-heading h1 { font-size: 25px; }
  .heading-actions { width: 100%; }
  .stats-grid { gap: 9px; margin-bottom: 12px; }
  .stat-card { min-height: 98px; padding: 14px; }
  .stat-value { font-size: 23px; margin-top: 13px; }
  .panel-head { padding: 14px; }
  .panel-body { padding: 14px; }
  .two-column { grid-template-columns: minmax(0,1fr); }
  .annual-summary { grid-template-columns: repeat(2,1fr); gap: 9px; }
  .annual-summary .stat-card { min-height: 83px; padding: 12px; }
  .annual-summary .stat-value { font-size: 19px; }
}
@media (max-width: 430px) {
  .brand { padding-bottom: 25px; }
  .top-actions .button { max-width: 42px; overflow: hidden; font-size: 0; gap: 0; padding: 0; }
  .top-actions .button::first-letter { font-size: 18px; }
  .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .auth-card { padding: 25px 21px; }
  .modal-backdrop { padding: 12px; }
  .modal-head { padding: 18px 16px 14px; }
  .modal-form { padding: 16px; }
  .modal-actions { flex-wrap: wrap; }
  .modal-actions .button { flex: 1 1 auto; }
  .guide-header { padding: 18px 16px 13px; }
  .guide-body { padding: 18px 16px; gap: 11px; }
  .guide-footer { padding: 12px 16px; align-items: stretch; flex-wrap: wrap; }
  .guide-skip { margin-right: auto; }
  .guide-actions { gap: 6px; }
  .guide-actions .button { padding: 0 10px; font-size: 11px; }
}
@media print {
  body { background: #fff; }
  .sidebar, .topbar, .page-heading .heading-actions, .panel-actions, .filters, .table-actions, #modal-root, .toast { display: none !important; }
  .main-area { margin: 0; }
  .page-wrap { max-width: none; padding: 0; }
  .panel, .stat-card { box-shadow: none; break-inside: avoid; }
  .print-only { display: block; }
}
