:root {
  color-scheme: dark;
  --ink: #f5f7fb;
  --muted: #8c9aad;
  --muted-2: #64748b;
  --bg: #07111d;
  --panel: #0d1927;
  --panel-2: #111f2f;
  --line: rgba(148, 163, 184, .16);
  --line-strong: rgba(148, 163, 184, .28);
  --accent: #f2543f;
  --accent-bright: #ff6a50;
  --cyan: #56d6d0;
  --green: #34d399;
  --shadow: 0 22px 64px rgba(0, 0, 0, .35);
  font-family: "DM Sans", system-ui, sans-serif;
}

:root[data-theme="light"] {
  color-scheme: light;
  --ink: #172033;
  --muted: #64748b;
  --muted-2: #8794a6;
  --bg: #edf3f8;
  --panel: #ffffff;
  --panel-2: #f5f8fb;
  --line: rgba(30, 50, 75, .13);
  --line-strong: rgba(30, 50, 75, .24);
  --cyan: #087f7b;
  --green: #169b68;
  --shadow: 0 22px 64px rgba(37, 55, 79, .16);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(86,214,208,.5); outline-offset: 2px; }

body {
  background:
    radial-gradient(circle at 72% -10%, rgba(46, 139, 147, .14), transparent 33%),
    linear-gradient(180deg, #091522 0%, #07111d 100%);
  overflow: hidden;
}

.app-shell { height: 100vh; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.topbar { height: 74px; padding: 0 22px; display: flex; align-items: center; gap: 24px; border-bottom: 1px solid var(--line); background: rgba(7,17,29,.93); }
.brand { min-width: 305px; padding: 0; display: flex; align-items: center; gap: 11px; border: 0; background: transparent; color: inherit; text-align: left; }
.brand:hover .brand-mark { filter: brightness(1.08); transform: translateY(-1px); }
.brand:hover .admin-caret { color: var(--cyan); }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; font: 800 20px/1 Manrope; background: var(--accent); box-shadow: 0 8px 24px rgba(242,84,63,.25); }
.brand div { display: flex; flex-direction: column; line-height: 1; }
.brand strong { font: 800 17px/1.1 Manrope; letter-spacing: .15em; }
.brand small { margin-top: 5px; color: var(--muted); font: 700 9px/1 Manrope; letter-spacing: .24em; }
.admin-caret { margin-left: 4px; color: var(--muted); font-size: 18px; transition: color .15s ease; }
.location-pill { display: flex; align-items: center; gap: 9px; min-height: 40px; padding: 9px 14px; border: 1px solid rgba(52,211,153,.26); border-radius: 10px; background: rgba(52,211,153,.06); color: #d8e3ec; font-size: 12px; font-weight: 700; }
.location-pill:hover { background: rgba(52,211,153,.11); }
.location-pill.sql-offline { border-color: rgba(251,191,36,.28); background: rgba(251,191,36,.06); }
.location-pill.sql-offline .status-dot { background: #fbbf24; box-shadow: 0 0 0 4px rgba(251,191,36,.1); }
.status-dot, .connection-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(52,211,153,.1); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 9px; }
.top-button { height: 40px; padding: 0 13px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 9px; background: #0d1927; color: #cbd5e1; font-size: 12px; font-weight: 600; }
.top-button:hover { border-color: var(--line-strong); background: #132235; }
.top-button span { color: var(--cyan); font-size: 16px; }
.top-button b { display: grid; place-items: center; min-width: 21px; height: 21px; padding: 0 6px; border-radius: 11px; background: var(--accent); color: white; font-size: 11px; }
.top-button:disabled { opacity: .42; cursor: not-allowed; }
.store-check-top { border-color: rgba(86,214,208,.28); background: rgba(86,214,208,.07); }
.store-check-top strong { color: #e7f8f7; font-size: 12px; }
.preference-button { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: #0d1927; color: #d6e0eb; font: 800 11px Manrope; }
.preference-button:hover { border-color: rgba(86,214,208,.38); background: #132235; color: white; }
.clock { min-width: 88px; margin-left: 9px; text-align: right; }
.clock strong, .clock small { display: block; }
.clock strong { font: 700 17px/1.1 Manrope; }
.clock small { margin-top: 3px; color: var(--muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }

.register-layout { flex: 1; min-height: 0; display: grid; grid-template-columns: 382px 1fr; grid-template-rows: minmax(0, 1fr); overflow: hidden; }
.check-panel { min-height: 0; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: rgba(11,23,36,.88); box-shadow: 12px 0 40px rgba(0,0,0,.12); }
.check-head { min-height: 76px; padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.eyebrow { color: var(--cyan); font: 700 9px/1 Manrope; letter-spacing: .18em; }
h1, h2 { margin: 0; font-family: Manrope, sans-serif; }
.check-head h1 { margin-top: 6px; font-size: 19px; letter-spacing: -.02em; }
.icon-button { width: 39px; height: 39px; border: 1px solid rgba(86,214,208,.26); border-radius: 9px; background: rgba(86,214,208,.08); color: var(--cyan); font-size: 25px; }
.customer-strip { width: auto; min-height: 62px; margin: 12px 14px 8px; padding: 10px; display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 10px; text-align: left; border: 1px solid var(--line); border-radius: 11px; background: #111f2f; }
.customer-strip:hover { border-color: rgba(86,214,208,.35); }
.customer-avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: rgba(86,214,208,.1); color: var(--cyan); font-size: 20px; }
.customer-strip strong, .customer-strip small { display: block; }
.customer-strip strong { font-size: 13px; }
.customer-strip small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.chevron { color: var(--muted); font-size: 23px; }
.check-meta { padding: 4px 14px 11px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; border-bottom: 1px solid var(--line); }
.check-status-meta { grid-template-columns: minmax(0, 1fr); }
.check-choice-button { width: 100%; min-height: 50px; padding: 7px 38px 7px 12px; position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; border: 1px solid var(--line); border-radius: 9px; background: #0a1624; text-align: left; }
.check-choice-button span { color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.check-choice-button strong { margin-top: 4px; font-size: 12px; }
.check-choice-button i, .touch-selector i { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-style: normal; font-size: 22px; }
.check-choice-button:disabled { opacity: .42; cursor: not-allowed; }
.line-items { flex: 1; min-height: 90px; overflow-y: auto; padding: 8px 9px; }
.empty-check { height: 100%; display: grid; place-content: center; gap: 8px; text-align: center; color: var(--muted); }
.empty-check span { font-size: 28px; opacity: .55; }
.empty-check strong { color: #bdc8d6; font: 700 13px Manrope; }
.empty-check small { font-size: 11px; }
.line-item { width: 100%; padding: 12px 11px; display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; }
.line-item:hover { background: rgba(255,255,255,.025); }
.line-item-name { font-size: 12px; font-weight: 700; }
.line-item-price { font: 700 13px Manrope; }
.line-item-detail { color: var(--muted); font-size: 10px; }
.line-item-note { grid-column: 1 / -1; color: #fbbf24; font-size: 10px; }
.check-note { min-height: 38px; margin: 0 14px 8px; padding: 8px 10px; display: flex; align-items: center; gap: 8px; border: 1px dashed var(--line-strong); border-radius: 8px; background: transparent; color: var(--muted); text-align: left; font-size: 10px; }
.check-note span:first-child { color: var(--cyan); }
.totals { padding: 11px 17px 9px; border-top: 1px solid var(--line); }
.totals > div { display: flex; justify-content: space-between; margin: 4px 0; color: var(--muted); font-size: 11px; }
.totals strong { color: #dbe4ef; font-weight: 600; }
.totals small { color: var(--muted-2); }
.totals .grand-total { margin-top: 9px; padding-top: 9px; border-top: 1px solid var(--line); color: white; font: 700 15px Manrope; }
.totals .grand-total strong { color: white; font-size: 20px; }
.check-actions { min-height: 58px; margin: 0 14px 14px; display: grid; grid-template-columns: 1fr; gap: 8px; }
.save-check-button { height: 58px; padding: 0 12px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; border: 1px solid rgba(86,214,208,.3); border-radius: 11px; background: rgba(86,214,208,.08); color: var(--cyan); text-align: left; }
.save-check-button span { font: 800 12px Manrope; }
.save-check-button small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.save-check-button:hover { background: rgba(86,214,208,.13); }
.save-check-button:disabled { opacity: .4; cursor: not-allowed; }
.pay-button { height: 58px; margin: 0; padding: 0 17px; display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 14px; border: 0; border-radius: 11px; background: linear-gradient(135deg, var(--accent-bright), var(--accent)); box-shadow: 0 10px 24px rgba(242,84,63,.22); text-align: left; }
.pay-button:hover { filter: brightness(1.07); transform: translateY(-1px); }
.pay-button span { font: 800 16px Manrope; }
.pay-button strong { font: 800 19px Manrope; }
.pay-button b { font-size: 22px; }
.pay-button:disabled { opacity: .45; filter: grayscale(.25); transform: none; cursor: not-allowed; }

.catalog-panel { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: rgba(7,17,29,.72); }
.catalog-toolbar { min-height: 74px; padding: 15px 22px; display: flex; gap: 12px; align-items: center; }
.search-wrap { flex: 1; position: relative; }
.search-wrap span { position: absolute; left: 14px; top: 9px; color: var(--muted); font-size: 22px; }
.search-wrap input { width: 100%; height: 44px; padding: 0 16px 0 43px; border: 1px solid var(--line); border-radius: 10px; background: #0d1927; color: white; font-size: 12px; }
.search-wrap input::placeholder { color: #67768a; }
.scale-status { min-width: 226px; height: 44px; padding: 0 12px; display: grid; grid-template-columns: 31px 1fr 8px; align-items: center; gap: 9px; border: 1px solid rgba(52,211,153,.22); border-radius: 10px; background: rgba(52,211,153,.06); text-align: left; }
.scale-icon { color: var(--green); font-size: 20px; }
.scale-status small, .scale-status strong { display: block; }
.scale-status small { color: var(--muted); font-size: 8px; letter-spacing: .13em; }
.scale-status strong { margin-top: 3px; font-size: 10px; }
.scale-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
.catalog-control-strip { min-height: 82px; padding: 10px 18px; display: flex; align-items: stretch; gap: 12px; border-block: 1px solid var(--line); background: rgba(13,25,39,.72); }
.category-tabs { min-width: 0; flex: 1; display: flex; gap: 8px; align-items: stretch; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.category-tab { flex: 0 0 112px; width: 112px; height: 60px; padding: 0 10px; border: 1px solid var(--line); border-radius: 11px; background: linear-gradient(150deg, #132234, #0e1a29); color: #b6c2d0; font: 700 12px/1.15 Manrope; white-space: normal; text-align: center; touch-action: manipulation; }
.category-tab:hover { border-color: var(--line-strong); color: white; background: #17283b; }
.category-tab:active { transform: scale(.97); }
.category-tab.active { border-color: var(--accent); background: linear-gradient(145deg, rgba(242,84,63,.25), rgba(242,84,63,.1)); color: white; box-shadow: inset 0 0 0 1px rgba(242,84,63,.25); }
.order-touch-controls { flex: 0 0 auto; display: flex; gap: 8px; padding-left: 12px; border-left: 1px solid var(--line); }
.touch-selector { width: 140px; height: 60px; padding: 7px 34px 7px 11px; position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; border: 1px solid rgba(86,214,208,.24); border-radius: 11px; background: rgba(86,214,208,.06); color: var(--cyan); text-align: left; font-size: 8px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.touch-selector.order-type-selector { width: 158px; border-color: rgba(242,84,63,.28); background: rgba(242,84,63,.07); color: #ff8a78; }
.touch-selector strong { max-width: 100%; margin-top: 4px; overflow: hidden; color: white; font-size: 12px; letter-spacing: 0; text-overflow: ellipsis; text-transform: none; white-space: nowrap; }
.touch-selector:disabled { opacity: .45; cursor: not-allowed; }
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.choice-card { min-height: 78px; padding: 14px 16px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 12px; background: #111f2f; text-align: left; }
.choice-card strong { font: 800 14px Manrope; }
.choice-card small { grid-column: 1; color: var(--muted); font-size: 9px; }
.choice-card b { grid-column: 2; grid-row: 1 / span 2; width: 27px; height: 27px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: transparent; }
.choice-card.selected { border-color: var(--cyan); background: rgba(86,214,208,.09); }
.choice-card.selected b { border-color: var(--cyan); background: var(--cyan); color: #05211f; }
.inline-choice-grid { margin-top: 6px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.inline-choice { min-height: 43px; border: 1px solid var(--line); border-radius: 9px; background: #111f2f; font-size: 10px; font-weight: 700; }
.inline-choice.selected { border-color: var(--cyan); background: rgba(86,214,208,.1); color: var(--cyan); }
.catalog-heading { padding: 20px 24px 13px; display: flex; align-items: end; justify-content: space-between; }
.catalog-heading h2 { margin-top: 7px; font-size: 21px; }
.catalog-heading > span { color: var(--muted); font-size: 10px; }
.product-grid { flex: 1; min-height: 0; padding: 0 22px 18px; display: grid; grid-template-columns: repeat(auto-fill, 148px); grid-auto-rows: 92px; align-content: start; justify-content: start; gap: 10px; overflow-y: auto; }
.product-card { position: relative; width: 148px; height: 92px; min-height: 92px; padding: 10px 11px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: linear-gradient(150deg, #132234, #0e1a29); text-align: left; box-shadow: 0 7px 20px rgba(0,0,0,.08); }
.product-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--card-color, var(--cyan)); }
.product-card::after { content: ""; position: absolute; inset: 0 0 0 auto; width: 3px; background: var(--card-color, var(--cyan)); }
.product-card:hover { border-color: rgba(148,163,184,.38); transform: translateY(-2px); box-shadow: 0 12px 24px rgba(0,0,0,.2); }
.product-card:active { transform: translateY(0) scale(.985); }
.product-card .tag { align-self: flex-start; padding: 2px 5px; border-radius: 4px; background: rgba(255,255,255,.06); color: var(--muted); font-size: 7px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.product-card h3 { max-width: 95%; margin: 5px 0 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 10px/1.2 Manrope; }
.product-card .variant { min-height: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 8px; line-height: 1.2; }
.product-card footer { margin-top: 5px; display: flex; align-items: end; justify-content: space-between; }
.product-card .price { font: 800 14px/1 Manrope; }
.product-card .unit { color: var(--muted); font-size: 9px; }
.product-card .add { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 7px; background: rgba(255,255,255,.075); color: var(--card-color, var(--cyan)); font-size: 18px; }
.no-products { grid-column: 1 / -1; display: grid; place-items: center; color: var(--muted); }
.register-footer { min-height: 35px; padding: 0 23px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); color: var(--muted-2); font-size: 9px; }
.register-footer span:first-child { display: flex; align-items: center; gap: 6px; }
.register-footer b { color: var(--muted); }

.modal-layer { position: fixed; inset: 0; z-index: 20; display: none; place-items: center; padding: 20px; background: rgba(1,7,14,.72); backdrop-filter: blur(10px); }
.modal-layer.open { display: grid; }
.modal { width: min(680px, 95vw); max-height: 90vh; overflow: auto; border: 1px solid var(--line-strong); border-radius: 18px; background: #0d1927; box-shadow: var(--shadow); }
.modal.wide { width: min(900px, 96vw); }
.modal-head { position: sticky; top: 0; z-index: 2; padding: 20px 22px 16px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); background: #0d1927; }
.modal-head h2 { margin-top: 5px; font-size: 22px; }
.modal-head p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.modal-head > .close-modal { flex: 0 0 37px; width: 37px; height: 37px; padding: 0; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: #111f2f; color: var(--muted); font-size: 20px; }
.modal-body { padding: 20px 22px 24px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.field { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.field input, .field select, .field textarea { width: 100%; margin-top: 6px; border: 1px solid var(--line); border-radius: 9px; background: #081421; color: white; text-transform: none; }
.field input, .field select { height: 43px; padding: 0 12px; }
.field textarea { min-height: 90px; padding: 11px 12px; resize: vertical; }
.field input.keyboard-target, .field textarea.keyboard-target { border-color: rgba(86,214,208,.45); box-shadow: 0 0 0 3px rgba(86,214,208,.07); }
.modal-actions { margin-top: 18px; display: flex; align-items: stretch; justify-content: flex-end; flex-wrap: wrap; gap: 9px; }
.secondary-button, .primary-button, .danger-button { min-height: 43px; padding: 0 18px; border-radius: 9px; font-weight: 700; font-size: 11px; }
.modal-actions > .secondary-button, .modal-actions > .primary-button, .modal-actions > .danger-button { min-width: 112px; height: 46px; display: inline-flex; align-items: center; justify-content: center; line-height: 1.15; }
.modal-actions > .danger-button:first-child { margin-right: auto; }
.admin-function-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.admin-function-button { min-height: 118px; padding: 16px; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; border: 1px solid var(--line); border-radius: 13px; background: linear-gradient(150deg, #14263a, #0d1927); text-align: left; }
.admin-function-button:hover { border-color: rgba(86,214,208,.38); background: #172b41; }
.admin-function-button > span { color: var(--cyan); font-size: 25px; }
.admin-function-button strong { font: 800 14px Manrope; }
.admin-function-button small { color: var(--muted); font-size: 9px; line-height: 1.35; }
.admin-function-placeholder { border-style: dashed; opacity: .65; }
.secondary-button { border: 1px solid var(--line); background: #111f2f; }
.primary-button { border: 0; background: var(--accent); color: white; }
.primary-button:disabled { opacity: .42; cursor: not-allowed; }
.danger-button { border: 1px solid rgba(248,113,113,.3); background: rgba(248,113,113,.08); color: #fca5a5; }
.scale-readout { padding: 26px; display: grid; place-items: center; border: 1px solid rgba(52,211,153,.2); border-radius: 14px; background: rgba(52,211,153,.045); }
.scale-readout small { color: var(--green); letter-spacing: .16em; font-size: 9px; }
.scale-readout strong { margin: 10px 0; font: 800 46px/1 Manrope; }
.scale-readout span { color: var(--muted); font-size: 10px; }
.weight-controls { margin: 14px 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.weight-controls button { height: 42px; border: 1px solid var(--line); border-radius: 8px; background: #111f2f; font-size: 11px; }
.keypad-layout { display: grid; grid-template-columns: 1fr 260px; gap: 20px; }
.payment-summary { display: flex; flex-direction: column; gap: 10px; }
.payment-total { padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: #091522; }
.payment-total span, .payment-total strong { display: block; }
.payment-total span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
.payment-total strong { margin-top: 6px; font: 800 33px Manrope; }
.payment-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.payment-method { min-height: 74px; border: 1px solid var(--line); border-radius: 11px; background: #111f2f; font-weight: 700; }
.payment-method.active { border-color: var(--accent); background: rgba(242,84,63,.1); }
.tender-display { height: 54px; padding: 0 15px; display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: 10px; background: #081421; }
.tender-display span { color: var(--muted); font-size: 10px; }
.tender-display strong { font: 700 20px Manrope; }
.numpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.numpad button { height: 58px; border: 1px solid var(--line); border-radius: 10px; background: #111f2f; font: 700 17px Manrope; }
.numpad button:hover { background: #17283b; }
.numpad .wide { grid-column: span 2; }
.numpad .erase { color: #fca5a5; }
.quick-cash { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.quick-cash button { height: 37px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--cyan); font-size: 10px; }
.customer-search { display: flex; gap: 8px; margin-bottom: 14px; }
.customer-search input { flex: 1; height: 43px; padding: 0 13px; border: 1px solid var(--line); border-radius: 9px; background: #081421; color: white; }
.customer-results { display: grid; gap: 7px; max-height: 260px; overflow: auto; }
.customer-result { width: 100%; padding: 12px; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; border: 1px solid var(--line); border-radius: 9px; background: #111f2f; text-align: left; }
.customer-result small { color: var(--muted); }
.status-badge { align-self: center; padding: 4px 7px; border-radius: 999px; font-size: 8px; font-weight: 700; text-transform: uppercase; }
.status-in_progress { color: #67e8f9; background: rgba(34,211,238,.1); }
.status-open { color: #86efac; background: rgba(74,222,128,.1); }
.status-waiting_payment { color: #fbbf24; background: rgba(251,191,36,.1); }
.check-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.check-card { padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: #111f2f; text-align: left; }
.check-card header, .check-card footer { display: flex; align-items: center; justify-content: space-between; }
.check-card h3 { margin: 10px 0 3px; font: 700 14px Manrope; }
.check-card p { margin: 0 0 12px; color: var(--muted); font-size: 10px; }
.check-card footer { color: var(--muted); font-size: 10px; }
.check-card footer strong { color: white; font: 700 14px Manrope; }
.menu-color-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; max-height: 470px; overflow-y: auto; }
.menu-color-item { --setup-color: var(--cyan); position: relative; padding: 12px 13px 12px 17px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #111f2f; }
.menu-color-item::before, .menu-color-item::after { content: ""; position: absolute; top: 0; bottom: 0; width: 4px; background: var(--setup-color); }
.menu-color-item::before { left: 0; }
.menu-color-item::after { right: 0; }
.menu-color-copy strong, .menu-color-copy small { display: block; }
.menu-color-copy strong { font: 700 11px Manrope; }
.menu-color-copy small { max-width: 190px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 8px; }
.menu-color-picker { width: 42px; height: 34px; padding: 2px; border: 1px solid var(--line-strong); border-radius: 7px; background: #081421; cursor: pointer; }
.color-presets { margin-top: 16px; display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.color-presets > span { margin-right: 4px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.color-preset { width: 28px; height: 28px; border: 2px solid rgba(255,255,255,.22); border-radius: 50%; background: var(--preset-color); }
.color-preset:hover { transform: scale(1.08); border-color: white; }
.json-preview { max-height: 430px; margin: 0; padding: 16px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: #06101a; color: #9de3d7; font: 10px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; }
.report-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.report-card { padding: 16px; border: 1px solid var(--line); border-radius: 11px; background: #111f2f; }
.report-card span, .report-card strong { display: block; }
.report-card span { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.report-card strong { margin-top: 9px; font: 800 23px Manrope; }
.report-card small { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; }
.report-table { width: 100%; margin-top: 18px; border-collapse: collapse; font-size: 11px; }
.report-table th, .report-table td { padding: 11px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.report-table th { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.report-table td:last-child, .report-table th:last-child { text-align: right; }
.sale-success { padding: 16px; text-align: center; }
.success-mark { display: grid; place-items: center; width: 62px; height: 62px; margin: 0 auto 14px; border-radius: 50%; background: rgba(52,211,153,.12); color: var(--green); font-size: 30px; }
.sale-success h2 { font-size: 24px; }
.sale-success p { color: var(--muted); }
.change-due { margin: 18px 0; padding: 16px; border-radius: 11px; background: #081421; }
.change-due span, .change-due strong { display: block; }
.change-due span { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.change-due strong { margin-top: 4px; font: 800 28px Manrope; }
.slip-preview-wrap { padding: 20px; display: grid; place-items: start center; overflow: auto; border-radius: 12px; background: #07111d; }
.slip-paper { width: 80mm; min-height: 120mm; margin: 0; padding: 9mm 6mm; overflow: visible; background: white; color: #111; box-shadow: 0 12px 32px rgba(0,0,0,.28); font: 10pt/1.28 "Courier New", ui-monospace, monospace; white-space: pre-wrap; }

.keyboard { position: fixed; z-index: 30; left: 50%; bottom: 12px; width: min(820px, calc(100vw - 24px)); padding: 10px; display: none; transform: translateX(-50%); border: 1px solid var(--line-strong); border-radius: 14px; background: rgba(10,22,36,.98); box-shadow: var(--shadow); }
.keyboard.open { display: block; }
.keyboard-row { display: flex; justify-content: center; gap: 6px; margin: 6px 0; }
.keyboard button { min-width: 43px; height: 43px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; background: #15273a; font-size: 12px; font-weight: 700; }
.keyboard button:hover { background: #20364d; }
.keyboard .space { width: 280px; }
.keyboard .special { color: var(--cyan); }
.toast-region { position: fixed; z-index: 50; right: 18px; top: 88px; display: grid; gap: 8px; }
.toast { min-width: 260px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 9px; background: #142437; box-shadow: var(--shadow); font-size: 11px; animation: toast-in .18s ease-out; }
.toast.success { border-color: rgba(52,211,153,.3); }
.toast.error { border-color: rgba(248,113,113,.35); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } }

:root[data-theme="light"] body { background: radial-gradient(circle at 72% -10%, rgba(8,127,123,.12), transparent 34%), linear-gradient(180deg, #f6f9fc 0%, #e9f0f6 100%); }
:root[data-theme="light"] .topbar { background: rgba(255,255,255,.94); }
:root[data-theme="light"] .location-pill { color: #405068; background: rgba(255,255,255,.65); }
:root[data-theme="light"] .location-pill:not(.sql-offline) { background: #eaf8f2; }
:root[data-theme="light"] .location-pill.sql-offline { background: #fff8e7; }
:root[data-theme="light"] .top-button,
:root[data-theme="light"] .preference-button { background: #fff; color: #405068; }
:root[data-theme="light"] .top-button:hover,
:root[data-theme="light"] .preference-button:hover { background: #edf4f8; color: #172033; }
:root[data-theme="light"] .store-check-top { background: #e9f8f6; }
:root[data-theme="light"] .store-check-top strong { color: #176963; }
:root[data-theme="light"] .check-panel { background: rgba(255,255,255,.92); }
:root[data-theme="light"] .catalog-panel { background: rgba(242,247,251,.82); }
:root[data-theme="light"] .customer-strip,
:root[data-theme="light"] .check-meta select,
:root[data-theme="light"] .search-wrap input,
:root[data-theme="light"] .secondary-button,
:root[data-theme="light"] .weight-controls button,
:root[data-theme="light"] .payment-method,
:root[data-theme="light"] .numpad button,
:root[data-theme="light"] .customer-result,
:root[data-theme="light"] .check-card,
:root[data-theme="light"] .menu-color-item,
:root[data-theme="light"] .report-card { background: #fff; color: var(--ink); }
:root[data-theme="light"] .search-wrap input,
:root[data-theme="light"] .field input,
:root[data-theme="light"] .field select,
:root[data-theme="light"] .field textarea,
:root[data-theme="light"] .customer-search input { background: #fff; color: var(--ink); }
:root[data-theme="light"] .catalog-control-strip { background: rgba(255,255,255,.72); }
:root[data-theme="light"] .category-tab,
:root[data-theme="light"] .product-card,
:root[data-theme="light"] .admin-function-button { background: linear-gradient(150deg, #ffffff, #eef4f8); color: #334155; box-shadow: 0 6px 18px rgba(37,55,79,.06); }
:root[data-theme="light"] .category-tab:hover,
:root[data-theme="light"] .admin-function-button:hover,
:root[data-theme="light"] .numpad button:hover { background: #e5eef5; color: #172033; }
:root[data-theme="light"] .category-tab.active { background: linear-gradient(145deg, rgba(242,84,63,.2), rgba(242,84,63,.07)); color: #9f2f20; }
:root[data-theme="light"] .touch-selector strong { color: #173f45; }
:root[data-theme="light"] .touch-selector.order-type-selector strong { color: #77372e; }
:root[data-theme="light"] .check-choice-button,
:root[data-theme="light"] .choice-card,
:root[data-theme="light"] .inline-choice { background: #fff; color: var(--ink); }
:root[data-theme="light"] .line-item:hover { background: rgba(23,32,51,.035); }
:root[data-theme="light"] .totals strong,
:root[data-theme="light"] .totals .grand-total,
:root[data-theme="light"] .totals .grand-total strong,
:root[data-theme="light"] .check-card footer strong { color: var(--ink); }
:root[data-theme="light"] .modal-layer { background: rgba(35,48,65,.42); }
:root[data-theme="light"] .modal,
:root[data-theme="light"] .modal-head { background: #f8fbfd; }
:root[data-theme="light"] .modal-head > .close-modal { background: #edf3f7; }
:root[data-theme="light"] .scale-readout { background: #effaf7; }
:root[data-theme="light"] .payment-total,
:root[data-theme="light"] .tender-display,
:root[data-theme="light"] .change-due { background: #eef4f8; }
:root[data-theme="light"] .json-preview { background: #f0f6f5; color: #176963; }
:root[data-theme="light"] .menu-color-picker { background: #eef4f8; }
:root[data-theme="light"] .keyboard { background: rgba(247,250,252,.98); }
:root[data-theme="light"] .keyboard button { background: #fff; color: #27364b; }
:root[data-theme="light"] .toast { background: #fff; color: var(--ink); }
:root[data-theme="light"] .slip-preview-wrap { background: #dce5ec; }

@media print {
  @page { size: 80mm auto; margin: 0; }
  body { width: 80mm; min-height: 0; background: white !important; overflow: visible; }
  body * { visibility: hidden !important; }
  .slip-paper { position: absolute; left: 0; top: 0; width: 80mm; min-height: 0; padding: 5mm 4mm; visibility: visible !important; box-shadow: none; color: #000 !important; background: #fff !important; font-size: 9.5pt; }
}

@media (max-width: 1100px) {
  .top-button { padding: 0 10px; }
  .top-button span { display: none; }
  .brand { min-width: 280px; }
  .product-grid { grid-template-columns: repeat(auto-fill, 142px); }
  .product-card { width: 142px; }
}

@media (max-width: 860px) {
  body { overflow: auto; }
  .app-shell { height: auto; min-height: 100vh; overflow: visible; }
  .topbar { position: sticky; top: 0; z-index: 10; height: 64px; padding: 0 12px; gap: 6px; }
  .brand { min-width: 0; }
  .brand div, .clock { display: none; }
  .location-pill { min-height: 40px; padding: 0 9px; gap: 6px; font-size: 9px; white-space: nowrap; }
  .top-actions { gap: 6px; }
  .top-button { width: 44px; padding: 0; justify-content: center; font-size: 0; }
  .top-button span { display: inline; font-size: 17px; }
  .top-button strong { display: none; }
  .register-layout { display: block; }
  .check-panel { min-height: 520px; border-right: 0; }
  .catalog-panel { min-height: 640px; }
  .product-grid { grid-template-columns: repeat(2, 138px); grid-auto-rows: 94px; }
  .product-card { width: 138px; height: 94px; min-height: 94px; }
  .scale-status { min-width: 48px; width: 48px; grid-template-columns: 1fr; }
  .scale-status span:not(.scale-icon), .scale-status i { display: none; }
  .report-cards { grid-template-columns: repeat(2, 1fr); }
  .keypad-layout { grid-template-columns: 1fr; }
  .check-list { grid-template-columns: 1fr; }
  .menu-color-grid { grid-template-columns: 1fr; }
}

@media (max-height: 760px) and (min-width: 861px) {
  .topbar { height: 62px; }
  .catalog-toolbar { min-height: 62px; padding-top: 9px; padding-bottom: 9px; }
  .category-tabs { min-height: 50px; }
  .catalog-heading { padding-top: 13px; }
  .product-grid { grid-auto-rows: 88px; }
  .product-card { height: 88px; min-height: 88px; }
}
