@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  color-scheme: light;
  --paper: #f5f6f2;
  --white: #ffffff;
  --ink: #14211c;
  --muted: #77817a;
  --line: #e6e9e2;
  --green: #174d3d;
  --green-dark: #123e32;
  --green-soft: #edf4ee;
  --lime: #d5f36a;
  --amber: #d8e59a;
  --danger: #b3483f;
  --shadow: 0 18px 60px rgba(20, 33, 28, .14);
  font-family: 'DM Sans', sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { min-width: 320px; margin: 0; background: var(--paper); color: var(--ink); font-size: 14px; }
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid rgba(88, 145, 106, .44); outline-offset: 3px; }
button:disabled { cursor: not-allowed; opacity: .5; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 3; display: flex; width: 236px; flex-direction: column; padding: 30px 18px 20px; background: var(--green-dark); color: #f7f8f2; }
.brand { display: flex; align-items: center; gap: 11px; margin: 0 4px 57px; color: inherit; text-decoration: none; }
.brand-mark { width: 39px; height: 39px; }
.brand-copy { display: flex; flex-direction: column; gap: 1px; }
.brand-copy strong { font: 800 22px/.98 'Manrope', sans-serif; letter-spacing: -.08em; }
.brand-copy small { color: #bac9bd; font-size: 8px; font-weight: 600; letter-spacing: .19em; }
.nav-caption { margin: 0 12px 13px; color: #8ba696; font-size: 9px; font-weight: 700; letter-spacing: .16em; }
.side-nav { display: grid; gap: 6px; }
.nav-link { position: relative; display: flex; min-height: 45px; align-items: center; gap: 13px; padding: 0 12px; border-radius: 7px; color: #c1d0c6; font-size: 12px; font-weight: 500; text-decoration: none; transition: background .18s ease, color .18s ease; }
.nav-link svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; }
.nav-link:hover, .nav-link[aria-current="page"] { background: rgba(255,255,255,.095); color: #fff; }
.nav-link[aria-current="page"]::before { position: absolute; left: -18px; width: 3px; height: 23px; border-radius: 0 3px 3px 0; background: var(--lime); content: ''; }
.sidebar-note { display: flex; align-items: flex-start; gap: 9px; margin: auto 4px 18px; padding: 14px 12px; border: 1px solid rgba(220,239,221,.13); border-radius: 8px; background: rgba(255,255,255,.045); }
.sidebar-note p { margin: 0; color: #bed0c2; font-size: 10px; line-height: 1.55; }
.note-dot, .live-indicator { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--lime); }
.note-dot { margin-top: 4px; box-shadow: 0 0 0 3px rgba(213,243,106,.12); }
.sidebar-foot { margin: 0 12px; color: #88a091; font-size: 8px; font-weight: 600; letter-spacing: .14em; }
.sidebar-foot span { margin: 0 4px; color: var(--lime); }

.main-content { width: min(1260px, calc(100% - 236px)); margin-left: 236px; padding: 0 50px 28px; }
.topbar { display: flex; min-height: 66px; align-items: center; justify-content: space-between; border-bottom: 1px solid #e6e9e3; }
.breadcrumb { display: flex; align-items: center; gap: 10px; color: #98a098; font-size: 9px; font-weight: 700; letter-spacing: .13em; }
.breadcrumb span:last-child { color: #4c5b50; }
.breadcrumb-slash { color: #bbc2ba; }
.topbar-right { display: flex; align-items: center; gap: 8px; color: #6f7b72; font-size: 9px; font-weight: 700; letter-spacing: .12em; }
.live-indicator { width: 6px; height: 6px; background: #7eaf69; box-shadow: 0 0 0 3px #e2eedb; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; padding: 45px 0 27px; }
.eyebrow { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; color: #829084; font-size: 9px; font-weight: 700; letter-spacing: .14em; }
.eyebrow-rule { width: 18px; height: 2px; background: #a9c45c; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin: 0; font: 700 clamp(30px, 3.1vw, 42px)/1.15 'Manrope', sans-serif; letter-spacing: -.055em; }
.heading-period { color: #9bb64c; }
.page-subtitle { margin: 8px 0 0; color: #7c867d; font-size: 12px; }
.date-control { width: 194px; }
.date-control label, .field-label { display: block; margin-bottom: 7px; color: #89948b; font-size: 8px; font-weight: 700; letter-spacing: .14em; }
.date-input-wrap { position: relative; }
.date-input-wrap svg { position: absolute; top: 50%; left: 12px; width: 15px; height: 15px; transform: translateY(-50%); fill: none; stroke: #68766c; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; pointer-events: none; }
.date-input-wrap input { width: 100%; height: 39px; padding: 0 10px 0 36px; border: 1px solid #dfe4dc; border-radius: 6px; background: #fff; color: #39483d; font-size: 11px; }

.summary-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 14px; margin-bottom: 24px; }
.summary-card { position: relative; min-height: 143px; overflow: hidden; padding: 18px 20px 16px; border: 1px solid #e5e9e2; border-radius: 9px; background: var(--white); }
.summary-primary { border-color: var(--green); background: var(--green); color: #f8faf4; }
.summary-topline { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; color: #8a958b; font-size: 8px; font-weight: 700; letter-spacing: .13em; }
.summary-primary .summary-topline { color: #ccdbcf; }
.summary-icon { display: grid; width: 24px; height: 24px; place-items: center; border-radius: 50%; background: rgba(213,243,106,.15); color: var(--lime); font-size: 14px; }
.summary-icon-light { background: #f0f3ee; color: #768477; }
.summary-value { position: relative; z-index: 1; margin-top: 15px; font: 700 30px/1 'Manrope', sans-serif; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.summary-primary .summary-value { color: #fbfff5; }
.summary-foot { position: relative; z-index: 1; display: flex; align-items: center; gap: 8px; margin-top: 12px; color: #aab8ad; font-size: 10px; }
.summary-light .summary-foot { color: #768178; }
.status-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--lime); }
.summary-unit { color: #9ba69b; }
.summary-primary .summary-unit { color: #b4c6b8; }
.summary-watermark { position: absolute; right: 21px; bottom: -48px; color: rgba(255,255,255,.045); font: 800 150px/.9 'Manrope', sans-serif; letter-spacing: -.1em; pointer-events: none; }

.panel { margin-bottom: 20px; border: 1px solid #e5e9e2; border-radius: 9px; background: var(--white); }
.panel-heading { display: flex; min-height: 107px; align-items: center; justify-content: space-between; gap: 18px; padding: 22px 24px 19px; }
.panel-eyebrow { margin-bottom: 6px; font-size: 8px; }
h2 { margin: 0; font: 700 19px/1.3 'Manrope', sans-serif; letter-spacing: -.035em; }
.panel-description { margin: 4px 0 0; color: #879187; font-size: 10px; }
.button { display: inline-flex; min-height: 38px; align-items: center; justify-content: center; gap: 9px; padding: 0 14px; border: 1px solid transparent; border-radius: 5px; font-size: 10px; font-weight: 700; transition: transform .15s ease, background .18s ease, border-color .18s ease; }
.button:active { transform: translateY(1px); }
.button svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.button-primary { background: var(--green); color: #fff; }
.button-primary:hover { background: var(--green-dark); }
.button-primary svg { color: var(--lime); }
.button-secondary { border-color: #e2e7df; background: #fff; color: #4f5d52; }
.button-secondary:hover, .button-outline:hover { border-color: #a9bd9c; background: #f5f8f3; }
.button-outline { border-color: #dfe5dc; background: #fff; color: #46554a; }
.button-outline svg { width: 13px; }

.table-wrap { position: relative; min-height: 105px; }
table { width: 100%; border-collapse: collapse; text-align: left; }
.sales-table thead, .monthly-table thead, .expense-table thead { border-top: 1px solid #edf0eb; border-bottom: 1px solid #edf0eb; background: #fbfcfa; }
th { height: 37px; color: #98a199; font-size: 8px; font-weight: 700; letter-spacing: .12em; }
.sales-table th:first-child, .sales-table td:first-child { padding-left: 24px; }
.sales-table th:last-child, .sales-table td:last-child { padding-right: 22px; }
.sales-table th:nth-child(2), .sales-table td:nth-child(2) { width: 11%; }
.sales-table th:nth-child(3), .sales-table td:nth-child(3) { width: 18%; }
.sales-table th:nth-child(4), .sales-table td:nth-child(4) { width: 19%; }
.sales-table th:last-child { width: 91px; }
.sales-table td { height: 59px; border-bottom: 1px solid #f0f2ef; color: #59655c; font-size: 11px; font-variant-numeric: tabular-nums; }
.sales-table tbody tr:last-child td { border-bottom: 0; }
.product-cell { display: flex; align-items: center; gap: 11px; }
.product-icon { display: grid; width: 30px; height: 30px; flex: 0 0 auto; place-items: center; border-radius: 7px; background: #eef3e9; color: #678250; font: 700 11px 'Manrope', sans-serif; }
.product-info { min-width: 0; }
.product-name { overflow: hidden; max-width: 260px; color: #2e3d32; font-size: 11px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.product-sub { margin-top: 3px; color: #a2aaa2; font-size: 8px; }
.amount-cell { color: #2d4735 !important; font-weight: 700; }
.row-actions { display: flex; justify-content: flex-end; gap: 4px; }
.icon-button { display: grid; width: 29px; height: 29px; place-items: center; border: 1px solid transparent; border-radius: 5px; background: transparent; color: #9aa39a; transition: .16s ease; }
.icon-button svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; }
.icon-button:hover { border-color: #e3e8df; background: #f8faf6; color: #426c4e; }
.icon-button.delete:hover { border-color: #f0dfdc; background: #fff8f7; color: var(--danger); }
.table-footer { display: flex; justify-content: space-between; padding: 12px 24px; border-top: 1px solid #edf0eb; color: #9aa39b; font-size: 9px; }
.table-footer span:first-child { color: #707d73; font-weight: 600; }
.empty-state { display: flex; min-height: 238px; flex-direction: column; align-items: center; justify-content: center; padding: 26px 15px; text-align: center; }
.empty-mark { display: grid; width: 43px; height: 43px; place-items: center; margin-bottom: 13px; border-radius: 12px; background: #f1f5ee; color: #66864e; }
.empty-mark svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.5; }
.empty-state h3 { margin: 0 0 5px; font: 700 13px 'Manrope', sans-serif; }
.empty-state p { margin: 0 0 14px; color: #89938b; font-size: 10px; }
.empty-state .button { min-height: 32px; }
.empty-state .button span { color: #6c8c4e; font-size: 15px; }

.monthly-panel { margin-top: 0; }
.monthly-heading { min-height: 101px; }
.export-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; }
.export-actions .button { white-space: nowrap; }
.expenses-panel { margin-top: 0; }
.expense-heading { min-height: 101px; }
.expense-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; }
.expense-actions .button { white-space: nowrap; }
.expense-table-wrap { overflow-x: auto; }
.expense-table th:first-child, .expense-table td:first-child { width: 21%; padding-left: 24px; }
.expense-table th:nth-child(2), .expense-table td:nth-child(2) { width: 49%; }
.expense-table th:nth-child(3), .expense-table td:nth-child(3) { width: 18%; text-align: right; }
.expense-table th:last-child, .expense-table td:last-child { width: 112px; padding-right: 22px; }
.expense-table th { height: 37px; }
.expense-table td { height: 53px; border-bottom: 1px solid #f0f2ef; color: #59655c; font-size: 11px; font-variant-numeric: tabular-nums; }
.expense-table tbody tr:last-child td { border-bottom: 0; }
.expense-date { color: #748076 !important; white-space: nowrap; }
.expense-name { color: #35463a !important; font-weight: 600; }
.expense-amount { color: #304936 !important; text-align: right; font-weight: 700; white-space: nowrap; }
.expense-empty { min-height: 190px; }
.expense-footer strong { margin-left: 7px; color: #304936; font-variant-numeric: tabular-nums; }
.monthly-table th:first-child, .monthly-table td:first-child { padding-left: 24px; }
.monthly-table th:last-child, .monthly-table td:last-child { padding-right: 24px; }
.monthly-table th { height: 35px; }
.monthly-table td { height: 43px; border-bottom: 1px solid #f0f2ef; color: #657167; font-size: 10px; font-variant-numeric: tabular-nums; }
.monthly-table tbody tr:last-child td { border-bottom: 0; }
.monthly-table th:nth-child(2), .monthly-table td:nth-child(2), .monthly-table th:nth-child(3), .monthly-table td:nth-child(3) { text-align: center; }
.monthly-name { display: flex; align-items: center; gap: 10px; color: #425047; font-weight: 600; }
.month-indicator { width: 6px; height: 6px; border-radius: 2px; background: #b9ce8d; }
.monthly-current .month-indicator { background: #739252; }
.monthly-amount { color: #304936 !important; text-align: right; font-weight: 700; }
.report-note { display: flex; align-items: center; gap: 7px; margin: 0; padding: 12px 24px 14px; border-top: 1px solid #edf0eb; color: #98a199; font-size: 9px; }
.report-note-mark { display: grid; width: 13px; height: 13px; flex: 0 0 auto; place-items: center; border: 1px solid #c4cec2; border-radius: 50%; color: #7f8e80; font: 600 8px Georgia, serif; }
.page-footer { display: flex; justify-content: space-between; padding: 7px 1px; color: #9da69d; font-size: 8px; font-weight: 600; letter-spacing: .1em; }
.footer-divider { margin: 0 5px; color: #bdc6bb; }

.entry-dialog { width: min(440px, calc(100% - 28px)); max-width: none; max-height: min(92vh, 740px); padding: 26px 29px 24px; overflow: auto; border: 1px solid #e3e9e0; border-radius: 10px; background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.entry-dialog::backdrop { background: rgba(15, 31, 23, .46); backdrop-filter: blur(2px); }
.dialog-topline { display: flex; align-items: center; justify-content: space-between; }
.dialog-topline .eyebrow { margin: 0; }
.dialog-close { display: grid; width: 29px; height: 29px; place-items: center; border: 1px solid #edf0eb; border-radius: 50%; background: white; color: #718075; font-size: 20px; line-height: 1; }
.dialog-close:hover { background: #f5f7f3; }
.entry-dialog h2 { margin-top: 21px; font-size: 25px; }
.dialog-description { margin: 5px 0 20px; color: #89938b; font-size: 10px; }
.form-input { width: 100%; height: 41px; margin-bottom: 15px; padding: 0 11px; border: 1px solid #e0e5dd; border-radius: 5px; background: #fff; color: #334138; font-size: 11px; }
.form-input::placeholder { color: #b3bbb2; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.calculation-preview { display: flex; align-items: center; justify-content: space-between; margin: 0 0 18px; padding: 12px 14px; border: 1px solid #e7ede1; border-radius: 6px; background: #f6f8f2; }
.calculation-preview span { color: #829080; font-size: 8px; font-weight: 700; letter-spacing: .13em; }
.calculation-preview strong { color: #31543a; font: 700 16px 'Manrope', sans-serif; font-variant-numeric: tabular-nums; }
.form-error { margin: -7px 0 13px; color: var(--danger); font-size: 10px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 2px; }
.dialog-actions .button { min-width: 82px; }
.dialog-actions .button-primary { min-width: 119px; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 10; max-width: min(360px, calc(100% - 32px)); padding: 12px 16px; transform: translateY(14px); border-radius: 6px; background: #1e3f31; color: #fff; font-size: 11px; opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; box-shadow: 0 10px 24px rgba(0,0,0,.15); }
.toast.is-visible { transform: translateY(0); opacity: 1; }

@media (min-width: 1450px) { .main-content { margin-right: auto; margin-left: calc(236px + max(0px, (100vw - 1450px) / 2)); } }
@media (max-width: 1050px) { .sidebar { width: 205px; } .main-content { width: calc(100% - 205px); margin-left: 205px; padding-right: 30px; padding-left: 30px; } .summary-grid { grid-template-columns: 1.25fr 1fr 1fr; gap: 10px; } .summary-card { padding-right: 15px; padding-left: 15px; } }
@media (max-width: 760px) { .sidebar { position: static; width: auto; height: 62px; flex-direction: row; align-items: center; padding: 0 18px; } .brand { margin: 0 auto 0 0; } .brand-mark { width: 32px; height: 32px; } .brand-copy strong { font-size: 19px; } .brand-copy small { font-size: 7px; } .nav-caption, .sidebar-note, .sidebar-foot { display: none; } .side-nav { display: flex; gap: 3px; } .nav-link { min-height: 36px; gap: 7px; padding: 0 9px; font-size: 10px; } .nav-link svg { width: 15px; height: 15px; } .nav-link[aria-current="page"]::before { inset: auto 10px -13px; width: auto; height: 2px; border-radius: 2px; } .main-content { width: 100%; margin: 0; padding: 0 22px 24px; } .topbar { min-height: 51px; } .page-heading { padding-top: 32px; } .monthly-heading, .expense-heading { flex-wrap: wrap; } .export-actions, .expense-actions { margin-left: auto; } }
@media (max-width: 560px) { .sidebar { height: auto; min-height: 58px; padding: 10px 14px; flex-wrap: wrap; row-gap: 9px; } .brand { margin-right: auto; } .side-nav { width: 100%; justify-content: space-between; } .nav-link { flex: 1; justify-content: center; } .nav-link[aria-current="page"]::before { bottom: -8px; } .main-content { padding-right: 14px; padding-left: 14px; } .topbar-right { font-size: 8px; } .page-heading { align-items: flex-start; flex-direction: column; gap: 17px; padding: 29px 0 19px; } h1 { font-size: 32px; } .date-control { width: 100%; } .summary-grid { grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 15px; } .summary-card { min-height: 119px; padding: 14px 13px 12px; } .summary-primary { grid-column: span 2; min-height: 129px; } .summary-value { margin-top: 13px; font-size: 25px; } .summary-foot { flex-wrap: wrap; gap: 5px 7px; margin-top: 9px; font-size: 9px; } .panel { margin-bottom: 14px; } .panel-heading { align-items: flex-start; padding: 18px 15px 15px; } .panel-heading .button { min-height: 34px; gap: 6px; padding: 0 9px; font-size: 9px; } .panel-heading .button svg { width: 12px; } h2 { font-size: 17px; } .panel-description { max-width: 255px; font-size: 9px; } .sales-table { min-width: 530px; } .table-wrap { overflow-x: auto; } .sales-table th:first-child, .sales-table td:first-child { padding-left: 14px; } .sales-table th:last-child, .sales-table td:last-child { padding-right: 12px; } .table-footer { padding: 11px 14px; font-size: 8px; } .monthly-table { min-width: 430px; } .monthly-table th:first-child, .monthly-table td:first-child { padding-left: 14px; } .monthly-table th:last-child, .monthly-table td:last-child { padding-right: 14px; } .monthly-table-wrap { overflow-x: auto; } .report-note { align-items: flex-start; padding: 11px 14px; font-size: 8px; line-height: 1.5; } .page-footer { font-size: 7px; } .entry-dialog { padding: 22px 20px 20px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; } }
@media (max-width: 560px) { .expense-table { min-width: 520px; } .expense-table th:first-child, .expense-table td:first-child { padding-left: 14px; } .expense-table th:last-child, .expense-table td:last-child { padding-right: 12px; } .expense-actions { width: 100%; justify-content: flex-end; } .expense-actions .button { min-height: 34px; gap: 6px; padding: 0 9px; font-size: 9px; } .expense-actions .button svg { width: 12px; } .expense-footer { padding: 11px 14px; font-size: 8px; } }
