:root {
  color-scheme: light;
  --ink: #202b26;
  --muted: #616b63;
  --green: #275645;
  --green-dark: #203b31;
  --light-green: #e8f0e8;
  --paper: #f6f5f0;
  --white: #fffefa;
  --line: #e0e3da;
  --gold: #e6cc94;
  --danger: #a03532;
  --radius: 15px;
  font-family: 'Segoe UI', system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-size: 14px;
  font-synthesis: none;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button:disabled { opacity: .55; cursor: not-allowed; }
a { color: inherit; }
svg { width: 19px; height: 19px; flex: none; vertical-align: middle; }
img { display: block; }
:focus-visible { outline: 3px solid #9c7736; outline-offset: 3px; }
strong, b { font-weight: 650; }
h1, h2, h3, p { margin: 0; }
h1, .cash-value { font-family: Georgia, serif; font-weight: 400; letter-spacing: -.042em; }
h1 { font-size: clamp(38px, 4.5vw, 53px); line-height: 1.04; }
h2 { font-size: 19px; letter-spacing: -.025em; font-weight: 680; }
h3 { font-size: 15px; }
.muted, .hint { color: var(--muted); }
.hint { font-size: .91rem; line-height: 1.45; }
.negative { color: var(--danger); }
.positive { color: var(--green); }
.amount { font-variant-numeric: tabular-nums; }
.right { text-align: right; white-space: nowrap; }
.skip { position: fixed; left: 12px; top: -100px; background: var(--white); padding: 12px; z-index: 10; }
.skip:focus { top: 12px; }
.shell { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; background: #203a30; color: #eef0e7; display: flex; flex-direction: column; padding: 27px 17px 22px; }
.brand { display: flex; align-items: center; gap: 12px; margin: 0 6px 42px; text-decoration: none; }
.brand img { border: 1px solid #5a7461; border-radius: 11px; }
.brand strong { display: block; font: 22px Georgia, serif; white-space: nowrap; }
.brand small { display: block; margin-top: 4px; font-size: 9px; color: #d8c49b; letter-spacing: .22em; }
.sidebar nav { display: grid; gap: 5px; }
.sidebar nav a { min-height: 44px; display: flex; align-items: center; gap: 11px; padding: 0 12px; text-decoration: none; border-radius: 8px; color: #d0ddd3; font-size: 14px; font-weight: 550; white-space: nowrap; }
.sidebar nav a:hover { background: #2c483d; color: white; }
.sidebar nav a[aria-current='page'] { background: #385749; color: #fcfcf5; box-shadow: inset 3px 0 var(--gold); }
.sidebar nav a[aria-current='page'] svg { color: var(--gold); }
.sidebar nav a:last-child { margin-top: 18px; }
.local { display: flex; margin: auto 7px 0; gap: 10px; align-items: flex-start; border-top: 1px solid #456054; padding: 18px 0 0; }
.local-dot { width: 8px; height: 8px; background: #c3d2a2; border-radius: 50%; margin-top: 4px; flex: none; }
.local strong, .local small { display: block; }
.local strong { font-size: 12px; }
.local small { margin-top: 4px; font-size: 11px; color: #b8cbbf; }
.topbar { height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 clamp(20px, 4vw, 52px); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.topbar time { white-space: nowrap; }
.session-bar, .session-account { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.session-account { justify-content: flex-end; }
.session-account strong { color: var(--ink); overflow-wrap: anywhere; }
.signed-out { display: block; }
.signed-out .sidebar, .signed-out .topbar { display: none; }
.signed-out .view { min-height: 100vh; display: grid; place-items: center; }
.access-card { width: min(100%, 460px); padding: clamp(21px, 4vw, 32px); display: grid; gap: 18px; }
.access-brand { display: flex; align-items: center; gap: 11px; font: 23px Georgia, serif; }
.access-card h1 { font-size: clamp(31px, 7vw, 39px); }
.access-card form { display: grid; gap: 13px; }
.access-card form .button { justify-self: start; }
.seller-workspace { max-width: 720px; }
.seller-mode .sidebar .local { display: none; }
.seller-mode .sidebar nav a:last-child { margin-top: 0; }
.view { width: min(100%, 1500px); margin-inline: auto; padding: 32px clamp(20px, 4vw, 52px) 48px; }
.page-head, .section-head, .panel-head, .toolbar, .actions { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; }
.page-head { margin-bottom: 26px; align-items: flex-end; }
.page-head p { color: var(--muted); margin-top: 9px; line-height: 1.5; }
.section-head { margin-bottom: 13px; }
.panel-head { padding: 18px 20px; min-height: 62px; }
.panel-head p { margin-top: 4px; }
.button { min-height: 38px; padding: 8px 13px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); font-weight: 620; text-decoration: none; background: var(--white); line-height: 1.25; }
.button:hover { background: #edf1e9; border-color: #c3cabe; }
.button.primary { background: var(--green); border-color: var(--green); color: #fffefa; min-height: 42px; }
.button.primary:hover { background: var(--green-dark); }
.button.danger { color: var(--danger); }
.button.small { min-height: 32px; font-size: .88rem; padding: 4px 9px; }
.button.whatsapp { background: var(--light-green); color: var(--green); }
.button.whatsapp:hover { background: #dae8db; }
.button.link { background: transparent; border-color: transparent; color: var(--green); padding-inline: 5px; }
.button.link:hover { text-decoration: underline; }
.button svg { width: 16px; height: 16px; }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.hero-row { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(255px, 1fr); gap: 16px; margin-bottom: 27px; }
.cash-hero { position: relative; overflow: hidden; isolation: isolate; min-height: 231px; display: flex; flex-direction: column; justify-content: space-between; padding: 21px 24px; border-radius: var(--radius); color: #fcf9ed; background: #254a3a; }
.cash-hero::after { content: ''; position: absolute; z-index: -1; pointer-events: none; right: -85px; top: -127px; width: 400px; height: 400px; border-radius: 50%; border: 1px solid #ffffff23; box-shadow: 0 0 0 28px #ffffff0b, 0 0 0 56px #ffffff09, 0 0 0 84px #ffffff07; }
.cash-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #e4eadf; font-weight: 620; }
.cash-heading > span { display: inline-flex; align-items: center; gap: 9px; }
.cash-heading svg { color: var(--gold); }
.cash-heading a { color: #f8edcf; font-size: .85rem; text-underline-offset: 4px; white-space: nowrap; }
.cash-value { display: block; font-size: clamp(36px, 5vw, 56px); margin: 7px 0 10px; line-height: 1.1; overflow-wrap: anywhere; }
.cash-breakdown { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; max-width: 435px; margin-top: 9px; padding-top: 15px; border-top: 1px solid #ffffff36; }
.cash-breakdown span { display: block; font-size: .86rem; color: #d9e6d8; margin-bottom: 3px; }
.cash-breakdown strong { font-size: 1.1rem; overflow-wrap: anywhere; }
.quick { padding: 19px; }
.quick h2 { padding-bottom: 9px; }
.quick button { width: 100%; display: flex; align-items: center; gap: 11px; background: transparent; border: 0; border-radius: 7px; padding: 8px 4px; text-align: left; color: var(--ink); min-height: 50px; }
.quick button:hover { background: var(--light-green); }
.quick button + button { border-top: 1px solid #edece4; }
.quick button .icon-box { width: 33px; height: 33px; }
.quick button > svg { width: 15px; height: 15px; color: var(--muted); margin-left: auto; }
.quick strong, .quick small { display: block; }
.quick small { color: var(--muted); margin-top: 2px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 185px), 1fr)); gap: 13px; margin-bottom: 20px; }
.stat { padding: 15px; }
.stat .metric-label { display: flex; align-items: center; gap: 9px; color: var(--muted); font-weight: 570; font-size: .9rem; }
.icon-box { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; background: var(--light-green); color: var(--green); flex: none; }
.icon-box.gold { background: #f3ebd8; color: #785a28; }
.icon-box.rose { background: #f7e8e4; color: var(--danger); }
.icon-box svg { width: 17px; height: 17px; }
.stat .metric-value { display: block; margin: 9px 0 4px; font-size: clamp(20px, 2.3vw, 29px); letter-spacing: -.035em; line-height: 1.15; overflow-wrap: anywhere; }
.stat p { font-size: .84rem; color: var(--muted); line-height: 1.4; }
.split { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, 1fr); gap: 15px; margin-bottom: 16px; }
.chart { --chart-height: 138px; margin: 0; padding: 9px 16px 16px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 9px; }
.chart-axis { display: flex; flex-direction: column; justify-content: space-between; height: var(--chart-height); font-size: .73rem; color: var(--muted); padding-bottom: 2px; }
.chart-plot { background: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px 25%); border-bottom: 1px solid var(--line); height: var(--chart-height); display: grid; grid-template-columns: repeat(var(--bars), minmax(0, 1fr)); gap: 4px; position: relative; }
.chart-column { position: relative; height: 100%; display: flex; justify-content: center; align-items: flex-end; }
.chart-column span { position: absolute; top: calc(100% + 6px); color: var(--muted); white-space: nowrap; font-size: .72rem; }
.chart-bar { display: block; width: min(28px, 74%); height: var(--height); background: #75917b; border-radius: 4px 4px 0 0; }
.chart-column:last-child .chart-bar { background: var(--green); }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.chart-empty span { border: 1px solid var(--line); background: var(--white); border-radius: 7px; padding: 8px 12px; color: var(--muted); font-size: .87rem; text-align: center; }
.chart-panel { padding-bottom: 14px; }
.activity { margin: 0; padding: 0 16px; list-style: none; }
.activity li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.activity .entry { min-width: 0; overflow-wrap: anywhere; flex: 1; }
.activity small { display: block; color: var(--muted); margin-top: 3px; }
.empty { padding: 24px; display: grid; justify-items: start; align-content: center; gap: 8px; min-height: 150px; }
.empty p { color: var(--muted); line-height: 1.5; max-width: 450px; }
.empty .button { margin-top: 3px; }
.widget-empty { margin: 0 16px 14px; border: 1px dashed #d7ded2; border-radius: 9px; background: #f9faf5; }
.wide-block { margin-bottom: 16px; }
.toolbar { padding: 13px 17px; }
.toolbar > label, .toolbar label { display: flex; align-items: center; gap: 8px; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .93rem; }
th { background: #f1f3ed; color: #566258; font-weight: 620; white-space: nowrap; }
td, th { padding: 11px 14px; border-bottom: 1px solid #e8ebe2; }
td { min-width: 82px; overflow-wrap: anywhere; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafbf6; }
td small { display: block; margin-top: 4px; color: var(--muted); }
.pill { border-radius: 25px; padding: 4px 8px; display: inline-block; color: var(--green); background: var(--light-green); font-size: .8rem; font-weight: 650; white-space: nowrap; }
.pill.pending { color: #76521f; background: #f5edd7; }
.pill.inactive { color: #666a64; background: #edede7; }
.pill.overdue { color: var(--danger); background: #f7e8e4; }
.inline-link { color: var(--green); text-underline-offset: 3px; }
.row-actions { display: flex; gap: 5px; flex-wrap: wrap; min-width: 9.5rem; }
.entry-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.order-list { list-style: none; margin: 0; padding: 0 16px; }
.order-list li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(120px, auto) auto auto; align-items: center; gap: 9px 12px; padding: 13px 0; border-top: 1px solid var(--line); }
.sales-history li:first-child { border-top: 0; }
.order-list small { display: block; color: var(--muted); margin-top: 3px; }
.order-meta, .order-totals { min-width: 0; overflow-wrap: anywhere; }
.order-list .pill { justify-self: start; }
.order-list .button { justify-self: end; }
.nowrap { white-space: nowrap; }
.info-panel { display: flex; gap: 13px; align-items: flex-start; padding: 16px 19px; margin: 0 0 16px; }
.info-panel h3 { margin-bottom: 5px; }
.info-panel .hint + .button { margin-top: 9px; }
.backup-panel { display: grid; gap: 12px; padding: 22px; margin-bottom: 16px; }
.backup-panel p { max-width: 62ch; }
.loading { padding: 18px; color: var(--muted); }
label { color: #34463a; font-weight: 620; }
input, select, textarea { min-width: 0; border: 1px solid #cfd6cb; background: white; color: var(--ink); border-radius: 7px; min-height: 36px; padding: 7px 9px; }
input[type='search'] { width: min(100%, 295px); }
input[type='checkbox'] { min-height: auto; accent-color: var(--green); }
textarea { resize: vertical; }
dialog { padding: 0; color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); width: min(760px, calc(100vw - 24px)); max-height: min(90vh, 870px); background: var(--white); overflow: auto; box-shadow: 0 20px 70px #0b241b40; }
dialog::backdrop { background: #152a21a0; }
.dialog-head { padding: 18px 21px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.dialog-head h2 { font-size: 23px; }
.dialog-body { padding: 19px 21px; }
.dialog-body > * + * { margin-top: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-field { display: grid; gap: 5px; align-content: start; min-width: 0; }
.form-field input, .form-field textarea, .form-field select { width: 100%; }
.form-field.full { grid-column: 1 / -1; }
.inline-check { display: flex; align-items: center; gap: 8px; }
.plain-fieldset { min-width: 0; margin-inline: 0; padding: 0; border: 0; }
.client-picker { position: relative; }
.client-menu { position: absolute; inset: 100% 0 auto; z-index: 2; max-height: 15rem; overflow: auto; padding: 4px; border: 1px solid var(--line); border-radius: 9px; background: var(--white); box-shadow: 0 8px 22px #203b3126; }
.client-menu ul { list-style: none; margin: 0; padding: 0; }
.client-menu li { min-height: 42px; padding: 11px 9px; border-radius: 5px; cursor: pointer; overflow-wrap: anywhere; }
.client-menu li small { display: block; color: var(--muted); margin-top: 2px; }
.client-menu li:hover, .client-menu li.active, .client-menu li[aria-selected='true'] { background: var(--light-green); }
.client-menu p { padding: 8px 9px; }
.dialog-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; padding: 13px 21px; border-top: 1px solid var(--line); background: #f6f7f1; }
.form-error { color: var(--danger); background: #fbede9; border-radius: 7px; padding: 10px; }
.items-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.line-item { border: 1px solid var(--line); border-radius: 10px; padding: 11px; margin-bottom: 8px; background: #f9faf6; display: grid; gap: 9px; }
.line-fields { display: grid; grid-template-columns: minmax(105px, .9fr) minmax(120px, 1fr); gap: 8px; }
.line-pricing { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 5px 12px; }
.line-caption { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.bill { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 120px), 1fr)); background: var(--light-green); padding: 12px; gap: 10px; border-radius: 9px; }
.bill span, .bill strong { display: block; }
.bill span { color: var(--muted); margin-bottom: 3px; font-size: .85rem; }
.bill strong { overflow-wrap: anywhere; font-size: 1.1rem; }
.catalog-results { display: grid; gap: 5px; max-height: 250px; overflow: auto; }
.catalog-results:empty { display: none; }
.catalog-results button { justify-content: flex-start; text-align: left; }
.spaced { margin-top: 10px; }
.detail-notes { white-space: pre-wrap; overflow-wrap: anywhere; }
#toast { position: fixed; z-index: 6; right: 20px; bottom: 18px; border-radius: 8px; background: var(--green-dark); color: white; box-shadow: 0 8px 26px #152a2140; max-width: min(400px, calc(100% - 40px)); }
#toast:not(:empty) { padding: 12px 16px; }
[hidden] { display: none !important; }
@media (max-width: 1150px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 950px) {
  .shell { grid-template-columns: 185px minmax(0, 1fr); }
  .sidebar { padding-inline: 12px; }
  .brand { margin-inline: 2px; }
  .brand strong { font-size: 19px; }
  .split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .shell { display: block; }
  .sidebar { position: static; height: auto; padding: 12px 14px 8px; }
  .brand { margin: 0 0 11px; }
  .brand img { width: 35px; height: 35px; }
  .sidebar nav { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 3px 1px 5px; gap: 4px; }
  .seller-mode .sidebar nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sidebar nav a { padding: 5px 7px; min-height: 38px; gap: 6px; font-size: .91rem; line-height: 1.25; white-space: normal; }
  .sidebar nav a svg { width: 16px; height: 16px; }
  .sidebar nav a:last-child { margin-top: 0; }
  .sidebar nav a[aria-current='page'] { box-shadow: inset 0 -2px var(--gold); }
  .local { display: none; }
  .topbar { height: 42px; }
  .topbar .session-bar { width: 100%; justify-content: space-between; flex-wrap: nowrap; }
  .session-account { flex-wrap: nowrap; }
  .view { padding-top: 23px; }
}
@media (min-width: 480px) and (max-width: 760px) {
  .sidebar nav { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .order-list li { grid-template-columns: minmax(0, 1fr) auto; }
  .order-totals { text-align: right; }
  .hero-row { grid-template-columns: minmax(0, 1fr); }
  .cash-hero { min-height: 195px; padding: 17px; }
  .quick { padding: 15px; }
  .toolbar label { flex-wrap: wrap; }
  .stats { gap: 8px; }
  .stat { padding: 11px; }
  .stat .metric-label { gap: 5px; line-height: 1.2; }
  .stat .icon-box { width: 27px; height: 27px; }
  .stat .icon-box svg { width: 14px; }
  .topbar #breadcrumb { display: none; }
  .topbar #today { display: none; }
  .topbar .session-bar { justify-content: flex-end; }
  .session-account { max-width: 100%; }
  .session-account strong { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .session-account .button { flex: none; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 350px) {
  .line-fields { grid-template-columns: minmax(0, 1fr); }
  .view { padding-inline: 14px; }
}
