
:root {
  color-scheme: light;
  --ink: #253536;
  --muted: #556667;
  --border: #d4dfde;
  --canvas: #f6f9f8;
  --surface: #fff;
  --teal: #007d70;
  --teal-dark: #00665a;
  --teal-soft: #e7f5f1;
  --success: #176946;
  --danger: #ab3046;
  --shadow: 0 5px 18px rgba(36, 27, 84, .07);
  font-family: "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
  font-size: 14px;
  font-synthesis: none;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 280px; color: var(--ink); background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
button:focus-visible, a:focus-visible { outline: 3px solid #38a697; outline-offset: 2px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(25px, 4vw, 34px); letter-spacing: -.035em; }
h2 { font-size: 19px; }
h3 { font-size: 15px; }
a { color: var(--teal-dark); }
.initial-load { margin: 3rem; color: var(--muted); }
.app-shell { min-height: 100vh; }
.brand { display: flex; align-items: center; gap: 11px; margin: 0 10px 28px; color: #fff; }
.brand-mark { display: grid; place-items: center; width: 41px; height: 41px; border-radius: 13px; background: #0b887a; color: #fff; font-weight: 900; font-size: 21px; box-shadow: 0 4px 12px #14142b55; flex: 0 0 auto; }
.brand-name { font-size: 21px; font-weight: 800; letter-spacing: .04em; }
.brand-sub { color: #536e6a; margin-top: 3px; font-size: 11px; letter-spacing: .04em; }
.topbar { position: sticky; top: 0; z-index: 4; display: flex; justify-content: space-between; align-items: center; gap: 14px; min-height: 67px; background: var(--surface); border-bottom: 1px solid var(--border); padding: 10px clamp(14px, 3.1vw, 37px); }
.topbar-right { display: flex; gap: 10px; align-items: center; min-width: 0; }
.current-store-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar label { display: flex; gap: 8px; align-items: center; white-space: nowrap; }
.topbar select { min-width: min(145px, 42vw); max-width: 48vw; width: auto; }
.page { padding: 28px clamp(14px, 3.1vw, 37px) 48px; max-width: 1680px; margin: 0 auto; }
.page-header { margin-bottom: 21px; display: flex; align-items: end; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.page-header p { color: var(--muted); margin-top: 7px; line-height: 1.6; }
.hero { display: flex; align-items: end; justify-content: space-between; gap: 18px; flex-wrap: wrap; overflow: hidden; position: relative; isolation: isolate; padding: 29px 30px; border-radius: 17px; color: white; background: linear-gradient(112deg,#006657,#078678 65%,#2fa89b); box-shadow: var(--shadow); }
.hero::after { content: ""; z-index: -1; position: absolute; top: -94px; right: -34px; width: 340px; height: 340px; border-radius: 50%; border: 34px solid #ffffff12; box-shadow: 0 0 0 25px #ffffff0b, inset 0 0 0 23px #ffffff09; }
.hero p { color: #e7fbf5; margin-top: 8px; line-height: 1.6; }
.hero .button { color: var(--teal-dark); background: #fff; }
.section { margin-top: 22px; }
.section-title { margin-bottom: 12px; }
.metric-grid { display: grid; gap: 13px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 175px),1fr)); }
.metric { border: 1px solid var(--border); border-radius: 13px; background: #fff; padding: 17px; min-width: 0; }
.metric span { color: var(--muted); display: block; font-size: 13px; }
.metric strong { display: block; font-size: clamp(20px,3vw,27px); margin-top: 8px; overflow-wrap: anywhere; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.quick-grid { display: grid; gap: 13px; grid-template-columns: repeat(auto-fit,minmax(min(100%,165px),1fr)); }
.quick { border: 1px solid var(--border); border-radius: 13px; background: #fff; padding: 16px; min-height: 108px; text-decoration: none; color: var(--ink); }
.quick:hover { border-color: #a79ae4; box-shadow: var(--shadow); }
.quick-icon { width: 34px; height: 34px; border-radius: 9px; background: var(--teal-soft); color: var(--teal); display: grid; place-items: center; font-weight: 800; margin-bottom: 10px; }
.quick small { display: block; margin-top: 4px; color: var(--muted); }
.card { border: 1px solid var(--border); border-radius: 14px; padding: 17px; background: var(--surface); min-width: 0; }
.card + .card { margin-top: 13px; }
.card-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.filters, .actions { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
.filters { margin-bottom: 13px; }
.filters label { flex: 0 1 210px; }
label { display: grid; gap: 6px; min-width: 0; color: var(--ink); font-size: 13px; font-weight: 650; }
label.checkbox { display: flex; align-items: center; gap: 7px; padding: 5px 0; }
input, select, textarea { width: 100%; min-height: 38px; border: 1px solid #cfd1e1; border-radius: 8px; background: #fff; color: var(--ink); padding: 8px 9px; font-weight: 400; min-width: 0; }
input[type=checkbox] { width: 17px; min-height: 17px; accent-color: var(--teal); }
input:focus, select:focus, textarea:focus { outline: 2px solid #55aa9f; outline-offset: 1px; }
textarea { resize: vertical; min-height: 76px; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 6px; border-radius: 8px; background: #fff; border: 1px solid #d4d5e5; min-height: 38px; padding: 8px 12px; color: var(--ink); font-weight: 700; text-decoration: none; white-space: nowrap; }
.button:hover { border-color: #83bcb2; background: #f2fbf8; }
.button.primary { background: var(--teal); color: #fff; border-color: var(--teal); }
.button.primary:hover { background: var(--teal-dark); }
.button.danger { color: var(--danger); border-color: #e9bbc4; }
.button.small { font-size: 12px; min-height: 31px; padding: 5px 8px; }
.button.wide { width: 100%; }
.tabs { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs button { border: 1px solid transparent; background: transparent; padding: 7px 11px; min-height: 36px; border-radius: 7px; color: var(--muted); font-weight: 650; }
.tabs button[aria-selected=true], .tabs button[aria-pressed=true] { background: var(--teal-soft); color: var(--teal-dark); border-color: #bedfd7; }
.tabs button:hover { background: #edf8f5; color: var(--teal-dark); }
.table-wrap { overflow: auto; max-width: 100%; border: 1px solid var(--border); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
th { padding: 11px 12px; background: #f1f1f9; color: #444662; font-size: 12px; font-weight: 750; }
td { padding: 10px 12px; min-width: 75px; border-top: 1px solid var(--border); vertical-align: middle; overflow-wrap: anywhere; }
td:has(.variant-cell) { min-width: 150px; }
tbody tr:nth-child(even) { background: #f9fbfa; }
.table-actions { white-space: nowrap; }
.badge { display: inline-block; border-radius: 20px; padding: 3px 9px; color: var(--teal-dark); background: var(--teal-soft); white-space: nowrap; font-size: 12px; font-weight: 650; }
.badge.ok { background: #e7f7ec; color: var(--success); }
.badge.warn { background: #fff2d6; color: #7f4706; }
.badge.dim { background: #edeef4; color: #555772; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 12px; line-height: 1.6; }
.receipt-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.positive { color: var(--success); }
.negative, .error { color: var(--danger); }
.error { padding: 10px 12px; border: 1px solid #f0c8d1; background: #fff2f5; border-radius: 8px; }
.empty { text-align: center; padding: 31px 14px; color: var(--muted); background: #fcfefd; border: 1px dashed #d9d9ea; border-radius: 10px; }
.meta-grid, .form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.new-stock-product { margin: 0; min-width: 0; padding: 14px; border: 1px solid var(--border); border-radius: 10px; }
.new-stock-product legend { padding: 0 6px; font-weight: 700; color: var(--teal-dark); }
.meta-grid { margin: 0 0 14px; padding: 11px; background: #f6f5fc; border-radius: 9px; }
.meta-grid div { min-width: 0; overflow-wrap: anywhere; }
.meta-grid dt { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.meta-grid dd { margin: 0; }
.full { grid-column: 1 / -1; }
.stack { display: grid; gap: 12px; }
.line-editor { display: grid; grid-template-columns: minmax(140px,2fr) minmax(56px,.6fr) minmax(80px,.8fr) minmax(80px,.8fr) auto; gap: 7px; align-items: end; }
.line-editor.variant { grid-template-columns: minmax(100px,2fr) minmax(62px,1fr) minmax(62px,1fr) auto; }
.line-editor.count { grid-template-columns: minmax(140px,2fr) minmax(70px,.7fr) auto; }
.line-editor .button { margin-bottom: 1px; }
.catalog-product { display: flex; align-items: center; gap: 8px; }
.product-category { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px; }
.category-settings { min-width: 38px; padding: 4px; font-size: 20px; line-height: 1; }
.product-category-list { max-height: 11rem; overflow-y: auto; }
.product-category-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px; }
.product-category-row button:first-child { justify-content: flex-start; text-align: left; white-space: normal; overflow-wrap: anywhere; min-width: 0; }
.product-thumbnail { width: 42px; height: 42px; flex: none; object-fit: cover; border-radius: 5px; }
.product-photo .button { justify-self: start; }
dialog { color: var(--ink); background: #fff; border: 1px solid var(--border); border-radius: 15px; width: min(750px,calc(100% - 24px)); max-height: min(90dvh,850px); padding: 0; box-shadow: 0 20px 90px #1d154d38; }
dialog::backdrop { background: #18163388; }
.hold-delete-confirm { width: min(360px,calc(100% - 28px)); padding: 20px; }
.hold-delete-confirm::backdrop { background: #18163355; }
.hold-delete-confirm h2 { font-size: 18px; }
.dialog-header { position: sticky; z-index: 2; top: 0; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--border); background: #fff; }
.dialog-body { padding: 17px 18px 19px; }
.dialog-actions { margin-top: 15px; display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.notices { position: fixed; bottom: 18px; right: 18px; z-index: 20; display: grid; gap: 7px; max-width: calc(100% - 36px); }
.toast { padding: 11px 16px; color: #fff; background: #225951; border-radius: 8px; box-shadow: var(--shadow); }
.toast.error-toast { background: #842839; }
.login { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, .82fr); }
.login-hero { display: flex; flex-direction: column; justify-content: space-between; gap: 55px; padding: clamp(25px, 6vw, 88px); color: #fff; background: radial-gradient(circle at 82% 70%, #239485 0, transparent 48%),#135951; }
.login-hero .brand { margin: 0; }
.login-hero h1 { font-size: clamp(36px, 7vw, 74px); max-width: 8em; line-height: 1.18; }
.login-hero p { margin-top: 18px; color: #e6f5f0; line-height: 1.75; }
.login-main { display: grid; place-items: center; padding: 24px; background: #fcfefd; }
.login-card { width: min(390px,100%); }
.login-card h2 { font-size: 27px; margin-bottom: 18px; }
.login-card .button { margin-top: 4px; }
.login-links { display: flex; gap: 7px; flex-wrap: wrap; }
.login[data-keyboard] { height: var(--login-visible-height); min-height: 0; grid-template-rows: minmax(0,1fr); }
.login[data-keyboard] .login-hero { justify-content: flex-start; padding: 18px 24px; }
.login[data-keyboard] .login-hero > div:last-child { display: none; }
.login[data-keyboard] .login-main { display: block; min-height: 0; overflow-y: auto; padding: 10px 20px; }
.login[data-keyboard] .login-card { margin-inline: auto; }
.login[data-keyboard] .login-card h2 { font-size: 22px; margin-bottom: 6px; }
.login[data-keyboard] .login-card .tabs { margin-bottom: 6px; }
.login[data-keyboard] #login-form { gap: 7px; }
.login[data-keyboard] #login-form label { gap: 3px; }
.login[data-keyboard] #login-form input { min-height: 32px; padding: 5px 9px; }
.pos-grid { display: grid; grid-template-columns: minmax(300px,.78fr) minmax(0,1fr); gap: 15px; align-items: start; }
.item-list { display: grid; grid-template-columns: repeat(auto-fill,minmax(min(100%,145px),1fr)); gap: 9px; max-height: 61vh; overflow: auto; padding: 2px; }
.item { display: grid; text-align: left; gap: 5px; border: 1px solid var(--border); border-radius: 9px; background: #fcfefd; color: var(--ink); padding: 10px; min-height: 78px; }
.item:hover { border-color: #75baaf; }
.pos-item-grid { grid-auto-rows: max-content; align-content: start; }
.pos-item-grid .pos-product-card { --photo-size: clamp(36px,4.8vw,68px); min-width: 0;
  grid-template-columns: var(--photo-size) minmax(0,1fr); align-items: center; gap: 8px; padding: 6px; }
.pos-photo-button, .pos-detail-photo { display: grid; place-items: center; min-width: 0; background: #edf4f1; color: #88a39c; border-radius: 6px; }
.pos-photo-button { width: var(--photo-size); height: var(--photo-size); overflow: hidden; border: 0; padding: 0; }
.pos-product-photo { width: 100%; height: 100%; object-fit: contain; border-radius: 6px; }
.pos-photo-placeholder { width: 68%; height: 68%; max-width: 130px; max-height: 130px;
  fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.pos-product-pick { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 3px; min-width: 0;
  padding: 2px; border: 0; background: transparent; color: inherit; text-align: start; align-items: center; }
.pos-product-pick > :is(strong,small) { grid-column: 1 / -1; }
.item span { color: var(--teal-dark); font-weight: 700; }
.item small { color: var(--muted); overflow-wrap: anywhere; }
.pos-product-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  min-height: 2.4em; line-height: 1.2; overflow: hidden; overflow-wrap: anywhere; }
.pos-product-pick small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pos-product-price { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pos-product-pick [data-selected-quantity] { font-size: .7em; white-space: nowrap; }
.pos-product-detail { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 16px; }
.pos-detail-photo { position: relative; align-self: start; aspect-ratio: 1; overflow: hidden; }
.pos-detail-photo .pos-product-photo { position: absolute; inset: 0; }
.pos-detail-fields { align-content: start; }
.pos-detail-quantity { display: flex; gap: 6px; align-items: end; }
.pos-detail-quantity label { flex: 1; }
@media (max-width: 550px) {
  .pos-product-detail { grid-template-columns: minmax(0,1fr); }
  .pos-detail-photo { width: min(100%,220px); justify-self: center; }
}
.cart-line { display: grid; grid-template-columns: minmax(0,1fr) 68px minmax(min-content,max-content) auto; gap: 6px; align-items: center; border-bottom: 1px solid var(--border); padding: 8px 0; }
.cart-line > div { min-width: 0; overflow-wrap: anywhere; }
.cart-line-price { font-size: clamp(12px,1.5vw,15px); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.cart-line small { display: block; color: var(--muted); margin-top: 3px; }
.cart-line input { min-height: 33px; padding: 4px 6px; }
.cart-total { display: flex; justify-content: space-between; align-items: center; padding: 12px 0 3px; font-size: 19px; font-weight: 800; }
.pos-cart-clear.button { flex: none; width: 42px; padding-inline: 8px; }
.pos-cart-clear svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
[data-cart-actions] { display: grid; grid-template-columns: auto minmax(0,.8fr) minmax(0,1.2fr); align-items: stretch; }
.pos-member-mark { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 6px 8px; border-left: 3px solid var(--teal); border-radius: 5px; background: var(--teal-soft); color: var(--teal-dark); font-size: 13px; overflow-wrap: anywhere; }
.pos-member-label { flex: none; }
.pos-member-mark strong { min-width: 0; }
.pos-member-mark small { margin-inline-start: auto; color: var(--muted); }
[data-cart-member] { display: flex; align-items: stretch; gap: 5px; }
[data-cart-member] .pos-member-mark { flex: 1; min-width: 0; }
.pos-cart-member-clear.button { min-width: 34px; min-height: 30px; padding: 0 8px; color: var(--muted); font-size: 18px; }
.pos-member-switch { width: 100%; min-height: 36px; border: 1px solid #b5dcd5; border-left: 3px solid var(--teal); text-align: left; }
.pos-member-switch:hover { border-color: var(--teal); background: #d6eee9; }
.pos-member-change { margin-inline-start: auto; white-space: nowrap; font-weight: 650; }
.payment-row { display: grid; grid-template-columns: minmax(120px,1fr) minmax(85px,1fr) auto; gap: 6px; align-items: end; }
.mini-bars { display: grid; gap: 8px; }
.mini-bar { display: grid; grid-template-columns: minmax(95px, .35fr) minmax(0,1fr) max-content; gap: 8px; align-items: center; font-size: 13px; }
.bar-rail { height: 11px; border-radius: 7px; background: #eaf4f1; overflow: hidden; }
.bar-rail div { height: 100%; border-radius: 7px; background: #129b89; }
.home-link { font-size: 29px; line-height: 1; text-decoration: none; }
.app-shell.flat-shell { display: block; }
.flat-shell .topbar { min-height: 56px; padding: 0 12px; gap: 10px; }
.flat-shell .topbar-right { flex: 0 1 auto; }
.tablet-settings.inventory-workspace { grid-template-columns: clamp(92px,10vw,124px) minmax(0,1fr); gap: 12px; }
.inventory-workspace .settings-menu { align-content: start; }
.inventory-workspace .settings-menu a { min-height: 44px; padding: 6px; }
.inventory-menu-title { padding: 12px 6px; color: var(--teal-dark); border-bottom: 1px solid var(--border); text-align: center; }
.stock-filters { align-items: end; }
.stock-filters label { flex: 1 1 125px; }
.stock-filters label:has(input[type="search"]) { flex-grow: 2; }
.responsive-table table { table-layout: fixed; }
.responsive-table th, .responsive-table td { min-width: 0; padding: 8px clamp(4px,.65vw,11px); overflow-wrap: anywhere; }
.catalog-workspace { display: flex; flex-direction: column; gap: 14px; }
.catalog-toolbar, .catalog-footer { display: flex; justify-content: space-between; align-items: center; gap: 10px 18px; flex-wrap: wrap; }
.catalog-toolbar label { width: min(100%, 380px); }
.catalog-browser { display: grid; grid-template-columns: clamp(112px,16vw,208px) minmax(0,1fr); gap: 14px; flex: 1; min-height: 0; }
.catalog-categories { display: flex; flex-direction: column; align-items: stretch; gap: 4px; padding: 4px; background: #f2f7f5; border: 1px solid var(--border); border-radius: 10px; }
.catalog-categories .button { display: grid; grid-template-columns: minmax(0,1fr) auto; flex: 0 0 auto;
  min-width: 0; max-width: 100%; padding-block: 6px; white-space: normal; font-weight: 600; text-align: left; }
.catalog-category-label { min-width: 0; overflow-wrap: anywhere; line-height: 1.25; }
.catalog-category-label[data-length=medium] { font-size: .92em; }
.catalog-category-label[data-length=long] { font-size: .83em; }
.catalog-categories small { color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.catalog-categories .button[aria-pressed=true] { background: var(--teal-soft); border-color: #9dccbf; color: var(--teal-dark); }
.catalog-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 9px; align-content: start; }
.catalog-tile { display: flex; flex-direction: column; border-radius: 10px; border: 1px solid var(--border); overflow: hidden; text-decoration: none; color: var(--ink); }
.catalog-tile:hover, .catalog-tile:focus-visible { border-color: var(--teal); background: #f8fcfa; }
.catalog-tile-photo { display: block; width: 100%; aspect-ratio: 1.55; object-fit: contain; background: #f2f7f5; border-bottom: 1px solid var(--border); }
.catalog-tile-info { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 4px 8px; min-height: 55px; padding: 8px; overflow-wrap: anywhere; }
.catalog-tile-info strong { grid-column: 1 / -1; font-size: 14px; }
.catalog-tile-info small { color: var(--muted); }
.catalog-tile-info span { color: var(--teal-dark); font-weight: 700; }
.catalog-no-photo { display: grid; place-items: center; background-color: #edf4f1; }
.catalog-no-photo > span { width: 36%; max-width: 56px; aspect-ratio: 1.35; border-radius: 5px; border: 2px solid #a1bbb4; background: linear-gradient(145deg, transparent 59%, #bcd2cc 60%), linear-gradient(35deg,#cfdfda 41%, transparent 42%); }
.catalog-workspace [data-catalog-results] { min-width: 0; }
.catalog-product-link { text-decoration: none; color: var(--ink); }
.catalog-product-link small { display: block; }
.catalog-workspace tbody tr { cursor: pointer; }
.catalog-workspace tbody tr:hover { background: var(--teal-soft); }
.catalog-spec-column { width: 14%; }
.catalog-stock-column, .catalog-price-column { width: 11%; }
.catalog-date-column { width: 18%; font-variant-numeric: tabular-nums; }
.catalog-workspace [data-catalog-sort] { min-height: 28px; padding: 3px 2px; border: 0; color: inherit; background: transparent; white-space: normal; }
.catalog-footer { border-top: 1px solid var(--border); padding-top: 12px; margin-top: auto; }
.catalog-footer > .actions { margin-inline-start: auto; }
.catalog-totals { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--muted); }
.catalog-totals strong { color: var(--teal-dark); }
.catalog-view-switch { width: 44px; padding: 7px; color: #a26304; background: #fff3cb; border-color: #efd48e; }
.catalog-view-switch span { display: block; width: 20px; height: 16px; background: linear-gradient(currentColor 0 2px,transparent 2px 7px,currentColor 7px 9px,transparent 9px 14px,currentColor 14px 16px); border-radius: 1px; }
.catalog-view-switch.to-grid span { mask-image: repeating-linear-gradient(90deg,#000 0 4px,transparent 4px 7px); }
.catalog-product-workspace { display: grid; grid-template-columns: minmax(0,1.05fr) minmax(0,1fr); gap: 14px; align-items: start; }
.catalog-product-workspace > .card { margin: 0; }
.catalog-product-workspace h2 { font-size: 16px; margin-bottom: 8px; }
.catalog-detail-fields { display: grid; gap: 4px; margin: 0 0 16px; }
.catalog-detail-fields div { display: grid; grid-template-columns: 44px minmax(0,1fr); align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.catalog-detail-fields dt { color: var(--muted); }
.catalog-detail-fields dd { margin: 0; overflow-wrap: anywhere; }
.catalog-detail-photo, .catalog-photo-empty { width: 100%; aspect-ratio: 1.3; max-height: 55dvh; object-fit: contain; border-radius: 10px; background-color: #f1f6f4; }
.catalog-photo-empty { display: grid; place-items: center; color: var(--muted); }
.catalog-editor-side { min-width: 0; }
.catalog-editor-side .product-category-list { max-height: min(50dvh,520px); }
.catalog-editor-side [data-new-category-form], .catalog-editor-side .error { margin-bottom: 12px; }
.catalog-product-editor .form-grid { align-items: end; }
.movement-product { margin-bottom: 12px; }
.movement-action-column { width: 15%; }
.movement-action-column .button { max-width: 100%; padding-inline: 4px; white-space: normal; }
.order-workspace { display: flex; flex-direction: column; gap: 12px; }
.order-workspace-heading, .order-footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.order-workspace-heading label { width: min(100%,310px); }
.order-workspace-body { display: grid; grid-template-columns: clamp(94px,13%,144px) minmax(0,1fr); gap: 12px; flex: 1; min-height: 0; }
.order-sidebar { display: flex; flex-direction: column; gap: 4px; padding: 7px; border: 1px solid var(--border); border-radius: 10px; background: #f2f7f5; }
.order-sidebar strong, .order-sidebar summary { display: block; padding: 6px 4px; }
.order-sidebar summary { display: list-item; cursor: pointer; }
.order-sidebar .button { width: 100%; font-weight: 600; white-space: normal; }
.order-sidebar details .button { margin-top: 4px; }
.order-sidebar .button[aria-pressed=true] { background: var(--teal-soft); color: var(--teal-dark); border-color: #9dccbf; }
.order-workspace-content { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.order-filters { margin: 0; gap: 7px; }
.order-filters label { flex: 1 1 104px; min-width: 0; }
.order-filters label:has(input[type=date]) { flex-basis: 118px; }
.order-records { min-height: 0; flex: 1; }
.order-records .empty { border: none; margin: 0; min-height: 118px; display: grid; place-items: center; }
.pending-order td, .pending-order:nth-child(even) td { background: #fff0ee; color: #962437; }
.pending-order-label { color: #962437; }
.order-footer { border-top: 1px solid var(--border); padding-top: 10px; }
.order-number-column { width: 17%; font-variant-numeric: tabular-nums; }
.order-time-column { width: 14%; font-variant-numeric: tabular-nums; }
.order-person-column, .order-money-column, .order-member-column { width: 11%; }
.order-count-column { width: 6%; }
.order-method-column { width: 12%; }
.order-action-column { width: 7%; }
.order-action-column .button { max-width: 100%; padding-inline: 5px; white-space: normal; }
.member-name-column { width: 12%; }
.member-phone-column { width: 14%; font-variant-numeric: tabular-nums; }
.member-count-column { width: 6%; }
.member-actions-column { width: 15%; }
.member-actions, .member-recharge-totals { display: flex; gap: 6px 10px; flex-wrap: wrap; }
.level-discount-value { display: block; padding: 10px 12px; border-radius: 8px; background: var(--teal-soft); color: var(--teal-dark); }
.promotion-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.promotion-toolbar .button { margin-inline-start: auto; }
.promotion-edit-dialog { width: min(520px,calc(100% - 24px)); }
.promotion-edit-dialog::backdrop { background: #18163355; }
.member-actions .button { padding-inline: 5px; }
.member-recharge-totals { padding: 10px 12px; background: var(--teal-soft); border-radius: 8px; }
.member-recharge-totals strong { margin-inline-start: 4px; color: var(--teal-dark); }
.handover-form { display: flex; flex-direction: column; gap: 12px; }
dialog:has(.handover-form) { width: min(1080px,calc(100% - 24px)); }
.handover-scroller { max-height: min(66dvh,680px); overflow: auto; display: grid; gap: 12px; }
.handover-period { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 6px 0 10px; margin-bottom: 10px; border-bottom: 2px solid var(--teal); color: var(--muted); }
.handover-period div { display: flex; gap: 5px 14px; flex-wrap: wrap; }
.handover-period strong { color: var(--ink); }
.handover-columns { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; align-items: start; }
.handover-card { min-width: 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.handover-card header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; background: var(--teal-soft); }
.handover-card header strong, .handover-amount strong { color: var(--teal-dark); font-variant-numeric: tabular-nums; }
.handover-card dl, .handover-income { margin: 0; padding: 5px 12px; }
.handover-card dl div, .handover-income li, .handover-amount { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; }
.handover-card dd { margin: 0; font-variant-numeric: tabular-nums; }
.handover-card dl div:last-child { border-top: 1px solid var(--border); font-weight: 700; }
.handover-income li + li { border-top: 1px solid var(--border); }
.handover-income small { display: block; margin-top: 3px; color: var(--muted); }
.handover-count { padding: 10px 12px; }
.handover-count fieldset { padding: 8px 0 0; margin: 0; border: 0; display: grid; min-width: 0; gap: 7px; }
.handover-summary { background: #f4f8f7; border-radius: 10px; padding: 10px 12px; }
.handover-summary > p { margin: 5px 0; color: var(--muted); }
.handover-summary .meta-grid { margin: 0; }
.handover-footer { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: center; border-top: 1px solid var(--border); padding-top: 10px; }
.route-reports .responsive-table :is(th,td) { padding-inline: clamp(4px,.5vw,9px); font-variant-numeric: tabular-nums; }
.report-key-column { width: 14%; }
.report-count-column { width: 7%; }
[data-stock-results] .catalog-product { gap: 6px; }
[data-stock-results] .product-thumbnail { width: clamp(24px,3.2vw,42px); height: auto; aspect-ratio: 1; }
.stock-store-column { width: 10%; }
.stock-code-column { width: 16%; font-variant-numeric: tabular-nums; }
.stock-price-column, .stock-category-column, .stock-action-column { width: 8%; }
.stock-value-column { width: 10%; }
.stock-quantity-column { width: 8%; }
.document-number-column { width: 17%; }
.document-kind-column, .document-quantity-column { width: 8%; }
.document-store-column { width: 11%; }
.document-status-column, .document-money-column { width: 10%; }
.document-time-column { width: 15%; font-variant-numeric: tabular-nums; }
.document-number-column .button { max-width: 100%; white-space: normal; overflow-wrap: anywhere; text-align: left; }
.document-status-column .badge { white-space: normal; }
.transfer-records, .transfer-editor { display: flex; flex-direction: column; gap: 14px; min-height: 100%; }
.transfer-heading, .transfer-footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.transfer-filters { margin: 0; }
.transfer-filters label { flex: 1 1 110px; }
.transfer-filters label:has(input:not([type=date])) { flex-grow: 2; }
.transfer-index-column { width: 6%; }
.transfer-product-picker [data-transfer-matches] { max-height: min(42dvh,360px); overflow-y: auto; }
.transfer-product-picker .dialog-actions { margin-top: 0; padding-top: 12px; border-top: 1px solid var(--border); }
.transfer-pick-column { width: 11%; text-align: center; }
.transfer-code-column { width: 27%; font-variant-numeric: tabular-nums; }
.transfer-spec-column { width: 22%; }
.transfer-footer { padding-top: 12px; border-top: 1px solid var(--border); }
.transfer-summary { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.transfer-summary strong { margin-inline-start: 4px; color: var(--teal-dark); }
.transfer-records-body, .transfer-editor-body { flex: 1; min-height: 0; }
.transfer-editor-body { align-content: start; gap: 10px; }
.transfer-editor-body .empty { display: grid; place-items: center; min-height: clamp(90px,25vh,290px); }
.receipt-records .transfer-footer > button { margin-inline-start: auto; }
.receipt-search, .receipt-catalog-search { justify-content: flex-end; }
.receipt-search label, .receipt-catalog-search label { flex: 1 1 240px; max-width: 420px; }
.receipt-catalog-search { margin: 0; }
.receipt-catalog { display: flex; flex-direction: column; gap: 12px; min-height: 100%; }
.tablet-settings.inventory-workspace:has(.receipt-catalog) { grid-template-columns: minmax(0,1fr); }
.inventory-workspace:has(.receipt-catalog) > .settings-menu { display: none; }
.receipt-catalog-body { flex: 1; min-height: 0; display: grid; grid-template-columns: clamp(92px,16vw,175px) minmax(0,1fr); gap: 12px; }
.receipt-catalog-categories { display: flex; flex-direction: column; gap: 5px; overflow: auto; }
.receipt-catalog-categories .button { justify-content: start; text-align: start; white-space: normal; overflow-wrap: anywhere; }
.receipt-catalog-categories .button[aria-pressed=true] { border-color: #94c9c0; color: var(--teal-dark); background: var(--teal-soft); }
.receipt-catalog-results { min-width: 0; overflow: auto; }
.receipt-catalog-results .product-thumbnail { width: 32px; height: 32px; }
.receipt-catalog-results .transfer-code-column { width: 22%; }
.receipt-picker-value { width: 10%; }
.receipt-picker-category { width: 14%; }
.receipt-product-options { border: 1px solid var(--border); border-radius: 8px; }
.receipt-product-options > summary { padding: 10px 12px; color: var(--teal-dark); cursor: pointer; }
.receipt-product-options[open] > .form-grid { padding: 0 12px 12px; }
.receipt-editor [data-edit-new-receipt] { display: flex; margin-top: 4px; }
.stock-totals { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px 18px; padding-top: 12px; font-size: 13px; }
.stock-totals strong { margin-inline-start: 3px; color: var(--teal-dark); }
.button[data-stock-sort] { min-height: 30px; padding: 2px 0; border: 0; background: transparent; color: inherit; white-space: normal; }
.route-home { background: #fff; }
.route-home .topbar { padding-inline: clamp(12px,2vw,30px); box-shadow: 0 3px 13px #3149480b; }
.home-brand { display: flex; align-items: center; gap: 9px; }
.home-brand strong { font-size: 17px; white-space: nowrap; }
.home-brand .brand-mark { width: 31px; height: 31px; font-size: 16px; border-radius: 9px; box-shadow: none; }
.home-fullscreen { color: var(--teal-dark); }
.tablet-launch { display: grid; grid-auto-columns: minmax(0,1fr); grid-auto-flow: column; gap: 4px; margin: 0 0 clamp(18px,4vh,42px); }
.tablet-launch a, .tablet-launch button {
  display: grid; place-content: center; justify-items: center; gap: clamp(8px,2vh,22px); min-width: 0;
  min-height: clamp(105px,22vh,228px); padding: 8px 2px; border-radius: 12px;
  text-align: center; color: var(--ink); text-decoration: none; border: 1px solid transparent; background: #fff;
}
.tablet-launch a:hover, .tablet-launch button:hover { background: var(--teal-soft); border-color: var(--border); }
.launch-icon { display: grid; place-items: center; position: relative; width: clamp(40px,5.4vw,80px); aspect-ratio: 1; }
.launch-icon::before { content: ""; position: absolute; inset: 20%; border-radius: 50%;
  background: radial-gradient(circle,#50cabb8c 12%,#9ce6db65 46%,transparent 73%); }
.launch-icon svg { position: relative; width: 95%; height: 95%; fill: none; stroke: #707d7c;
  stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.tablet-launch strong { font-weight: 550; }
.tablet-analysis { display: grid; gap: clamp(12px,2vh,22px); }
.tablet-analysis h2 { border-inline-start: 4px solid var(--teal); padding-inline-start: 10px; }
.home-analysis-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.tablet-analysis h2 small { color: var(--teal); margin-inline-start: 12px; font-weight: 500; }
.home-analysis-sync { border: 0; padding: 0; border-radius: 4px; background: transparent; color: inherit; font: inherit; }
.home-analysis-sync span { color: var(--teal); font-size: .8em; }
.home-month-button.button { min-height: 34px; padding: 5px 10px; font-size: 14px; color: var(--teal-dark); background: #f4faf8; }
.home-month-button::after { content: ""; width: .45em; aspect-ratio: 1; border: solid currentColor; border-width: 0 1px 1px 0; rotate: 45deg; margin: -3px 0 0 4px; }
.home-month-form select { min-height: 48px; }
dialog:has(.home-month-form) { width: min(440px,calc(100% - 28px)); }
.app-startup { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 12px; }
.app-startup img { width: 76px; height: 76px; border-radius: 18px; }
.tablet-chart { --chart-height: clamp(138px,27vh,300px); display: grid; grid-template-columns: max-content minmax(0,1fr); gap: 8px; min-width: 0; }
.tablet-chart-scale { display: grid; grid-template-rows: minmax(0,1fr); height: var(--chart-height);
  min-width: 30px; text-align: end; font-size: 11px; font-variant-numeric: tabular-nums; color: var(--muted); }
.tablet-chart-scale span { grid-area: 1 / 1; align-self: start; position: relative; top: var(--level); translate: 0 -50%; }
.tablet-chart-frame { min-width: 0; position: relative; }
.tablet-chart-scroll { overflow-x: auto; padding: 0 0 4px; overscroll-behavior-x: contain; }
.tablet-chart-days { position: relative; display: grid; grid-template-columns: repeat(var(--days),minmax(0,1fr));
  min-width: calc(var(--days) * 28px); height: var(--chart-height); margin-bottom: 20px; }
.tablet-chart-line { position: absolute; inset: var(--level) 0 auto; border-top: 1px solid #e8eeec; pointer-events: none; }
.tablet-chart-line.zero { border-top: 1px dashed #9abbb3; }
.tablet-chart canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.home-daily-sales { display: flex; align-items: baseline; gap: 8px 14px; flex-wrap: wrap; margin: 0; color: var(--muted); }
.home-daily-sales strong { color: var(--teal-dark); font-size: 1.3em; }
.tablet-chart-day { position: relative; padding: 0; border: 0; background: transparent; }
.tablet-chart-day i { position: absolute; inset: var(--level) auto auto 50%; translate: -50% -50%;
  width: clamp(5px,.6vw,9px); aspect-ratio: 1; border-radius: 50%; background: #d33086; }
.tablet-chart-day[aria-pressed=true] i { box-shadow: 0 0 0 3px #d3308640; }
.tablet-chart-date, .tablet-chart-value { position: absolute; inset-inline: 0; text-align: center; font-size: 11px; }
.tablet-chart-date { top: calc(100% + 4px); color: var(--muted); }
.tablet-chart-value { bottom: calc(100% - var(--level) + 6px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ink); font-weight: 650; font-variant-numeric: tabular-nums; }
.tablet-chart-day[aria-pressed=true] :is(.tablet-chart-date,.tablet-chart-value) { color: var(--teal-dark); font-weight: 750; }
.tablet-chart-overlay { position: absolute; inset: 0 0 auto; height: var(--chart-height); pointer-events: none; }
.tablet-chart-tooltip { position: absolute; top: var(--tooltip-y); left: clamp(73px,var(--tooltip-x),calc(100% - 73px));
  width: 142px; padding: 6px 9px; border: 1px solid #dbb6cb; border-radius: 8px; background: var(--surface);
  box-shadow: 0 3px 10px #462f3920; transform: translate(-50%,calc(-100% - 9px)); font-size: 12px; }
.tablet-chart-tooltip.below { transform: translate(-50%,10px); }
.tablet-chart-tooltip span, .tablet-chart-tooltip strong { display: block; overflow-wrap: anywhere; }
.tablet-chart-tooltip span { color: var(--muted); }
.home-totals { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: clamp(6px,2vw,24px); }
.home-totals > :is(article,button) { display: flex; align-items: center; gap: clamp(5px,1.5vw,18px); min-width: 0;
  padding: clamp(7px,1.1vw,17px); border: 1px solid #83c9bf; border-radius: 13px; }
.home-totals > button { text-align: start; background: var(--surface); color: var(--ink); }
.home-totals > button:hover { background: var(--teal-soft); }
.home-target-action { margin-inline-start: 7px; color: var(--teal-dark); font-weight: 650; }
.home-total-icon { display: grid; flex: none; place-items: center; width: clamp(28px,4vw,56px); aspect-ratio: 1;
  border-radius: 50%; background: #e5f6f1; color: var(--teal-dark); font-size: clamp(16px,2vw,28px); }
.home-totals > :is(article,button) div { display: grid; gap: 2px; font-size: clamp(10px,1.3vw,15px); overflow-wrap: anywhere; }
.home-totals strong { font-size: clamp(13px,1.6vw,24px); }
.tablet-settings { display: grid; grid-template-columns: 150px minmax(0,1fr); align-items: start; gap: 14px; }
.settings-menu { display: grid; border: 1px solid var(--border); background: #f0f3f2; }
.settings-menu a { min-height: 53px; display: grid; place-items: center; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--border); }
.settings-menu a:last-child { border-bottom: 0; }
.settings-menu a[aria-current=page], .settings-menu a:hover { background: white; color: var(--teal-dark); }
.settings-fields, .permission-group { min-width: 0; margin: 0; padding: 12px; border: 1px solid var(--border); }
.currency-choices { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,210px),1fr)); gap: 6px 12px; }
.currency-choice { min-width: 0; display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.currency-choice .checkbox { overflow-wrap: anywhere; }
.permission-group legend { padding: 0 5px; color: var(--teal-dark); }
.target-reward-row { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)) auto; gap: 8px; align-items: end; }
[data-open-employee-targets] { margin-inline-end: auto; }
.employee-targets-dialog { width: min(670px,calc(100% - 24px)); }
.employee-targets-dialog::backdrop { background: #18163355; }
.responsive-table :is(th,td).target-actions-column { width: 19%; }
.target-row-actions { gap: 4px; }
.role-form { margin-top: 12px; }
.devices-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.devices-grid .actions { margin-top: 12px; }
.pos-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.route-pos > .topbar { display: none; }
.pos-page-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.pos-toolbar { display: flex; flex: none; align-items: center; gap: 6px; margin-bottom: 8px; }
.pos-toolbar .pos-actions { flex: none; margin: 0; }
.pos-search-slot { flex: 0 1 330px; min-width: 0; margin-inline-start: auto; }
.pos-search-slot:not(:has(form:not([hidden]))) { display: none; }
.pos-search-slot .filters { min-width: 0; flex-wrap: nowrap; align-items: center; margin: 0; gap: 6px; }
.pos-search-slot label { flex: 1 1 auto; min-width: 0; font-size: 0; gap: 0; }
.pos-search-slot input { font-size: 14px; }
.pos-home-link { display: grid; flex: none; place-items: center; inline-size: 38px; min-height: 38px;
  border: 1px solid var(--border); border-radius: 8px; color: var(--teal-dark); background: #f5faf8; }
.pos-toolbar:not(:has(.pos-search-slot form:not([hidden]))) .pos-home-link { margin-inline-start: auto; }
.pos-payment-home { display: flex; justify-content: end; margin-bottom: 5px; }
.pos-cart-heading [data-holds] { margin-inline-start: auto; }
.pos-cart-context { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.pos-cart-context .topbar-right { margin: 0; padding: 0; gap: 5px; flex-wrap: wrap; }
.pos-cart-context .topbar-right :is(select,.button) { max-width: 100%; min-height: 30px; font-size: 12px; padding-block: 3px; }
.pos-cart-context .current-store-name { font-size: 12px; }
.pos-member-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(min(100%,135px),1fr)); align-content: start; gap: 8px; padding: 2px; }
.pos-member-grid .pos-member-card { display: grid; justify-content: stretch; justify-items: center; gap: 4px;
  min-height: 86px; min-width: 0; padding: 8px; white-space: normal; overflow-wrap: anywhere; text-align: center; }
.pos-member-card.create { color: var(--teal-dark); background: var(--teal-soft); border-color: #a9d7ce; }
.pos-member-card.create > span { font-size: 29px; line-height: 1; }
.pos-member-card[aria-pressed=true] { border-color: var(--teal); background: var(--teal-soft); }
.pos-member-card small { color: var(--muted); font-size: 12px; }
.pos-member-avatar { display: grid; place-items: center; width: 32px; aspect-ratio: 1; border-radius: 50%; color: var(--teal-dark); background: #e7f4ef; }
.pos-member-avatar svg { width: 62%; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.pos-member-form-columns { display: grid; grid-template-columns: minmax(145px,.7fr) minmax(0,1.5fr); gap: 16px; }
.pos-member-form-preview { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
  border-radius: 10px; padding: 16px; background: #f1f8f5; color: var(--teal-dark); text-align: center; overflow-wrap: anywhere; }
.pos-member-form-preview .pos-member-avatar { width: 54px; }
@media (max-width: 550px) {
  .pos-member-form-columns { grid-template-columns: minmax(0,1fr); }
  .pos-member-form-preview { flex-direction: row; justify-content: start; }
  .pos-member-form-preview .pos-member-avatar { width: 34px; }
}
.pos-actions [aria-pressed=true] { background: var(--teal-soft); color: var(--teal-dark); border-color: #94c9c0; }
.pos-content > .stack { max-width: 420px; }
[data-return-results] .item:has([aria-pressed=true]) { background: var(--teal-soft); border-color: var(--teal); box-shadow: inset 0 0 0 1px var(--teal); }
.pos-return-actions { padding-top: 10px; }
.pos-return-actions > .button { width: 100%; }
.route-pos:not([data-keyboard]) .pos-return-actions:has(.button:disabled) { display: none; }
.pos-refund-confirm { min-height: 300px; }
.pos-categories { flex: none; min-width: 0; margin-top: 10px; }
.pos-categories .tabs { flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain;
  margin: 0; padding: 4px 3px; }
.pos-categories .tabs .button { flex: none; }
.pos-grid > .pos-payment { margin-top: 0; }
.pos-payment-form { display: grid; grid-template-columns: minmax(0,1fr) minmax(230px,46%); gap: 12px; }
.pos-payment-fields { align-content: start; }
.pos-payment { position: relative; }
.checkout-member-dialog { position: absolute; inset: 48px auto auto 8px; margin: 0; z-index: 3;
  width: min(460px,calc(54% - 20px)); max-height: calc(100% - 52px); overflow: auto; }
.checkout-member-dialog .dialog-header, .checkout-member-dialog .dialog-body { padding: 10px; }
.checkout-member-dialog .dialog-actions { margin-top: 0; }
@media (max-width: 740px) {
  .checkout-member-dialog { width: calc(100% - 16px); }
}
.pos-payment-fields .meta-grid { grid-template-columns: repeat(auto-fit,minmax(95px,1fr)); margin-bottom: 0; }
.pos-payment-fields .meta-grid dd { font-size: 18px; font-weight: 700; }
.pos-choice-list { min-width: 0; margin: 0; padding: 0; border: 0; }
.pos-choice-list legend { margin-bottom: 6px; padding: 0; font-size: 13px; font-weight: 650; }
.pos-choice-list > div { display: flex; flex-wrap: wrap; gap: 8px; }
.pos-choice-list label { position: relative; max-width: 100%; cursor: pointer; }
.pos-choice-list input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.pos-choice-list span { display: grid; place-items: center; min-width: 64px; min-height: 40px; padding: 6px 12px; border: 1px solid var(--border); border-radius: 6px; overflow-wrap: anywhere; }
.pos-choice-list input:checked + span { border-color: var(--teal); background: var(--teal-soft); color: var(--teal-dark); }
.pos-choice-list input:focus-visible + span { outline: 2px solid var(--teal); outline-offset: 2px; }
.pos-register { display: grid; grid-template-rows: auto minmax(0,1fr) auto; gap: 6px; min-height: 0; }
.pos-register :is([name=received], [name=refundAmount]) { min-height: 54px; font-size: 28px; font-weight: 750; font-variant-numeric: tabular-nums; }
.pos-payment-form .keypad-target { border-color: var(--teal); box-shadow: inset 0 0 0 1px var(--teal); }
.pos-keypad { display: grid; grid-template: repeat(4,minmax(42px,1fr)) / repeat(3,minmax(0,1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); }
.pos-keypad button { min-height: 0; padding: 0; border: 0; border-radius: 0; background: var(--canvas); font-size: clamp(20px,3vw,32px); touch-action: manipulation; }
.pos-keypad button:active { background: var(--teal-soft); }
.pos-keypad.keypad-unavailable { opacity: .5; }
.pos-register-actions { display: grid; gap: 5px; }
.pos-register-actions > div { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 5px; }
.pos-register-actions [type=submit] { min-height: clamp(52px,11vh,120px); background: #ec7c40; border-color: #ec7c40; color: #2f1a10; font-size: 25px; }
.pos-register-actions [type=submit]:hover { background: #e8773a; }
.button.hold-delete,
.pos-return-actions > .button,
.pos-refund-confirm .pos-register-actions [type=submit] { background: var(--danger); border-color: var(--danger); color: #fff; }
.button.hold-delete:hover,
.pos-return-actions > .button:hover,
.pos-refund-confirm .pos-register-actions [type=submit]:hover { background: #91253a; border-color: #91253a; }
#print-area { display: none; }
[hidden] { display: none !important; }
@media (min-width: 741px) and (orientation: landscape) {
  .app-shell.flat-shell { display: grid; grid-template: auto minmax(0,1fr) / minmax(0,1fr); height: 100dvh; overflow: hidden; }
  .app-shell.flat-shell.route-pos { grid-template-rows: minmax(0,1fr); }
  .flat-shell .page { width: 100%; max-width: none; min-height: 0; overflow: auto; overscroll-behavior: contain; }
  .flat-shell .page:has(.inventory-workspace) { overflow: hidden; padding: 12px; }
  .inventory-workspace { height: 100%; align-items: stretch; }
  .inventory-workspace > * { min-height: 0; overflow-y: auto; }
  .route-catalog .page:has(> .catalog-workspace) { padding: 12px clamp(12px,2vw,26px); }
  .catalog-workspace { height: 100%; }
  .route-orders .page { padding: 12px clamp(12px,2vw,26px); }
  .order-workspace { height: 100%; }
  .order-sidebar, .order-records { overflow: auto; }
  .catalog-browser > * { min-height: 0; overflow: auto; }
  main:has(> .transfer-records, > .transfer-editor) { padding: 12px clamp(12px,2vw,28px); }
  .transfer-records, .transfer-editor, .receipt-catalog { height: 100%; }
  .transfer-records-body, .transfer-editor-body { overflow-y: auto; }
  .route-pos .page { display: flex; flex-direction: column; overflow: hidden; padding: 6px; }
  .route-pos .pos-grid { grid-template-columns: minmax(300px, 28%) minmax(0,1fr); gap: 8px; }
  .route-pos .pos-grid { min-height: 0; flex: 1; align-items: stretch; }
  .route-pos .pos-grid > .card { display: flex; flex-direction: column; min-height: 0; margin: 0; padding: 9px; border-radius: 5px; }
  .route-pos .card-title { margin-bottom: 6px; }
  .route-pos .pos-actions, .route-pos .pos-categories { margin: 4px 0; }
  .route-pos .pos-toolbar .pos-actions { margin: 0; }
  .route-pos .pos-content { flex: 1; min-height: 0; overflow-y: auto; }
  .route-pos [data-return-search] { display: flex; flex-direction: column; height: 100%; }
  .route-pos [data-return-results] { flex: 1; min-height: 0; overflow-y: auto; }
  .route-pos [data-return-confirm], .route-pos .pos-refund-confirm { height: 100%; }
  .route-pos .pos-products { display: flex; flex-direction: column; overflow: hidden; }
  .route-pos [data-item-picker] { flex: none; }
  .route-pos .pos-products [data-products] { min-height: 0; overflow-y: auto; }
  .route-pos .item-list { grid-template-columns: repeat(3,minmax(0,1fr)); max-height: none; flex: 1; align-content: start; }
  .route-pos .pos-cart { grid-template-rows: minmax(0,1fr) auto; min-height: 0; flex: 1; gap: 6px; }
  .route-pos .pos-cart :is([data-lines],[data-return-selection]) { min-height: 0; overflow-y: auto; }
  .route-pos .cart-line { grid-template-columns: minmax(0,1fr) 48px minmax(min-content,max-content) auto; }
  .route-pos .cart-line strong { overflow-wrap: anywhere; }
  .route-pos .pos-cart-bottom { gap: 6px; }
  .route-pos .pos-cart-bottom .cart-total { padding: 5px 0 0; }
  .route-pos .pos-cart-bottom [data-pay] { flex: 1; }
  .route-pos .pos-grid input, .route-pos .pos-grid select { min-height: 29px; padding-block: 4px; }
  .route-pos .pos-payment-form { min-height: 0; flex: 1; }
  .route-pos .pos-payment-fields { overflow-y: auto; }
  .route-pos .pos-register :is([name=received], [name=refundAmount]) { min-height: 54px; }
}
@media (min-width: 741px) and (orientation: landscape) and (max-height: 500px) {
  .route-pos .pos-payment { overflow-y: auto; }
  .route-pos .pos-payment-form { min-height: 350px; }
}
@media (max-width: 1050px) {
  .catalog-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .pos-grid { grid-template-columns: minmax(265px,.85fr) minmax(0,1fr); }
  .item-list { max-height: 42vh; }
}
@media (max-width: 740px) {
  .order-workspace-body, .handover-columns { grid-template-columns: minmax(0,1fr); }
  .order-sidebar { display: flex; flex-direction: row; flex-wrap: wrap; align-items: start; }
  .order-sidebar .button { width: auto; min-height: 32px; }
  .order-sidebar details { width: 100%; }
  .handover-scroller { max-height: 60dvh; }
  .catalog-browser, .catalog-product-workspace { grid-template-columns: minmax(0,1fr); }
  .catalog-categories { flex-direction: row; flex-wrap: wrap; }
  .catalog-categories .button { flex: 0 1 auto; }
  .catalog-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .catalog-footer { position: sticky; bottom: 0; background: var(--surface); z-index: 2; padding-bottom: 8px; }
  .topbar { min-height: 58px; gap: 8px; }
  .topbar-right { gap: 7px; }
  .topbar select { min-width: 0; max-width: 44vw; }
  .current-store-name { max-width: 43vw; }
  .page { padding-top: 17px; }
  .card { padding: 12px; }
  .filters label { flex: 1 1 126px; }
  .hero { padding: 20px; }
  .pos-grid { grid-template-columns: 1fr; }
  .pos-payment-form { grid-template-columns: 1fr; }
  .pos-keypad { grid-template-rows: repeat(4,52px); }
  .line-editor, .line-editor.variant, .line-editor.count { display: flex; flex-wrap: wrap; }
  .line-editor label { flex: 1 1 70px; }
  .line-editor label:first-child { flex-basis: 100%; }
  .login { grid-template-columns: 1fr; }
  .login[data-keyboard] .login-hero { display: none; }
  .login-hero { gap: 20px; padding: 23px; }
  .login-hero h1 { font-size: 32px; max-width: none; }
  .login-hero p { margin-top: 7px; }
  .login-main { padding: 24px; align-items: start; }
  .tablet-launch { grid-auto-flow: row; grid-template-columns: repeat(4,minmax(0,1fr)); margin-bottom: 12px; }
  .tablet-launch a, .tablet-launch button { min-height: 82px; gap: 3px; }
  .launch-icon { width: 41px; }
  .home-brand h1 { font-size: 14px; }
  .route-home .topbar-right { margin-left: 0; }
  .tablet-settings { grid-template-columns: minmax(0,1fr); }
  .settings-menu { display: flex; overflow-x: auto; }
  .settings-menu a { padding: 0 12px; flex: 0 0 auto; }
  .inventory-menu-title { display: none; }
  .tablet-settings.inventory-workspace { grid-template-columns: minmax(0,1fr); }
  .inventory-workspace .settings-menu { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); }
  .inventory-workspace .settings-menu a { min-height: 40px; }
  .inventory-workspace .settings-menu a:nth-last-child(-n+3) { border-bottom: 0; }
  .responsive-table :is(table, thead, tbody) { display: block; }
  .responsive-table thead tr { display: flex; justify-content: flex-end; background: #f1f1f9; }
  .responsive-table thead th:not(.stock-quantity-column) { position: absolute; width: 1px; height: 1px; padding: 0; clip-path: inset(50%); }
  .catalog-workspace .responsive-table thead tr { justify-content: flex-start; flex-wrap: wrap; }
  .catalog-workspace .responsive-table thead th:has([data-catalog-sort]) { position: static; width: auto; height: auto; padding: 3px 5px; clip-path: none; }
  .responsive-table tbody tr { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); padding: 8px; border-top: 1px solid var(--border); }
  .responsive-table :is(td, .stock-quantity-column) { display: block; width: auto; border: 0; }
  .responsive-table td::before { content: attr(data-label); display: block; margin-bottom: 3px; font-size: 11px; color: var(--muted); }
  .responsive-table :is(td.stock-name-column, td.stock-code-column, td.document-number-column, td.order-number-column) { grid-column: 1 / -1; }
  .receipt-catalog-body { grid-template-columns: minmax(0,1fr); }
  .receipt-catalog-categories { flex-direction: row; flex-wrap: wrap; }
  .route-reports .responsive-table tbody td:first-child { grid-column: 1 / -1; font-weight: 700; }
  .flat-shell .topbar { gap: 6px; padding: 0 10px; }
  .flat-shell .topbar-right { margin-left: auto; padding: 5px 0; }
  .devices-grid { grid-template-columns: 1fr; }
}
.route-pos[data-keyboard] { height: var(--pos-visible-height); overflow: hidden; }
@media (min-width: 741px) and (orientation: landscape) {
  .route-pos[data-keyboard] .page { padding: 4px 6px; }
  .route-pos[data-keyboard] .pos-grid { gap: 5px; grid-template-columns: minmax(222px,26%) minmax(0,1fr); }
  .route-pos[data-keyboard] .pos-grid > .card { position: relative; padding: 5px; }
  .route-pos[data-keyboard] .card-title { margin-bottom: 3px; }
  .route-pos[data-keyboard] .card-title h2 { font-size: 16px; }
  .route-pos[data-keyboard] .pos-grid .button { min-height: 30px; padding-block: 4px; font-size: 12px; }
  .route-pos[data-keyboard] .pos-actions { gap: 4px; margin: 0 0 4px; }
  .route-pos[data-keyboard] .pos-toolbar { margin-bottom: 4px; }
  .route-pos[data-keyboard] .pos-toolbar .pos-actions { margin: 0; }
  .route-pos[data-keyboard] .pos-search-slot .filters { gap: 4px; }
  .route-pos[data-keyboard] .pos-search-slot input { font-size: 13px; min-height: 30px; }
  .route-pos[data-keyboard] .pos-home-link { inline-size: 32px; min-height: 32px; font-size: 24px; }
  .route-pos[data-keyboard] .pos-cart-context { margin-bottom: 4px; }
  .route-pos[data-keyboard] .item-list { gap: 5px; }
  .route-pos[data-keyboard] .pos-item-grid .pos-product-card { --photo-size: 34px; gap: 4px; min-height: 57px; padding: 4px 6px; font-size: 12px; }
  .route-pos[data-keyboard] .pos-product-pick { gap: 1px; padding: 0; }
  .route-pos[data-keyboard] .pos-categories { margin: 2px 0 0; }
  .route-pos[data-keyboard] .pos-categories .tabs { padding: 2px; gap: 3px; }
  .route-pos[data-keyboard] .pos-categories [role=tab] { min-height: 27px; padding: 3px 7px; }
  .route-pos[data-keyboard] .pos-cart, .route-pos[data-keyboard] .pos-cart-bottom { gap: 3px; }
  .route-pos[data-keyboard] .cart-line { padding-block: 4px; }
  .route-pos[data-keyboard] .pos-return-actions { padding-top: 2px; }
  .route-pos[data-keyboard] .pos-return-actions .button:disabled { background: var(--muted); border-color: var(--muted); }
  .route-pos[data-keyboard] .pos-payment-form { min-height: 0; }
  .route-pos[data-keyboard] .pos-payment-fields { min-height: 0; overflow-y: auto; }
  .route-pos[data-keyboard] .pos-keypad { grid-template-rows: repeat(4,minmax(24px,1fr)); }
  .route-pos[data-keyboard] .pos-register :is([name=received],[name=refundAmount]) { min-height: 32px; font-size: 20px; }
  .route-pos[data-keyboard] .pos-register-actions [type=submit] { min-height: 38px; font-size: 17px; }
}
@media (max-width: 740px), (orientation: portrait) {
  .route-pos[data-keyboard] { display: flex; flex-direction: column; }
  .route-pos[data-keyboard] .page { min-height: 0; overflow-y: auto; }
}
@media (max-width: 520px) {
  .pos-toolbar { flex-wrap: wrap; }
  .pos-toolbar .pos-actions { flex: 1 0 100%; }
  .pos-search-slot { flex: 1; }
}
@media print {
  body { color: #000; background: #fff; }
  body.printing #app, body.printing #notices, body.printing dialog { display: none !important; }
  body.printing #print-area { display: block; width: var(--receipt-width,70mm); padding: 2mm; font: 11px/1.35 monospace; }
  #print-area h2 { font-size: 15px; margin-bottom: 6px; }
  #print-area table { font-size: 10px; margin: 6px 0; }
  #print-area th, #print-area td { min-width: 0; padding: 3px 2px; border-color: #aaa; }
  @page { margin: 3mm; }
}



/* Monthly refund lists share the product panel and remain scrollable on tablets. */
[data-return-results]:not(.pos-item-grid) .table-wrap { border-radius: 5px; }
[data-return-results]:not(.pos-item-grid) :is(th,td) { padding: 10px 8px; }
[data-return-results] th:first-child { min-width: 135px; }
[data-return-month] { color: var(--teal-dark); white-space: nowrap; }
[data-return-results] td.numeric { white-space: nowrap; }

/* 退款「订单/退货单」用旧系统 7 列布局：整行可点，平板竖屏也无需横向滚动。 */
[data-return-results] .pos-refund-records .table-wrap { border-radius: 5px; }
[data-return-results] .pos-refund-records table { table-layout: fixed; font-size: 12px; }
[data-return-results] .pos-refund-records :is(th,td) { min-width: 0; padding: 8px 4px; }
[data-return-results] .pos-refund-records th { font-size: 11px; white-space: normal; }
[data-return-results] .pos-refund-records td { overflow-wrap: normal; }
[data-return-results] .pos-refund-records td:first-child { font-size: 11px; font-variant-numeric: tabular-nums; }
[data-return-results] .pos-refund-records td:nth-child(2) { font-size: 11px; }
[data-return-results] .pos-refund-records :is(td,tbody th):not(:first-child) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[data-return-results] .pos-refund-records th:nth-child(1) { width: 22%; }
[data-return-results] .pos-refund-records th:nth-child(2) { width: 24%; }
[data-return-results] .pos-refund-records th:nth-child(3) { width: 11%; }
[data-return-results] .pos-refund-records th:nth-child(4) { width: 6%; }
[data-return-results] .pos-refund-records th:nth-child(5) { width: 17%; }
[data-return-results] .pos-refund-records th:nth-child(6) { width: 10%; }
[data-return-results] .pos-refund-records th:nth-child(7) { width: 10%; }
@media (max-width: 900px) {
  [data-return-results] .pos-refund-records table { font-size: 11px; }
  [data-return-results] .pos-refund-records :is(th,td) { padding: 7px 4px; }
  [data-return-results] .pos-refund-records td:first-child { font-size: 10px; }
}
[data-return-results] .pos-refund-records tbody tr[data-return-order] { cursor: pointer; }
[data-return-results] .pos-refund-records tbody tr[data-return-order]:hover { background: #eef8f5; }
[data-return-results] .pos-refund-records tbody tr[data-return-order]:focus-visible { outline: 2px solid var(--teal); outline-offset: -2px; }

/* 离线模式：状态条、只读提示与同步进度 */
.connectivity-chip { position: fixed; left: 14px; bottom: 14px; z-index: 30; display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 999px; background: #6b4a00; color: #fff; box-shadow: 0 4px 14px #0003; font-size: 12px; }
.connectivity-chip[hidden] { display: none; }
.connectivity-chip .connectivity-dot { width: 8px; height: 8px; border-radius: 50%; background: #ffd27a; flex: 0 0 auto; }
.connectivity-chip b { background: #ffffff2b; padding: 2px 7px; border-radius: 999px; font-weight: 600; }
.offline-banner { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin: 0 0 14px; padding: 9px 14px;
  border-radius: 10px; border: 1px solid #e8c47a; background: #fff7e6; color: #6b4a00; font-size: 13px; }
.offline-banner strong { font-size: 13px; }
.offline-banner .offline-pending { margin-left: auto; background: #6b4a00; color: #fff; padding: 2px 8px; border-radius: 999px; }
#page.offline-readonly form input:disabled, #page.offline-readonly form select:disabled,
#page.offline-readonly form textarea:disabled { opacity: .65; }
#page.offline-readonly .card-title button:disabled { pointer-events: none; }
.offline-sync p { line-height: 1.6; margin-bottom: 10px; }
.offline-sync progress { width: 100%; height: 12px; accent-color: var(--teal); margin-bottom: 8px; }
