:root {
  color-scheme: light;
  font-family: 'Segoe UI', Arial, sans-serif;
  color: #172720;
  background: #f5f7f3;
  --ink: #172720;
  --muted: #5a695e;
  --muted-dark: #a9bdb4;
  --line: #e0e7dd;
  --green: #285b46;
  --deep: #142c26;
  --lime: #bbef86;
  --white: #fff;
  --radius: 16px;
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button { color: inherit; }
button:disabled, select:disabled { cursor: default; opacity: .55; }
button:focus-visible, select:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid #4c9872; outline-offset: 3px; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
svg { flex: 0 0 auto; }

.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100dvh; }
.sidebar { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; padding: 29px 17px 18px; background: var(--deep); color: #eff7ee; z-index: 3; }
.brand { display: flex; align-items: center; gap: 11px; }
.sidebar .brand { padding-inline: 9px; margin-bottom: 44px; }
.brand img { display: block; }
.brand strong, .brand span { display: block; }
.brand strong { font-size: 22px; line-height: 1; letter-spacing: -.045em; }
.brand span { margin-top: 5px; color: var(--muted-dark); font-size: .78rem; }
.sidebar nav { display: grid; gap: 4px; }
.nav-caption { color: var(--muted-dark); font-size: .78rem; font-weight: 600; margin: 0 10px 7px; }
.nav-caption.divided { margin-top: 21px; }
.nav-link { color: #d5e4db; text-decoration: none; border-radius: 9px; padding: 11px 10px; display: flex; align-items: center; gap: 11px; font-size: .9rem; font-weight: 600; }
.nav-link:hover { background: #244137; }
.nav-link.active { background: var(--lime); color: #1c3828; }
.sidebar-profile { margin-top: auto; padding: 17px 2px 1px; border-top: 1px solid #3a4f46; display: flex; gap: 9px; align-items: center; }
.avatar { background: #cee4be; color: #2e553f; border-radius: 50%; flex: 0 0 auto; height: 36px; width: 36px; display: grid; place-items: center; font-size: .76rem; font-weight: 750; }
.avatar.small { width: 31px; height: 31px; }
.profile-text { min-width: 0; flex: 1; }
.profile-text strong, .profile-text span { display: block; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
.profile-text strong { font-size: .86rem; }
.profile-text span { font-size: .75rem; color: var(--muted-dark); margin-top: 3px; }
.icon-button { display: inline-grid; place-items: center; border: 0; background: transparent; border-radius: 7px; width: 34px; height: 34px; color: var(--muted); padding: 0; }
.icon-button:hover { background: #edf2ea; color: var(--ink); }
.sidebar .logout { color: #c0d5c7; width: 30px; }
.sidebar .logout:hover { background: #2a483b; color: white; }
.mobile-toggle, .mobile-scrim { display: none; }

.workspace { min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 70px; gap: 12px; padding: 12px clamp(22px, 3.35vw, 51px); border-bottom: 1px solid #e1e8df; background: #fcfdfb; }
.topbar-start { display: flex; align-items: center; gap: 12px; font-size: .89rem; font-weight: 650; }
.location-control { display: flex; align-items: center; gap: 8px; font-size: .88rem; font-weight: 650; min-height: 38px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; color: #334b3d; background: white; min-width: 0; }
.location-control select { border: 0; background-color: transparent; max-width: min(40vw, 230px); min-height: 36px; padding: 0 23px 1px 0; }
.location-control span { padding-block: 6px; }
select { appearance: none; color: inherit; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='none' stroke='%2357665d' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='m6 8 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; background-size: 19px; }
.location-control select { background-position: right -3px center; }
.content { width: 100%; max-width: 1580px; margin-inline: auto; padding: 33px clamp(22px, 3.35vw, 51px) 50px; }
.page-title { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.page-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
h1 { font-size: clamp(2rem, 3vw, 2.72rem); line-height: 1.08; font-weight: 730; letter-spacing: -.05em; }
.page-title p { margin-top: 8px; color: var(--muted); font-size: .98rem; line-height: 1.5; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 9px; padding: 0 14px; min-height: 42px; font-weight: 650; font-size: .89rem; white-space: nowrap; text-decoration: none; }
.button.primary { background: var(--green); color: white; }
.button.primary:hover { background: #1e4735; }
.button.secondary { background: white; border-color: var(--line); color: #334b3d; }
.button.secondary:hover { background: #f2f6ef; }
.button.outline-danger { background: white; border-color: #ead8d3; color: #8a392c; }
.button.outline-danger:hover { background: #fff3ee; }
.button.danger { background: #9a4538; color: white; }
.button.danger:hover { background: #853a31; }
.plain { border: none; background: transparent; padding: 4px 0; color: #2b644c; font-weight: 650; font-size: .89rem; text-align: left; }
.plain:hover { text-decoration: underline; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.segments { display: flex; gap: 2px; background: #e9eee6; border-radius: 9px; padding: 3px; }
.segments button { border: 0; background: transparent; border-radius: 7px; padding: 7px 13px; min-height: 33px; font-size: .87rem; font-weight: 650; color: #526256; white-space: nowrap; }
.segments button:hover { color: var(--ink); }
.segments .selected { background: white; box-shadow: 0 1px 2px #263b2520; color: #244a35; }
.date-filter { min-height: 39px; }
.date-filter svg:last-child { color: var(--muted); }

.panel { min-width: 0; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 18px; }
.reports-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metric { padding: 16px 18px; min-height: 130px; display: flex; flex-direction: column; justify-content: center; }
.metric-head { display: flex; align-items: center; gap: 9px; font-size: .9rem; font-weight: 650; color: #43564a; }
.metric-icon, .payment-icon { display: grid; place-items: center; width: 34px; height: 34px; flex-shrink: 0; border-radius: 9px; background: #e6f1e5; color: #32684e; }
.metric-icon.ochre { background: #f6efdd; color: #83662f; }
.metric > strong { display: block; margin-top: 9px; font-size: clamp(1.45rem, 2.37vw, 2.1rem); line-height: 1.18; font-weight: 730; letter-spacing: -.05em; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.metric > strong small { font-size: .55em; letter-spacing: 0; color: var(--muted); font-weight: 650; }
.metric-note { margin-top: 6px; font-size: .78rem; line-height: 1.35; color: var(--muted); }
.charts { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(290px, 1fr); gap: 17px; margin-bottom: 18px; }
.chart-panel { min-width: 0; }
.section-head { padding: 18px 20px 14px; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.section-head h2, .point-card h2 { font-size: 1.13rem; line-height: 1.35; font-weight: 720; letter-spacing: -.018em; }
.section-head p { margin-top: 4px; color: var(--muted); font-size: .84rem; line-height: 1.42; }
.chart-key { font-size: .8rem; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; padding-top: 3px; white-space: nowrap; }
.chart-key::before { content: ''; width: 9px; height: 9px; background: #598e6d; border-radius: 50%; }
.chart-wrap { margin: 0 15px 11px 9px; }
.chart { width: 100%; display: block; min-height: 192px; }
.chart text { fill: #5d6d60; font-family: inherit; font-size: 13px; }
.gridline { stroke: #e8eee5; stroke-dasharray: 4 4; }
.plot-line { fill: none; stroke: #3d7c60; stroke-width: 2.8px; stroke-linecap: round; stroke-linejoin: round; }
.plot-dot { fill: white; stroke: #417f63; stroke-width: 2.4px; }
.payment-content { padding: 0 20px 16px; }
.donut { width: 124px; height: 124px; position: relative; margin: 0 auto 8px; }
.donut svg { display: block; width: 100%; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.donut-center strong { font-size: 1.55rem; line-height: 1; letter-spacing: -.04em; }
.donut-center span { font-size: .72rem; color: var(--muted); margin-top: 4px; }
.payment-legend { display: grid; gap: 6px; }
.payment-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; font-size: .85rem; line-height: 1.25; color: #405347; }
.payment-row strong { color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.payment-icon { width: 27px; height: 27px; border-radius: 7px; }
.payment-icon.cash_receipt { background: #edf4e0; color: #537039; }
.payment-icon.cash_no_receipt { background: #f7eedb; color: #876733; }

.table-panel { margin-bottom: 17px; }
.table-panel .section-head { align-items: center; min-height: 62px; }
.table-scroll { overflow: auto; border-radius: 0 0 var(--radius) var(--radius); }
table { border-collapse: collapse; width: 100%; text-align: left; font-size: .875rem; }
thead { background: #f6f8f4; color: #536458; }
th { font-weight: 630; white-space: nowrap; }
th, td { padding: 12px 14px; border-top: 1px solid #eaf0e7; }
th:first-child, td:first-child { padding-left: 20px; }
th:last-child, td:last-child { padding-right: 20px; }
td.num { white-space: nowrap; font-variant-numeric: tabular-nums; }
td strong { font-weight: 650; }
td .td-sub { display: block; color: var(--muted); font-size: .78rem; margin-top: 3px; }
.identity { display: flex; align-items: center; gap: 8px; }
.row-action { text-align: right; white-space: nowrap; }
.badge { display: inline-block; border-radius: 6px; padding: 4px 7px; font-size: .76rem; font-weight: 650; white-space: nowrap; }
.badge.positive { background: #e8f3e6; color: #39634c; }
.badge.neutral { background: #eff1ed; color: #546055; }
.badge.demo-badge { background: #f9edd4; color: #765b2c; }
.pagination { display: flex; justify-content: end; gap: 10px; align-items: center; padding: 12px 20px; border-top: 1px solid var(--line); font-size: .85rem; color: var(--muted); }
.pagination .button { min-height: 34px; }
.empty { padding: 34px 20px 38px; display: grid; place-items: center; text-align: center; border-top: 1px solid #edf1ea; gap: 7px; }
.empty-icon, .point-icon { display: grid; place-items: center; width: 43px; height: 43px; border-radius: 12px; color: #37664d; background: #eaf2e8; margin-bottom: 4px; }
.empty p { color: var(--muted); font-size: .88rem; }
.table-controls > div:last-child { display: flex; gap: 8px; align-items: center; }
.search-control { display: flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); padding: 0 9px; }
.search-control input { border: 0; width: 145px; min-width: 0; min-height: 39px; background: transparent; font-size: .86rem; color: var(--ink); }
.point-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 16px; }
.point-card { padding: 19px; display: flex; flex-direction: column; min-height: 158px; }
.point-card h2 { margin-top: 6px; }
.point-card p { color: var(--muted); font-size: .88rem; margin: 5px 0 11px; }
.point-bottom { margin-top: auto; padding-top: 10px; display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--muted); font-size: .85rem; }
.point-bottom span { display: flex; align-items: center; gap: 5px; }

.modal { border: 1px solid var(--line); border-radius: 17px; box-shadow: 0 20px 70px #17292148; width: min(492px, calc(100% - 28px)); max-height: calc(100dvh - 28px); color: var(--ink); padding: 21px; }
.modal.wide { width: min(630px, calc(100% - 28px)); }
.modal::backdrop { background: #14282087; }
.modal-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 18px; }
.modal-head h2 { font-weight: 720; line-height: 1.18; font-size: 1.36rem; letter-spacing: -.035em; overflow-wrap: anywhere; }
.modal-head p { color: var(--muted); font-size: .9rem; margin-top: 6px; line-height: 1.45; }
.modal-x { flex: 0 0 auto; margin: -5px -5px 0 0; }
.form-grid { display: grid; gap: 13px; }
.form-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field { display: grid; gap: 5px; align-content: start; min-width: 0; }
.field > span, .payment-fields legend { color: #33483b; font-weight: 650; font-size: .89rem; }
.field :is(input, select, .read-field), .cart-line input { width: 100%; min-width: 0; min-height: 42px; border: 1px solid #dce5d9; border-radius: 8px; padding: 7px 9px; color: var(--ink); background-color: #fcfdfa; font-size: .95rem; }
.field select { padding-right: 30px; }
.field .read-field { display: flex; align-items: center; color: var(--muted); }
.field small { font-size: .77rem; color: var(--muted); line-height: 1.32; }
.checkbox { display: flex; align-items: center; gap: 7px; font-size: .88rem; }
.checkbox input { accent-color: var(--green); width: 17px; height: 17px; }
.form-error { color: #963f32; font-size: .875rem; line-height: 1.4; }
.form-error:empty { display: none; }
.form-note { color: var(--muted); font-size: .9rem; line-height: 1.45; }
.weekday-rates { border: 1px solid var(--line); border-radius: 9px; padding: 10px; }
.weekday-rates summary { color: #33483b; cursor: pointer; font-size: .89rem; font-weight: 650; }
.weekday-rates p { color: var(--muted); font-size: .82rem; margin: 7px 0 11px; }
.modal-actions { display: flex; justify-content: end; gap: 8px; margin-top: 4px; }
.menu-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cart-empty { border: 1px dashed #dce6d8; border-radius: 9px; padding: 13px; color: var(--muted); font-size: .875rem; text-align: center; }
.cart-line { display: grid; grid-template-columns: minmax(0, 1fr) 70px 34px; gap: 9px; align-items: center; padding: 8px 0; border-bottom: 1px solid #edf1ea; }
.cart-line strong, .cart-line span { display: block; }
.cart-line strong { font-size: .9rem; }
.cart-line span { font-size: .78rem; color: var(--muted); margin-top: 3px; }
.payment-fields { padding: 0; margin: 0; border: 0; }
.payment-fields > div { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.payment-fields label { position: relative; cursor: pointer; }
.payment-fields label input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.payment-fields label span { display: flex; gap: 6px; align-items: center; padding: 8px; min-height: 36px; border: 1px solid var(--line); border-radius: 8px; font-size: .82rem; }
.payment-fields label input:checked + span { background: #e6f1e4; border-color: #73a785; }
.payment-fields label input:focus-visible + span { outline: 2px solid #4c9872; outline-offset: 2px; }
.cart-total, .receipt-totals { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 11px 0; border-top: 1px solid #e9efe6; color: #455a4c; }
.receipt-totals { margin-top: 5px; }
.cart-total strong, .receipt-totals strong { font-size: 1.17rem; color: var(--ink); white-space: nowrap; }
.modal table th:first-child, .modal table td:first-child { padding-left: 8px; }
.modal table th:last-child, .modal table td:last-child { padding-right: 8px; }
.report-values { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; margin-bottom: 13px; }
.report-values div { background: #f3f7f0; padding: 9px; border-radius: 8px; }
.report-values span, .report-values strong { display: block; }
.report-values span { font-size: .8rem; color: var(--muted); margin-bottom: 4px; }
.report-payments { border-top: 1px solid #e9efe6; margin-bottom: 12px; display: grid; padding-top: 9px; gap: 6px; }
.report-payments h3 { font-size: .94rem; margin-bottom: 2px; }

.auth { min-height: 100dvh; display: grid; grid-template-columns: minmax(315px, .85fr) minmax(0, 1fr); }
.auth-aside { position: relative; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; min-height: 100%; background: var(--deep); color: white; padding: clamp(24px, 5vw, 77px); }
.auth-aside .brand { z-index: 1; }
.auth-wordmark { z-index: 1; font-size: clamp(2.1rem, 4.5vw, 4.9rem); line-height: 1.02; font-weight: 720; letter-spacing: -.055em; color: #e7f2e4; margin-top: 80px; }
.auth-graphic { position: absolute; left: 24%; top: 24%; height: 62%; width: min(92%, 640px); transform: rotate(-23deg); display: grid; grid-template-columns: repeat(3, 1fr); align-content: start; gap: 12px; opacity: .7; }
.auth-graphic div { aspect-ratio: 1; border: 1px solid #638a6b; border-radius: 19%; background: #2243377a; }
.auth-graphic div:nth-child(2) { background: #91c17b3f; }
.auth-graphic div:nth-child(4) { background: #95c77c38; }
.auth-graphic div:nth-child(6) { background: #c4ec8960; }
.auth-content { display: grid; place-items: center; padding: 36px 24px; }
.auth-inner { width: min(100%, 390px); }
.auth-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: #e0eddb; color: #3b6a50; margin-bottom: 18px; }
.auth h1 { font-size: clamp(1.9rem, 3.7vw, 2.5rem); }
.auth-content p:not(.form-error) { margin: 9px 0 23px; color: var(--muted); line-height: 1.45; }
.auth .form-grid .button { margin-top: 4px; min-height: 46px; }
.demo-login { border-top: 1px solid var(--line); margin-top: 19px; padding-top: 12px; display: grid; color: var(--muted); font-size: .83rem; gap: 3px; }
.loading { min-height: 100dvh; display: grid; place-content: center; color: var(--muted); gap: 12px; text-align: center; padding: 18px; }
#notice { position: fixed; z-index: 8; inset: auto 21px 20px auto; max-width: calc(100% - 42px); padding: 10px 14px; border-radius: 9px; background: #244f3c; box-shadow: 0 8px 18px #11282342; color: white; font-size: .9rem; font-weight: 650; visibility: hidden; }
#notice.visible { visibility: visible; }
#notice.error { background: #8a3a2d; }

@media (max-width: 1130px) {
  .shell { grid-template-columns: 203px minmax(0, 1fr); }
  .sidebar { padding-inline: 12px; }
  .content, .topbar { padding-inline: 24px; }
  .metric { padding-inline: 12px; }
  .metric-head { font-size: .84rem; gap: 6px; }
  .metric-icon { width: 30px; height: 30px; }
  .charts { grid-template-columns: minmax(0, 1.35fr) minmax(255px, 1fr); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; position: fixed; width: min(255px, 83vw); inset: 0 auto 0 0; padding-inline: 16px; }
  .sidebar .brand { margin-bottom: 28px; }
  .mobile-toggle { display: inline-grid; }
  .mobile-open .sidebar { display: flex; }
  .mobile-open .mobile-scrim { display: block; position: fixed; z-index: 2; inset: 0; background: #14282087; border: 0; }
  .topbar { min-height: 58px; }
  .topbar-start { gap: 7px; }
  .content { padding-top: 25px; }
}
@media (max-width: 625px) {
  .content, .topbar { padding-inline: 14px; }
  .page-title { gap: 12px; align-items: flex-start; margin-bottom: 16px; }
  .page-title p { font-size: .89rem; }
  .page-actions .button { padding-inline: 8px; gap: 4px; font-size: .78rem; min-height: 36px; white-space: normal; }
  .page-actions .button svg { width: 14px; }
  .toolbar { flex-wrap: wrap; gap: 7px; margin-bottom: 13px; }
  .toolbar .button { min-height: 35px; font-size: .8rem; padding-inline: 8px; }
  .segments button { padding-inline: 8px; min-height: 29px; font-size: .8rem; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
  .metric { min-height: 106px; padding: 11px 9px; }
  .metric > strong { font-size: 1.4rem; }
  .metric-note { font-size: .73rem; }
  .charts { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .chart { min-height: 0; }
  .section-head { padding: 14px; }
  .table-controls { align-items: flex-start !important; flex-direction: column; }
  .search-control input { width: 138px; }
  th, td { padding: 10px 9px; }
  th:first-child, td:first-child { padding-left: 13px; }
  th:last-child, td:last-child { padding-right: 13px; }
  .auth { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .auth-aside { padding: 17px 22px; }
  .auth-wordmark, .auth-graphic { display: none; }
  .auth-content { padding-top: 28px; }
  .modal { padding: 16px; }
}
@media (max-height: 590px) {
  .sidebar { overflow-y: auto; }
  .sidebar .brand { margin-bottom: 18px; }
  .nav-caption.divided { margin-top: 12px; }
  .nav-link { padding-block: 8px; }
  .sidebar-profile { margin-top: auto; }
}
