:root {
    color-scheme: light;
    --ink: #142447;
    --muted: #4f6183;
    --line: #d7e1f2;
    --blue: #164dc5;
    --ground: #edf3fd;
    font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
    background: var(--ground);
    color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--blue); font-weight: 650; text-decoration: none; }
a:hover { text-decoration: underline; }
small { display: block; color: var(--muted); font-size: .84rem; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.65rem, 4vw, 2.35rem); letter-spacing: -.035em; }
h2 { font-size: 1.1rem; }
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 220px;
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    background: #0d1b3c;
    color: #eef4ff;
    overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 1.3rem; font-weight: 750; }
.sidebar .brand { color: #ffffff; margin: 0 6px 28px; font-size: 1rem; }
.store-brand { min-width: 0; overflow-wrap: anywhere; }
.sidebar small { color: #bbcbed; }
.mark { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: #a6d3ff; color: #102b66; font-weight: 800; }
.sidebar nav { display: grid; gap: 4px; }
.sidebar nav a { color: #e0ebff; padding: 10px 12px; border-radius: 9px; }
.sidebar nav a:hover, .sidebar nav a[aria-current] { background: #253e77; color: white; text-decoration: none; }
.mobile-nav { display: none; }
.account { margin-top: auto; padding: 24px 8px 0; }
.account form { margin-top: 10px; }
.install-app { margin-top: 10px; }
main { margin-left: 220px; padding: 30px clamp(16px, 4vw, 54px); max-width: 1500px; }
.page-title, .card-head, .checkout, .line-total, .print-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.page-title { margin-bottom: 22px; }
.card, .item { min-width: 0; padding: 20px; background: white; border: 1px solid var(--line); border-radius: 14px; }
.card + .card, .metrics + .card, .card + .metrics { margin-top: 16px; }
.card > h2, .card-head { margin-bottom: 14px; }
.card p + p { margin-top: 8px; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit,minmax(175px,1fr)); gap: 12px; }
.metrics .card { margin: 0; }
.metrics strong { display: block; font-size: 1.6rem; margin-top: 8px; }
.grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.stack { display: grid; gap: 14px; }
.stack > .card { margin-top: 0; }
.inline, .actions { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; }
.inline + .table-wrap, .table-wrap + .inline { margin-top: 16px; }
label { display: grid; gap: 5px; font-weight: 650; font-size: .9rem; }
.check { display: flex; align-items: center; gap: 8px; }
input, select, textarea, button, .button { font: inherit; border-radius: 8px; }
input, select, textarea { width: 100%; min-width: 0; min-height: 46px; border: 1px solid #aabbd9; padding: 10px 12px; color: var(--ink); background: white; }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; accent-color: var(--blue); }
textarea { min-height: 76px; resize: vertical; }
input[readonly] { background: var(--ground); }
:focus-visible { outline: 3px solid #2175f4; outline-offset: 2px; }
button, .button { display: inline-block; border: 1px solid transparent; background: var(--blue); color: white; min-height: 44px; padding: 10px 15px; cursor: pointer; font-weight: 650; text-align: center; }
button:hover, .button:hover { filter: brightness(.93); text-decoration: none; }
button:disabled { opacity: .45; cursor: default; }
.quiet { background: #e8f0ff; color: #163e8c; }
.danger { background: #9c2e39; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 11px 9px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: .82rem; }
.badge { display: inline-block; background: #e8f0ff; color: #163e8c; border-radius: 20px; padding: 4px 9px; font-size: .83rem; }
.empty { color: var(--muted); }
.alert { background: #fcebed; color: #852832; padding: 12px 14px; border-radius: 9px; margin-bottom: 16px; }
.item { margin: 0 0 12px; background: #f6f9ff; }
.checkout { justify-content: flex-end; padding-top: 18px; }
.checkout output { font-weight: 750; font-size: 1.4rem; }
.statuses { display: flex; flex-wrap: wrap; gap: 10px 22px; padding: 12px 0; }
.statuses span { color: var(--muted); }
.statuses strong { display: block; color: var(--ink); }
.login main { width: min(100%, 460px); margin: 8vh auto 0; }
.login-card .brand { margin-bottom: 20px; }
.print main { margin: 0 auto; max-width: 720px; }
.receipt { background: white; margin: 18px auto; padding: 5mm; color: #111; font-size: 12px; overflow-wrap: anywhere; }
.receipt.invoice { width: 100%; }
.receipt.thermal { width: min(100%, var(--paper-width)); line-height: 1.3; }
.paper-58 { --paper-width: 58mm; font-size: 11px; }
.paper-80 { --paper-width: 80mm; }
.paper-label { margin-left: auto; color: var(--muted); }
.receipt-download-status { flex-basis: 100%; color: var(--muted); font-size: .9rem; }
.receipt header { text-align: center; }
.receipt h1 { font-size: 17px; }
.receipt h2 { margin-top: .45em; font-size: 14px; }
.paper-58 h1 { font-size: 15px; }
.paper-58 h2 { font-size: 12px; }
.receipt-address { white-space: pre-line; }
.receipt dl { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 4px 8px; }
.receipt dd { margin: 0; text-align: right; }
.receipt ul { list-style: none; padding: 6px 0; border-block: 1px dashed #222; }
.receipt li { padding: 4px 0; break-inside: avoid; }
.receipt li div { display: flex; justify-content: space-between; gap: 8px; }
@media screen and (max-width: 760px) {
    .sidebar { position: static; width: auto; padding: max(12px, env(safe-area-inset-top)) 16px 12px; }
    .sidebar .brand { margin: 0; }
    .sidebar nav, .sidebar .account { display: none; }
    main { margin: 0; padding: 18px 14px; }
    .mobile-nav ~ main { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
    html:has(.mobile-nav) { scroll-padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
    .mobile-nav {
        position: fixed;
        z-index: 10;
        inset: auto 0 0;
        display: flex;
        gap: 4px;
        padding: 6px max(8px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
        border-top: 1px solid var(--line);
        background: white;
        box-shadow: 0 -5px 20px #102b661a;
    }
    .mobile-nav > *, .mobile-menu { flex: 1 1 0; min-width: 0; }
    .mobile-tab {
        min-height: 52px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 3px;
        padding: 5px 2px;
        border-radius: 10px;
        color: var(--ink);
        font-size: .82rem;
        font-weight: 700;
        cursor: pointer;
        list-style: none;
    }
    .mobile-tab::-webkit-details-marker { display: none; }
    .mobile-tab:hover { background: #edf3fd; text-decoration: none; }
    .mobile-tab[aria-current], .mobile-tab.tab-active, .mobile-menu[open] .mobile-tab { color: #163e8c; background: #e6efff; }
    .tab-icon { font-size: 1.25rem; line-height: 1; }
    .mobile-menu-panel {
        position: fixed;
        right: max(12px, env(safe-area-inset-right));
        bottom: calc(72px + env(safe-area-inset-bottom));
        width: min(320px, calc(100% - 24px));
        max-height: 65dvh;
        overflow: auto;
        padding: 10px;
        border: 1px solid var(--line);
        border-radius: 14px;
        background: white;
        box-shadow: 0 12px 34px #14244730;
    }
    .mobile-profile { padding: 6px 8px 10px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
    .mobile-menu-panel a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 7px 8px; border-radius: 8px; }
    .mobile-menu-panel a[aria-current] { background: #e6efff; }
    .mobile-menu-panel button { width: 100%; margin-top: 6px; }
}
@media (max-width: 480px) {
    .grid { grid-template-columns: 1fr; }
    .card, .item { padding: 14px; }
}
@media print {
    :root { background: white; }
    .print-actions { display: none; }
    .print main { padding: 0; }
    .receipt { margin: 0 auto; padding: 2mm; }
    .receipt.thermal { page: thermal; padding-inline: 5mm; }
}
@page thermal { margin: 0; }


[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.sidebar { background: linear-gradient(175deg, #152b61, #0d1b3c 65%); }
.mark { flex: 0 0 40px; background: linear-gradient(135deg, #c4e2ff, #85b9ff); }
.sidebar nav a { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.sidebar nav a[aria-current] { box-shadow: inset 3px 0 #88c5ff; }
.nav-icon { width: 22px; flex: 0 0 22px; text-align: center; color: #b9d8ff; font-size: 1.16rem; }
body:not(.print) main { min-height: 100vh; }
.card { box-shadow: 0 3px 14px #18387408; }
label { font-size: .96rem; }
input, select, textarea { font-weight: 500; }
button, .button { transition: background-color .16s ease, box-shadow .16s ease; }
.welcome {
    margin-bottom: 24px;
    min-height: 155px;
    display: flex;
    align-items: center;
    border-radius: 22px;
    padding: clamp(22px, 4vw, 42px);
    color: white;
    background:
        radial-gradient(ellipse at 105% -30%, #79b8fa 0%, transparent 51%),
        repeating-linear-gradient(120deg, transparent 0 42px, #cce6ff21 43px 44px),
        linear-gradient(115deg, #10285b 8%, #1a51bb 77%, #286be4);
}
.welcome p { color: #e8f3ff; margin-top: 8px; font-size: 1.05rem; }
.quick-actions { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; margin-bottom: 22px; }
.quick {
    display: grid;
    grid-template-columns: auto minmax(0,1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 98px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: white;
    color: var(--ink);
}
.quick strong, .quick small { display: block; }
.quick small { margin-top: 3px; font-weight: 500; line-height: 1.45; }
.quick:hover { text-decoration: none; box-shadow: 0 4px 16px #1446a31c; border-color: #8aafe9; }
.quick.primary { background: linear-gradient(125deg,#153f9d,#1755cb); border-color: transparent; color: white; }
.quick.primary small { color: #e9f2ff; }
.quick-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: #e8f0ff; color: #163e8c; font-size: 1.25rem; }
.quick.primary .quick-icon { background: #ffffff25; color: white; }
.quick .arrow { font-size: 1.15rem; }
.login { background: radial-gradient(ellipse at 10% 5%, #cce4ff 0%, transparent 45%), radial-gradient(ellipse at 95% 90%, #b8d8ff 0%, transparent 46%), var(--ground); }
.login main { display: grid; align-content: center; max-width: 510px; width: 100%; margin: 0 auto; }
.login-card { padding: clamp(20px, 5vw, 36px); border-radius: 21px; box-shadow: 0 12px 40px #143c8c16; }
.login-card h1 { margin: 0 0 12px; }
.login-card p { color: var(--muted); margin-bottom: 14px; }
.login-card .brand { font-size: 1.12rem; }
.login-card button, .pay-button { width: 100%; min-height: 50px; }
.mode-choice { border: 0; padding: 0; margin: 0 0 18px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.mode-choice legend { padding: 0; margin-bottom: 8px; font-weight: 700; }
.mode-choice label { display: flex; align-items: center; gap: 10px; padding: 13px; background: white; border: 2px solid var(--line); border-radius: 12px; cursor: pointer; }
.mode-choice label:has(:checked) { border-color: var(--blue); background: #e6efff; }
.mode-choice input { margin: 0; width: 18px; height: 18px; flex: 0 0 18px; }
.mode-choice small { margin-top: 2px; font-weight: 500; }
.pos-layout { display: grid; grid-template-columns: minmax(0,1fr) minmax(245px, 30%); gap: 16px; align-items: start; }
.pos-work { min-width: 0; }
.item { margin: 0 0 10px; padding: 13px; background: #f6f9ff; min-inline-size: 0; }
.item:last-child { margin-bottom: 0; }
.item-main { display: grid; grid-template-columns: minmax(0,1fr) 132px minmax(65px,auto); align-items: end; gap: 12px; }
.item-main label, .quantity { min-width: 0; }
.stepper { margin-top: 5px; display: grid; grid-template-columns: 39px minmax(0,1fr) 39px; }
.stepper button, .stepper input { padding: 7px 3px; border-radius: 0; text-align: center; }
.stepper button { font-size: 1.2rem; }
.stepper button:first-child { border-radius: 8px 0 0 8px; }
.stepper button:last-child { border-radius: 0 8px 8px 0; }
.stepper input { appearance: textfield; }
.stepper input::-webkit-inner-spin-button { appearance: none; }
.item-cost { text-align: right; padding-bottom: 7px; }
.item-cost output { display: block; font-weight: 750; }
.item-footer { margin-top: 9px; display: flex; gap: 10px; align-items: start; justify-content: space-between; }
.item-footer details { min-width: 0; flex: 1 1 auto; }
.options summary { color: var(--blue); font-size: .9rem; font-weight: 650; cursor: pointer; padding-block: 10px; }
.options[open] > .grid, .options[open] > .stack { margin-top: 4px; padding-bottom: 5px; }
.text-button { color: #8e303d; background: transparent; padding: 6px 4px; min-height: 40px; font-size: .9rem; }
.text-button:disabled { visibility: hidden; }
.specification { margin-top: 12px; }
.payment-card { position: sticky; top: 18px; }
.pay-total { background: linear-gradient(120deg,#122f69,#1851bc); color: white; padding: 14px; border-radius: 12px; margin: 0 0 14px; }
.pay-total span, .pay-total output { display: block; }
.pay-total span { color: #e7f0ff; }
.pay-total output { font-size: clamp(1.28rem, 2.3vw, 2rem); font-weight: 750; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.empty-state p { margin: 4px 0 14px; }
.saved-message { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; padding: 13px 15px; border: 1px solid #a7c5f6; border-radius: 12px; background: #e6efff; color: #143875; }
.settings-card { max-width: 640px; }
.settings-card p { margin-bottom: 18px; color: var(--muted); }
.optional { font-weight: 400; color: var(--muted); }
.order-notes { white-space: pre-line; overflow-wrap: anywhere; }
@media (max-width: 1120px) {
    .quick-actions { grid-template-columns: repeat(auto-fit,minmax(195px,1fr)); }
    .item-main { grid-template-columns: minmax(0,1fr) auto; }
    .item-main > label { grid-column: 1 / -1; }
    .quantity { max-width: 160px; }
}
@media (max-width: 915px) {
    .pos-layout { grid-template-columns: 1fr; }
    .payment-card { position: static; }
}
@media (max-width: 480px) {
    .quick-actions { grid-template-columns: 1fr; }
    .quick { min-height: 70px; }
    .mode-choice label { align-items: start; padding: 10px; }
}
