:root {
    color-scheme: light;
    --bg: #eef1eb;
    --panel: #fff;
    --text: #192822;
    --muted: #53665c;
    --line: #dce5dc;
    --soft: #f2f5ee;
    --side: #162f28;
    --side-text: #f0f8f4;
    --shadow: 0 10px 26px #163d2610;
    font: 15px/1.5 "Aptos", "Segoe UI", system-ui, sans-serif;
}
html[data-appearance=dark] {
    color-scheme: dark;
    --bg: #101916;
    --panel: #1a2722;
    --text: #fff;
    --muted: #c2d5ca;
    --line: #344840;
    --soft: #21332a;
    --side: #101f19;
    --shadow: 0 10px 26px #0003;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; color: var(--text); background: var(--bg); }
html[data-surface=glass] body {
    background-image: radial-gradient(ellipse at 94% 4%, color-mix(in srgb,var(--secondary) 28%,transparent),transparent 55%),
        radial-gradient(ellipse at 20% 80%,color-mix(in srgb,var(--accent) 28%,transparent),transparent 60%);
    background-attachment: fixed;
}
html[data-surface=glass] .card { background: color-mix(in srgb,var(--panel) 77%,transparent); backdrop-filter: blur(16px); }
html[data-surface=glass] .sidebar { background: color-mix(in srgb,var(--side) 90%,transparent); backdrop-filter: blur(18px); }
h1,h2,h3,p { margin: 0; }
h1,h2 { letter-spacing: -.035em; line-height: 1.13; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1rem; }
a { color: inherit; text-underline-offset: 3px; }
button,input,select,textarea { font: inherit; }
button,summary { cursor: pointer; }
button:disabled { opacity: .53; cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--secondary); outline-offset: 3px; }
small,.muted { color: var(--muted); }
.eyebrow { font-size: .71rem; font-weight: 750; letter-spacing: .14em; }
.shell { display: grid; min-height: 100vh; grid-template-columns: 230px minmax(0,1fr); }
.sidebar { background: var(--side); color: var(--side-text); padding: 26px 15px; display: flex; flex-direction: column; gap: 35px; position: sticky; top: 0; height: 100dvh; overflow-y: auto; }
.brand { display: flex; gap: 12px; align-items: center; padding-inline: 8px; text-decoration: none; font-size: 1.09rem; overflow-wrap: anywhere; }
.brand-mark { flex: 0 0 39px; width: 39px; height: 39px; border-radius: 12px; display: grid; place-items: center; background: var(--secondary); color: #101a14; font: 800 22px/1 Georgia,serif; overflow: hidden; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; background: white; }
.sidebar nav { display: grid; gap: 6px; }
.sidebar nav a { display: flex; border-radius: 10px; gap: 11px; align-items: center; padding: 10px 12px; text-decoration: none; color: #dae8df; font-weight: 650; }
.sidebar nav a:hover,.sidebar nav a[aria-current=page] { background: #ffffff21; color: white; }
.sidebar nav span { font-size: 1.15rem; color: #f5cb88; }
.sidebar-user { margin-top: auto; border-top: 1px solid #ffffff30; padding: 16px 8px 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; overflow-wrap: anywhere; }
.sidebar-user small { display: block; color: #c4d6cd; }
.quiet { color: white; background: transparent; border: 0; padding: 6px; text-decoration: underline; }
.main { min-width: 0; padding: 30px clamp(17px,3.1vw,48px) 52px; width: 100%; max-width: 1680px; margin: 0 auto; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 26px; }
.topbar .eyebrow { color: var(--muted); }
.topbar h1 { font-size: clamp(1.9rem,4vw,2.75rem); margin-top: 4px; }
.preferences { position: relative; z-index: 5; }
.preferences summary { list-style: none; white-space: nowrap; }
.preferences summary::after { content: ' ▾'; }
.preferences form { position: absolute; right: 0; top: calc(100% + 8px); width: 220px; padding: 15px; }
.hero { background: linear-gradient(118deg,#101f19,color-mix(in srgb,var(--accent) 55%,#142d23)); color: #fff; border-radius: 22px; padding: clamp(21px,4vw,37px); min-height: 195px; display: flex; justify-content: space-between; align-items: end; gap: 17px; overflow: hidden; box-shadow: var(--shadow); }
.hero h2 { font-size: clamp(1.8rem,4.6vw,3.65rem); margin: 9px 0 10px; overflow-wrap: anywhere; }
.hero p { color: #e0ebe4; }
.hero .eyebrow { color: #f6d6a2; }
.hero-end { display: grid; justify-items: end; gap: 14px; }
.hero-lines,.auth-art { display: flex; align-items: end; gap: 7px; }
.hero-lines i { width: clamp(5px,1.3vw,16px); border-radius: 4px; background: var(--secondary); opacity: .72; height: 16px; }
.hero-lines i:nth-child(2n) { height: 33px; }
.hero-lines i:nth-child(3n) { height: 47px; }
.hero-lines i:last-child { height: 59px; }
.card { border: 1px solid var(--line); border-radius: 16px; background: var(--panel); box-shadow: var(--shadow); }
.metrics { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(160px,100%),1fr)); gap: 14px; margin: 18px 0; }
.metric { padding: 17px; display: grid; gap: 9px; min-width: 0; }
.metric small { font-weight: 700; }
.metric small span { margin-right: 4px; }
.metric strong { font-size: clamp(1.1rem,1.9vw,1.55rem); line-height: 1.2; overflow-wrap: anywhere; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.section { padding: clamp(15px,2.2vw,23px); margin: 0 0 16px; min-width: 0; }
.section h2 { margin-bottom: 15px; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 15px; }
.section-head h2,.fields h2 { margin: 0; }
.section-head a { font-weight: 650; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th,td { padding: 10px 11px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .77rem; letter-spacing: .03em; color: var(--muted); background: var(--soft); }
td small { display: block; }
td a { font-weight: 750; }
.numeric { text-align: right; font-variant-numeric: tabular-nums; }
.empty { padding: 25px 14px; text-align: center; color: var(--muted); background: var(--soft); border-radius: 12px; margin: 12px 0; }
.empty span { font-size: 1.5rem; }
.pill { display: inline-block; border-radius: 999px; border: 1px solid var(--line); background: var(--soft); padding: 4px 9px; font-size: .79rem; font-weight: 650; }
.button,.primary,.preferences summary { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 8px 14px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font-weight: 700; text-decoration: none; }
.primary { color: #fff; background: color-mix(in srgb,var(--accent) 47%,#072219); border-color: transparent; }
.light { color: #14281f; background: #fff; white-space: nowrap; }
.button:hover,.primary:hover { filter: brightness(.9); }
.fields { display: grid; gap: 12px; align-content: start; }
label { display: block; min-width: 0; font-size: .86rem; font-weight: 650; }
label small { display: block; margin-top: 5px; }
input:not([type=checkbox]),select,textarea { display: block; width: 100%; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 9px; min-height: 41px; padding: 8px 10px; margin-top: 4px; }
input[type=color] { padding: 4px; }
input[type=checkbox] { accent-color: var(--accent); }
textarea { resize: vertical; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: 18px; height: 18px; flex: 0 0 18px; }
.pair,.two-col { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.actions,.filters,.pagination { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.filters { padding: 13px; }
.section .filters { padding: 0 0 12px; }
.filters label { flex: 1 1 142px; }
.pagination { margin: 14px 0 0; align-items: center; }
.period-summary { margin: 0 0 12px; color: var(--muted); }
.notice { padding: 11px 14px; border-radius: 9px; background: var(--soft); border: 1px solid var(--line); margin-bottom: 14px; }
.notice.error { border-color: #df8680; }
.branch-list { list-style: none; padding: 0; margin: 8px 0 0; }
.branch-list li { padding: 7px 0; border-bottom: 1px solid var(--line); }
.branch-list small { display: block; }
.branch-list + *, .fields + h3 { margin-top: 18px; }
.logo-preview { display: block; max-width: 120px; max-height: 70px; object-fit: contain; }
.checkout { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(320px,1fr); gap: 16px; align-items: start; }
.hint { font-size: .78rem; margin: 7px 0 13px; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(min(135px,100%),1fr)); gap: 9px; max-height: 70vh; overflow: auto; padding: 3px; }
.product { display: grid; justify-items: start; gap: 5px; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 10px; text-align: left; overflow-wrap: anywhere; min-width: 0; }
.product:hover:not(:disabled) { border-color: var(--secondary); box-shadow: var(--shadow); }
.product-mark { width: 34px; height: 34px; display: grid; place-items: center; background: var(--soft); border-radius: 8px; font-weight: 750; }
.cart-row { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 7px; border-bottom: 1px solid var(--line); padding: 9px 0; overflow-wrap: anywhere; }
.cart-row small { display: block; }
.quantity { display: flex; align-items: center; gap: 6px; grid-column: 1 / -1; }
.quantity input { width: 66px; min-height: 35px; margin: 0; padding: 4px 6px; }
.step { min-width: 36px; min-height: 35px; border-radius: 8px; color: var(--text); background: var(--soft); border: 1px solid var(--line); }
.cart-total { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px; margin-top: 9px; border-radius: 10px; background: var(--soft); }
.cart-total strong { font-size: clamp(1.05rem,2vw,1.5rem); text-align: right; }
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
.auth-brand { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; position: relative; overflow: hidden; gap: 13px; padding: clamp(24px,7vw,110px); background: linear-gradient(145deg,#10261e,var(--accent)); color: white; }
.auth-brand h1 { font-size: clamp(2.35rem,6vw,5.3rem); overflow-wrap: anywhere; }
.auth-brand .eyebrow { color: #ffe6bf; margin-top: 16px; }
.auth-art { margin-top: 26px; height: 55px; }
.auth-art i { width: 8px; height: 100%; background: var(--secondary); border-radius: 1px; }
.auth-art i:nth-child(3n) { width: 18px; }
.auth-art i:nth-child(2n) { width: 4px; }
.auth-form { align-self: center; justify-self: center; width: min(100%,470px); padding: clamp(23px,5vw,57px); }
.auth-form h2 { font-size: 2rem; margin-bottom: 20px; }
.receipt-actions { margin-bottom: 16px; }
.paper { width: min(var(--paper),100%); margin: 0 auto; background: #fff; color: #111; padding: 3mm; font: 600 11px/1.35 Arial,sans-serif; border-radius: 4px; box-shadow: var(--shadow); overflow-wrap: anywhere; }
.paper-head,.paper-footer { text-align: center; }
.paper-head img { display: block; margin: 0 auto 6px; max-width: 34mm; max-height: 18mm; object-fit: contain; }
.paper-head h2 { font: 800 16px/1.2 Arial,sans-serif; margin: 3px 0 5px; }
.paper-head p { margin-bottom: 3px; }
.receipt-meta,.paper-totals { border-block: 1px dashed #222; margin: 7px 0; padding: 5px 0; }
.paper th,.paper td { padding: 4px 2px; background: #fff; color: #111; border-color: #ccc; font-size: inherit; }
.paper td small { color: #222; }
.paper-totals div { display: flex; justify-content: space-between; gap: 6px; }
.paper-totals div:first-child { font-size: 13px; font-weight: 800; padding-bottom: 3px; }
.paper-totals dd { margin: 0; text-align: right; }
@media (max-width: 1050px) {
    .shell { grid-template-columns: 180px minmax(0,1fr); }
    .checkout { grid-template-columns: minmax(0,1fr) minmax(290px,1fr); }
}
@media (max-width: 790px) {
    .shell { display: block; }
    .sidebar { position: static; height: auto; padding: 10px 13px; gap: 8px; }
    .sidebar nav { display: flex; overflow-x: auto; }
    .sidebar nav a { white-space: nowrap; padding: 6px 9px; }
    .sidebar-user { padding: 5px 8px 0; }
    .main { padding-top: 18px; }
}
@media (max-width: 620px) {
    .checkout,.two-col,.auth { grid-template-columns: minmax(0,1fr); }
    .hero { display: grid; }
    .hero-end { justify-items: start; }
    .hero-lines { display: none; }
    .auth-brand { min-height: 220px; }
    .auth-art { height: 25px; margin-top: 0; }
    .auth-form { align-self: start; }
    .product-grid { max-height: 38vh; }
    .preferences summary { padding-inline: 9px; }
}
@media print {
    @page { margin: 0; }
    html,body { color-scheme: light; background: white !important; }
    .shell,.main { display: block; padding: 0; margin: 0; width: auto; }
    .topbar,.sidebar,.receipt-actions,.notice { display: none !important; }
    .paper { margin: 0; width: var(--paper); max-width: 100%; box-shadow: none; border-radius: 0; }
    .paper tr,.paper-head,.paper-totals { break-inside: avoid; }
}
.quantity input[type=number] { width: 66px; min-height: 35px; margin: 0; padding: 4px 6px; }

.product-photo { display: block; width: 100%; height: 88px; object-fit: contain; border-radius: 8px; background: var(--soft); }
.inventory-photo { width: 42px; height: 42px; object-fit: contain; vertical-align: middle; margin-right: 7px; border-radius: 6px; }
.spaced-form { margin-top: 15px; }
.quote-breakdown { display: grid; gap: 5px; }
.quote-breakdown > div { display: flex; justify-content: space-between; gap: 8px; }
.paper-totals div:first-child:not(.receipt-total) { font-size: inherit; font-weight: inherit; padding-bottom: 0; }
.paper-totals .receipt-total { font-size: 13px; font-weight: 800; padding-block: 3px; }
.charts { --chart-cash: color-mix(in srgb,var(--accent) 75%,#14715c); --chart-momo: #2181ae; --chart-bank: color-mix(in srgb,var(--secondary) 72%,#d98d00); }
.payment-chart { display: grid; grid-template-columns: minmax(76px,125px) 1fr; align-items: center; gap: 14px; }
.payment-pie { aspect-ratio: 1; border-radius: 50%; background: conic-gradient(var(--chart-cash) 0 var(--cash-stop),var(--chart-momo) var(--cash-stop) var(--momo-stop),var(--chart-bank) var(--momo-stop) 100%); }
.chart-legend,.sales-bars { list-style: none; padding: 0; margin: 0; }
.chart-legend li { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 6px; font-size: .81rem; margin: 5px 0; }
.swatch { width: 10px; height: 10px; border-radius: 3px; }
.swatch.cash { background: var(--chart-cash); }
.swatch.momo { background: var(--chart-momo); }
.swatch.bank { background: var(--chart-bank); }
.sales-bars { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 3px; font-size: .72rem; text-align: center; }
.sales-bars li { display: grid; gap: 5px; grid-template-rows: minmax(28px,auto) 90px auto; grid-template-rows: subgrid; grid-row: span 3; }
.sales-bars { grid-template-rows: minmax(28px,auto) 90px auto; }
.bar-value { align-self: end; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.bar-track { display: flex; align-items: end; justify-content: center; border-bottom: 1px solid var(--line); }
.bar-track i { width: 72%; max-width: 32px; height: var(--bar-height); background: var(--chart-cash); border-radius: 5px 5px 0 0; }
@media (max-width: 370px) {
    .payment-chart { grid-template-columns: 1fr; }
    .payment-pie { width: 90px; }
}
.payment-pie-empty { background: var(--soft); border: 1px solid var(--line); }
