/*
 * LedgerLite POS — dedicated checkout surface.
 *
 * Same brand tokens as the Books SPA (ink / emerald / gold), but tuned for a
 * busy till: large tap targets, high contrast totals, no chrome the cashier
 * does not need.
 */

:root {
  --ink: #0c1a2e;
  --ink-mid: #142540;
  --ink-light: #1b3358;
  --emerald: #00b87c;
  --emerald-dk: #009a67;
  --emerald-lt: #e6f9f3;
  --amber: #f59e0b;
  --amber-lt: #fef3c7;
  --rose: #f43f5e;
  --rose-lt: #fff1f2;
  --sky: #0ea5e9;
  --sky-lt: #e0f2fe;

  --bg: #eff3f8;
  --surface: #ffffff;
  --surface-2: #f8fafd;
  --border: #e2e8f0;
  --border-dk: #cbd5e1;
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;

  --shadow-xs: 0 1px 3px rgba(15, 23, 42, 0.07);
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.09);
  --shadow-md: 0 4px 20px rgba(15, 23, 42, 0.1);
  --shadow-lg: 0 18px 50px rgba(15, 23, 42, 0.18);

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;

  --top-h: 66px;
  --ease: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --font: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
[hidden] { display: none !important; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--border-dk); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ─────────── TOP BAR ─────────── */
.pos-top {
  height: var(--top-h);
  flex: 0 0 var(--top-h);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 18px;
  background: var(--ink);
  color: #fff;
  z-index: 20;
}
.pos-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pos-brand-mark {
  width: 34px; height: 34px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--emerald), var(--emerald-dk));
  color: #04231a;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: -0.02em;
}
.pos-brand-text { display: flex; flex-direction: column; min-width: 0; }
.pos-brand-text strong { font-size: 14px; letter-spacing: -0.01em; }
.pos-brand-sub { font-size: 11.5px; color: rgba(255,255,255,0.55); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pos-org-select {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  color: #fff;
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 12px;
  max-width: 200px;
}
.pos-org-select option { color: var(--text); }

.pos-nav { display: flex; gap: 4px; background: rgba(255,255,255,0.06); padding: 4px; border-radius: 12px; }
.pos-nav-btn {
  color: rgba(255,255,255,0.62);
  font-size: 13px;
  font-weight: 500;
  padding: 7px 16px;
  border-radius: 9px;
  transition: background var(--ease), color var(--ease);
}
.pos-nav-btn:hover { color: #fff; }
.pos-nav-btn.is-active { background: var(--emerald); color: #03251a; font-weight: 700; }

.pos-top-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.pos-status {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px;
  color: rgba(255,255,255,0.72);
  background: rgba(255,255,255,0.07);
  padding: 6px 11px;
  border-radius: 999px;
  white-space: nowrap;
}
.pos-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); flex: 0 0 7px; }
.pos-status.is-online .pos-dot { background: var(--emerald); box-shadow: 0 0 0 3px rgba(0,184,124,0.18); }
.pos-status.is-offline .pos-dot { background: var(--amber); box-shadow: 0 0 0 3px rgba(245,158,11,0.18); }
.pos-status.is-error .pos-dot { background: var(--rose); }

.pos-outbox-btn {
  background: rgba(245,158,11,0.16);
  border: 1px solid rgba(245,158,11,0.4);
  color: #fcd34d;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: 999px;
}
.pos-register { display: flex; flex-direction: column; gap: 2px; font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: rgba(255,255,255,0.45); }
.pos-register select {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  color: #fff;
  border-radius: 8px;
  padding: 4px 6px;
  font-size: 12px;
  max-width: 160px;
  text-transform: none;
  letter-spacing: 0;
}
.pos-register option { color: var(--text); }

.pos-shift-pill {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.85);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 12px;
  white-space: nowrap;
}
.pos-shift-pill .pos-dot { background: var(--text-3); }
.pos-shift-pill.is-open { border-color: rgba(0,184,124,0.45); }
.pos-shift-pill.is-open .pos-dot { background: var(--emerald); }
.pos-shift-pill.is-closed { border-color: rgba(244,63,94,0.4); }
.pos-shift-pill.is-closed .pos-dot { background: var(--rose); }

.pos-user { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: rgba(255,255,255,0.8); }
.pos-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255,255,255,0.12);
  font-weight: 700; font-size: 12px;
}

/* ─────────── VIEWS ─────────── */
.pos-view { flex: 1 1 auto; min-height: 0; display: none; }
.pos-view.is-active { display: flex; }
.pos-page { display: none; overflow-y: auto; padding: 22px 26px 40px; flex-direction: column; gap: 18px; }
.pos-page.is-active { display: flex; }
.pos-page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.pos-page-head h1 { font-size: 22px; letter-spacing: -0.02em; }
.pos-page-head p { color: var(--text-2); font-size: 13px; margin-top: 4px; max-width: 620px; }
.pos-page-actions { display: flex; gap: 8px; align-items: center; }

/* ─────────── CATALOGUE ─────────── */
#view-sell { display: none; }
#view-sell.is-active { display: grid; grid-template-columns: minmax(0, 1fr) 392px; }
.pos-catalogue { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.pos-cat-toolbar {
  padding: 14px 18px 10px;
  display: flex; flex-direction: column; gap: 10px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.pos-search {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 0 12px;
  height: 46px;
  transition: border-color var(--ease), box-shadow var(--ease);
}
.pos-search:focus-within { border-color: var(--emerald); box-shadow: 0 0 0 3px rgba(0,184,124,0.12); }
.pos-search svg { width: 18px; height: 18px; color: var(--text-3); }
.pos-search input { flex: 1; border: 0; background: none; outline: none; font-size: 15px; }
.pos-search kbd, .pos-pay-btn kbd {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-3);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 1px 5px;
  background: var(--surface);
}
.pos-categories { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 2px; }
.pos-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 500;
  padding: 6px 13px;
  border-radius: 999px;
  white-space: nowrap;
  transition: all var(--ease);
}
.pos-chip-icon { display: inline-flex; align-items: center; color: var(--category-color, #64748b); }
.pos-chip-icon svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.pos-chip:hover { border-color: var(--border-dk); }
.pos-chip.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.pos-chip.is-active .pos-chip-icon { color: #fff; }

.pos-grid-wrap { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 18px 28px; }
.pos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 12px;
}
.pos-product {
  position: relative;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px;
  display: flex; flex-direction: column; gap: 8px;
  min-height: 120px;
  transition: transform var(--ease), box-shadow var(--ease), border-color var(--ease);
}
.pos-product:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); border-color: var(--border-dk); }
.pos-product:active { transform: translateY(0); }
.pos-product.is-low { border-color: rgba(245,158,11,0.5); }
.pos-product.is-out { opacity: 0.55; }
.pos-product-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.pos-product-name { font-size: 13.5px; font-weight: 600; line-height: 1.3; }
.pos-product-sku { font-family: var(--mono); font-size: 10px; color: var(--text-3); }
.pos-product-price { margin-top: auto; font-size: 15px; font-weight: 700; color: var(--ink); }
.pos-product-stock { font-size: 10.5px; color: var(--text-3); }
.pos-product-stock.low { color: var(--amber); font-weight: 600; }
.pos-product-stock.out { color: var(--rose); font-weight: 600; }
.pos-badge {
  font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 2px 7px; border-radius: 999px;
}
.pos-badge.out { background: var(--rose-lt); color: #b91c1c; }
.pos-badge.low { background: var(--amber-lt); color: #92400e; }

.pos-empty { padding: 60px 20px; text-align: center; color: var(--text-3); font-size: 14px; }

/* ─────────── CART ─────────── */
.pos-cart {
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  min-height: 0;
}
.pos-cart-head {
  padding: 16px 18px 12px;
  display: flex; align-items: flex-start; justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.pos-cart-head h2 { font-size: 15px; letter-spacing: -0.01em; }
.pos-cart-head p { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.pos-customer-picker { display: flex; flex-direction: column; gap: 6px; padding: 11px 14px 0; color: var(--text-2); font-size: 11px; font-weight: 700; }
.pos-customer-picker select { width: 100%; min-width: 0; height: 36px; padding: 0 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--text); font-size: 12px; }
.pos-text-btn { font-size: 12px; color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; }
.pos-text-btn:hover { color: var(--rose); }

.pos-cart-lines { flex: 1; overflow-y: auto; padding: 8px 12px; }
.pos-cart-lines:empty { flex: 0 0 0; padding: 0; overflow: hidden; }
.pos-cart-empty { flex: 1; padding: 48px 20px; text-align: center; color: var(--text-3); font-size: 13px; }
.pos-cart-empty svg { width: 34px; height: 34px; margin-bottom: 12px; opacity: 0.5; }

.pos-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 10px;
  padding: 10px;
  border-radius: var(--r-md);
  transition: background var(--ease);
}
.pos-line:hover { background: var(--surface-2); }
.pos-line-name { font-size: 13px; font-weight: 600; }
.pos-line-sub { font-size: 11px; color: var(--text-3); font-family: var(--mono); }
.pos-line-total { font-size: 13px; font-weight: 700; text-align: right; }
.pos-line-controls { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; }
.pos-qty { display: flex; align-items: center; gap: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.pos-qty button { width: 28px; height: 28px; font-size: 15px; color: var(--text-2); }
.pos-qty button:hover { background: var(--surface-2); }
.pos-qty input { width: 46px; height: 28px; border: 0; text-align: center; font-size: 12.5px; font-family: var(--mono); background: none; }
.pos-line-del { margin-left: auto; color: var(--text-3); font-size: 12px; }
.pos-line-del:hover { color: var(--rose); }
.pos-line-discount { font-size: 10.5px; color: var(--emerald-dk); font-weight: 600; }

.pos-cart-foot { border-top: 1px solid var(--border); padding: 12px 16px 16px; background: var(--surface); }
.pos-discount-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.pos-discount-row label { font-size: 12px; color: var(--text-2); }
.pos-discount-input { display: flex; align-items: center; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; height: 32px; }
.pos-discount-input input { width: 76px; border: 0; text-align: right; padding: 0 8px; outline: none; font-family: var(--mono); font-size: 12.5px; }
.pos-discount-input select { border: 0; border-left: 1px solid var(--border); height: 100%; background: var(--surface-2); font-size: 12px; padding: 0 6px; }

.pos-totals { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.pos-totals > div { display: flex; justify-content: space-between; font-size: 13px; }
.pos-totals dt { color: var(--text-2); }
.pos-totals dd { font-family: var(--mono); font-weight: 500; }
.pos-totals .pos-muted dd { color: var(--text-2); }
.pos-grand { border-top: 1px dashed var(--border-dk); padding-top: 10px; margin-top: 4px; }
.pos-grand dt { font-weight: 700 !important; color: var(--text) !important; font-size: 15px; }
.pos-grand dd { font-size: 19px !important; font-weight: 700 !important; }

.pos-pay-btn {
  width: 100%;
  height: 54px;
  border-radius: var(--r-md);
  background: var(--emerald);
  color: #04231a;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 600;
  transition: background var(--ease), transform var(--ease);
}
.pos-pay-btn strong { font-size: 18px; font-family: var(--mono); }
.pos-pay-btn:hover:not(:disabled) { background: #00d18c; }
.pos-pay-btn:active:not(:disabled) { transform: scale(0.995); }
.pos-pay-btn:disabled { background: var(--border); color: var(--text-3); cursor: not-allowed; }
.pos-pay-btn kbd { background: rgba(0,0,0,0.08); border-color: rgba(0,0,0,0.12); color: rgba(4,35,26,0.6); }

/* ─────────── BUTTONS / FORM CONTROLS ─────────── */
.pos-btn {
  height: 36px;
  padding: 0 14px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: background var(--ease), border-color var(--ease), opacity var(--ease);
  border: 1px solid transparent;
  white-space: nowrap;
}
.pos-btn-primary { background: var(--emerald); color: #04231a; }
.pos-btn-primary:hover { background: #00d18c; }
.pos-btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text-2); }
.pos-btn-ghost:hover { border-color: var(--border-dk); color: var(--text); }
.pos-btn-danger { background: var(--rose-lt); color: #b91c1c; border-color: rgba(244,63,94,0.25); }
.pos-btn-danger:hover { background: #ffe4e6; }
.pos-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.pos-btn-lg { height: 44px; padding: 0 22px; font-size: 14px; }
.pos-icon-btn { width: 32px; height: 32px; border-radius: 8px; color: var(--text-3); font-size: 15px; }
.pos-icon-btn:hover { background: var(--surface-2); color: var(--text); }
.pos-select {
  height: 36px; border: 1px solid var(--border); border-radius: 9px;
  background: var(--surface); padding: 0 10px; font-size: 13px; color: var(--text-2);
}

/* ─────────── PAYMENT MODAL ─────────── */
.pos-overlay {
  position: fixed; inset: 0;
  background: rgba(8, 15, 11, 0.55);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  z-index: 60;
}
.pos-modal {
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 40px);
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: pos-pop 0.16s ease-out;
}
.pos-modal-sm { max-width: 420px; }
.pos-modal-wide { max-width: 760px; }
@keyframes pos-pop { from { opacity: 0; transform: translateY(8px) scale(0.99); } to { opacity: 1; transform: none; } }
.pos-modal-head { display: flex; justify-content: space-between; gap: 12px; padding: 18px 20px 12px; border-bottom: 1px solid var(--border); }
.pos-modal-head h2 { font-size: 17px; letter-spacing: -0.01em; }
.pos-modal-head p { font-size: 12.5px; color: var(--text-2); margin-top: 3px; }
.pos-modal-body { padding: 16px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.pos-modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

.pos-due {
  display: flex; justify-content: space-between; align-items: baseline;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 13px 16px;
}
.pos-due span { font-size: 13px; color: var(--text-2); }
.pos-due strong { font-size: 24px; font-family: var(--mono); }

.pos-tender-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr auto;
  gap: 8px; align-items: end;
  padding: 10px; border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface);
}
.pos-tender-row .pos-field { display: flex; flex-direction: column; gap: 4px; }
.pos-field label { font-size: 11px; color: var(--text-2); font-weight: 600; }
.pos-field input, .pos-field select, .pos-field textarea {
  height: 38px; border: 1px solid var(--border); border-radius: 8px;
  padding: 0 10px; outline: none; font-size: 14px; background: var(--surface);
  transition: border-color var(--ease), box-shadow var(--ease);
}
.pos-field textarea { height: auto; min-height: 74px; padding: 9px 10px; resize: vertical; }
.pos-field input:focus, .pos-field select:focus, .pos-field textarea:focus {
  border-color: var(--emerald); box-shadow: 0 0 0 3px rgba(0,184,124,0.1);
}
.pos-field input.mono { font-family: var(--mono); }
.pos-tender-row .pos-icon-btn { align-self: center; }
.pos-add-tender { align-self: flex-start; }
.pos-quick-cash { display: flex; gap: 6px; flex-wrap: wrap; }
.pos-quick-cash button {
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 12px; padding: 5px 10px; background: var(--surface);
  font-family: var(--mono); color: var(--text-2);
}
.pos-quick-cash button:hover { border-color: var(--emerald); color: var(--emerald-dk); }

.pos-pay-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pos-pay-summary > div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px; }
.pos-pay-summary span { display: block; font-size: 11px; color: var(--text-2); margin-bottom: 3px; }
.pos-pay-summary strong { font-family: var(--mono); font-size: 14px; }
.pos-hint { font-size: 12px; color: var(--text-2); min-height: 16px; }
.pos-hint.is-error { color: #b91c1c; }
.pos-hint.is-warn { color: #92400e; }

/* ─────────── RECEIPT ─────────── */
.pos-modal-receipt { max-width: 420px; }
.pos-receipt {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
  background: #fff;
  padding: 8px 4px;
}
.pos-receipt h3 { font-family: var(--font); font-size: 16px; text-align: center; letter-spacing: -0.01em; }
.pos-receipt .r-muted { color: var(--text-2); }
.pos-receipt .r-center { text-align: center; }
.pos-receipt .r-sep { border-top: 1px dashed var(--border-dk); margin: 10px 0; }
.pos-receipt table { width: 100%; border-collapse: collapse; }
.pos-receipt td, .pos-receipt th { padding: 3px 0; vertical-align: top; text-align: left; }
.pos-receipt .r-right { text-align: right; }
.pos-receipt .r-total { font-size: 15px; font-weight: 700; }
.pos-receipt .r-badge {
  display: inline-block; font-family: var(--font); font-size: 10.5px; font-weight: 700;
  padding: 3px 9px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.05em;
}
.pos-receipt .r-badge.pending { background: var(--amber-lt); color: #92400e; }
.pos-receipt .r-badge.synced { background: var(--emerald-lt); color: var(--emerald-dk); }

/* ─────────── TABLES ─────────── */
.pos-summary-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.pos-kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px 14px; }
.pos-kpi span { font-size: 11.5px; color: var(--text-2); }
.pos-kpi strong { display: block; margin-top: 4px; font-size: 18px; font-family: var(--mono); letter-spacing: -0.02em; }
.pos-kpi.is-accent { border-color: rgba(0,184,124,0.3); background: linear-gradient(180deg, #f2fdf8, var(--surface)); }
.pos-report-date { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 12px; font-weight: 600; }
.pos-report-date input { height: 36px; padding: 0 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--text); }
.pos-report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.pos-design-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 12px; }
.pos-design-card { min-width: 0; padding: 18px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-xs); }
.pos-design-card > h2 { margin: 0 0 14px; color: var(--ink); font-size: 14px; font-weight: 800; }
.pos-design-stat-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); color: var(--text-2); font-size: 12px; }
.pos-design-stat-row strong { color: var(--ink); font-family: var(--mono); white-space: nowrap; }
.pos-design-card > .pos-btn { margin-top: 14px; }
.pos-week-chart { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; min-height: 150px; align-items: end; }
.pos-week-day { display: flex; min-width: 0; height: 150px; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; }
.pos-week-day strong { max-width: 100%; overflow: hidden; color: var(--text-2); font-family: var(--mono); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.pos-week-day small { color: var(--text-3); font-size: 10px; }
.pos-week-bar-wrap { display: flex; align-items: flex-end; width: min(34px, 75%); height: 100px; overflow: hidden; border-radius: 7px 7px 2px 2px; background: #edf2f7; }
.pos-week-bar { display: block; width: 100%; min-height: 4px; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, #22ad82, #087c5e); }
.pos-report-bar-row { display: grid; grid-template-columns: minmax(70px, 1fr) minmax(70px, 1fr) auto; gap: 5px 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 11px; }
.pos-report-bar-row > span:first-child { overflow: hidden; color: var(--text-2); text-overflow: ellipsis; white-space: nowrap; }
.pos-report-bar-track { height: 7px; overflow: hidden; border-radius: 10px; background: #edf2f7; }
.pos-report-bar-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #159a72, #ddbd76); }
.pos-report-bar-row strong { color: var(--ink); font-family: var(--mono); white-space: nowrap; }
.pos-report-bar-row small { grid-column: 1 / -1; color: var(--text-3); font-size: 10px; }
.pos-design-card .pos-table-wrap { border: 0; box-shadow: none; }
.pos-report-card { min-width: 0; padding: 16px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-xs); }
.pos-report-card h2 { margin: 0 0 10px; color: var(--ink); font-size: 14px; }
.pos-report-card .pos-table-wrap { border: 0; }
.pos-report-card .pos-table th:first-child,
.pos-report-card .pos-table td:first-child { padding-left: 8px; }
.pos-report-card .pos-table th:last-child,
.pos-report-card .pos-table td:last-child { padding-right: 8px; }
@media (max-width: 760px) { .pos-report-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .pos-report-date { width: 100%; } .pos-report-date input { flex: 1; min-width: 0; } }

.pos-table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); overflow: auto; }
.pos-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 720px; }
.pos-table th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-3); font-weight: 600; padding: 10px 14px;
  border-bottom: 1px solid var(--border); background: var(--surface-2); position: sticky; top: 0;
}
.pos-table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.pos-table tr:last-child td { border-bottom: 0; }
.pos-table tr:hover td { background: var(--surface-2); }
.pos-table .num { text-align: right; font-family: var(--mono); }
.pos-table .r-actions { display: flex; gap: 6px; justify-content: flex-end; }
.pos-table .link { color: var(--emerald-dk); font-weight: 600; font-size: 12px; }
.pos-table .link:hover { text-decoration: underline; }
.pos-tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 999px;
  text-transform: capitalize;
}
.pos-tag.completed { background: var(--emerald-lt); color: var(--emerald-dk); }
.pos-tag.partially_refunded { background: var(--sky-lt); color: #0369a1; }
.pos-tag.refunded { background: #ede9fe; color: #6d28d9; }
.pos-tag.voided { background: var(--rose-lt); color: #b91c1c; }
.pos-tag.pending-sync { background: var(--amber-lt); color: #92400e; }
.pos-tag.rejected { background: var(--rose-lt); color: #b91c1c; }
.pos-tag.failed { background: var(--rose-lt); color: #b91c1c; }

/* ─────────── SHIFT ─────────── */
.pos-shift-detail { display: grid; gap: 16px; grid-template-columns: 1.15fr 1fr; align-items: start; }
.pos-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 18px; }
.pos-card h2 { font-size: 15px; margin-bottom: 4px; }
.pos-card > p { font-size: 12.5px; color: var(--text-2); margin-bottom: 14px; }
.pos-kv { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.pos-kv:last-child { border-bottom: 0; }
.pos-kv span { color: var(--text-2); }
.pos-kv strong { font-family: var(--mono); }
.pos-kv.is-total strong { font-size: 17px; }
.pos-kv.is-short strong { color: #b91c1c; }
.pos-kv.is-over strong { color: #92400e; }
.pos-movement-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.pos-movement { display: flex; justify-content: space-between; font-size: 12px; background: var(--surface-2); border-radius: 8px; padding: 8px 10px; }
.pos-movement strong { font-family: var(--mono); }

/* ─────────── SETTINGS ─────────── */
.pos-settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.pos-settings fieldset {
  border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 16px; background: var(--surface); display: flex; flex-direction: column; gap: 12px;
}
.pos-settings legend { font-size: 12px; font-weight: 700; color: var(--text-2); padding: 0 6px; text-transform: uppercase; letter-spacing: 0.05em; }
.pos-settings .pos-field label { font-size: 12px; }
.pos-check { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-2); }
.pos-check input { width: 17px; height: 17px; accent-color: var(--emerald); }
.pos-bank-choice-list { display: grid; gap: 8px; max-height: 240px; overflow-y: auto; }
.pos-bank-choice { align-items: flex-start; padding: 10px 11px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.pos-bank-choice strong { color: var(--text); }
.pos-bank-choice input { flex: 0 0 17px; margin-top: 1px; }
.pos-settings .pos-hint { min-height: 0; line-height: 1.5; }

/* Financial-report inspired polish: restrained navy, ledger green and gold. */
.pos-page { background: linear-gradient(180deg, #f6f8fb 0, var(--bg) 240px); }
.pos-page-head { padding-bottom: 14px; border-bottom: 1px solid var(--border-dk); }
.pos-page-head > div:first-child::before {
  content: "LEDGERLITE · POINT OF SALE";
  display: block; margin-bottom: 7px; color: var(--emerald-dk);
  font-size: 9px; font-weight: 800; letter-spacing: 0.15em;
}
.pos-page-head h1 { color: var(--ink); font-size: 24px; font-weight: 800; }
.pos-kpi { position: relative; overflow: hidden; box-shadow: var(--shadow-xs); }
.pos-kpi::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: #d5deea; }
.pos-kpi.is-accent::before { background: linear-gradient(180deg, var(--emerald), #d6a84f); }
.pos-kpi span { text-transform: uppercase; letter-spacing: 0.07em; font-size: 9px; font-weight: 700; }
.pos-kpi strong { color: var(--ink); font-size: 19px; }
.pos-table-wrap { box-shadow: var(--shadow-xs); }
.pos-table th { color: #51627a; background: #eef2f7; border-bottom-color: #d8e0e9; }
.pos-table td { font-variant-numeric: tabular-nums; }
.pos-card { box-shadow: var(--shadow-xs); }

.pos-offline-pin-btn {
  border: 1px solid rgba(0,184,124,0.35); border-radius: 999px;
  padding: 7px 11px; color: #a7f3d0; background: rgba(0,184,124,0.1);
  font-size: 11px; font-weight: 700; white-space: nowrap;
}
.pos-offline-pin-btn:hover { background: rgba(0,184,124,0.2); }
.pos-modal form { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.pos-modal form .pos-modal-body { flex: 1 1 auto; }
.pos-offline-gate {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  padding: 22px; background: radial-gradient(ellipse at top right, rgba(0,184,124,0.14), transparent 38%),
    linear-gradient(145deg, #091629, #10243d 62%, #132c43);
  overflow-y: auto;
}
.pos-offline-gate-card {
  width: min(100%, 440px); padding: 34px; color: #f8fafc;
  border: 1px solid rgba(255,255,255,0.12); border-top: 3px solid var(--emerald);
  border-radius: 22px; background: rgba(8,22,40,0.86); box-shadow: 0 28px 80px rgba(0,0,0,0.35);
}
.pos-offline-gate-card .pos-brand-mark { margin-bottom: 28px; }
.pos-eyebrow { color: #78e2b8; font-size: 9px; font-weight: 800; letter-spacing: 0.16em; }
.pos-offline-gate-card h1 { margin: 8px 0 12px; font-size: 27px; letter-spacing: -0.04em; }
.pos-offline-gate-message { margin: 0 0 20px; color: #cad5e3; font-size: 13px; line-height: 1.55; }
.pos-offline-gate-message.is-warn { color: #fcd98b; }
.pos-offline-gate-message.is-error { color: #fda4af; }
#offlineUnlockForm { display: flex; flex-direction: column; gap: 10px; }
#offlineUnlockForm label { color: #d4deeb; font-size: 11px; font-weight: 700; }
#offlinePinInput { height: 48px; border: 1px solid rgba(255,255,255,0.18); border-radius: 10px; padding: 0 14px; color: #fff; background: rgba(255,255,255,0.08); font-size: 20px; letter-spacing: 0.3em; font-family: var(--mono); outline: none; }
#offlinePinInput:focus { border-color: var(--emerald); box-shadow: 0 0 0 3px rgba(0,184,124,0.16); }
#offlineUnlockButton { width: 100%; margin-top: 4px; }
.pos-offline-online-link { display: inline-block; margin-top: 18px; color: #a7f3d0; font-size: 12px; font-weight: 700; text-decoration: none; }
.pos-offline-online-link:hover { text-decoration: underline; }
.pos-offline-gate-note { margin-top: 22px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,0.12); color: #91a1b6; font-size: 11px; line-height: 1.55; }

/* ─────────── TOAST ─────────── */
.pos-toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: var(--ink); color: #fff; font-size: 13px;
  padding: 11px 18px; border-radius: 999px; box-shadow: var(--shadow-md);
  z-index: 80; max-width: min(92vw, 560px); text-align: center;
}
.pos-toast.is-error { background: #7f1d1d; }
.pos-toast.is-ok { background: #064e3b; }

/* ─────────── RESPONSIVE ─────────── */
@media (max-width: 1150px) {
  #view-sell.is-active { grid-template-columns: minmax(0, 1fr) 340px; }
  .pos-brand-sub { max-width: 140px; }
  .pos-user-name { display: none; }
}
@media (max-width: 900px) {
  /* Stack the till: catalogue on top, cart underneath, page scrolls as one. */
  html, body { height: auto; min-height: 100%; overflow: auto; }
  .pos-view { flex: none; }
  .pos-top { height: auto; flex-wrap: wrap; padding: 10px 12px; gap: 8px; }
  .pos-brand { flex: 1 1 auto; }
  .pos-brand-sub { max-width: 150px; }
  .pos-nav { order: 3; width: 100%; overflow-x: auto; }
  .pos-nav-btn { flex: 1 0 auto; padding: 7px 10px; font-size: 12.5px; }
  .pos-top-right { gap: 6px; flex-wrap: wrap; margin-left: 0; width: 100%; justify-content: space-between; }
  .pos-register span { display: none; }
  .pos-register select { max-width: 130px; }
  .pos-shift-pill span:last-child, .pos-status span:last-child { display: none; }
  .pos-shift-pill, .pos-status { padding: 6px 9px; }
  .pos-shift-detail { grid-template-columns: 1fr; }
  #view-sell.is-active { display: flex; flex-direction: column; }
  .pos-catalogue { min-height: 0; }
  .pos-grid-wrap { flex: none; overflow: visible; padding: 12px 12px 16px; }
  .pos-cart { border-left: 0; border-top: 1px solid var(--border); }
  .pos-cart-lines { max-height: none; overflow: visible; }
  .pos-cart-empty { padding: 28px 18px; }
  .pos-page { padding: 16px 14px 40px; }
  .pos-grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
  .pos-product { min-height: 108px; padding: 12px; }
  .pos-modal { max-height: calc(100vh - 24px); }
  .pos-pay-summary { grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
  .pos-pay-summary strong { font-size: 12.5px; }
}

@media (max-width: 560px) {
  .pos-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pos-pay-summary { grid-template-columns: 1fr; }
  .pos-tender-row { grid-template-columns: 1fr 1fr; }
  .pos-summary-strip { grid-template-columns: 1fr 1fr; }
  .pos-kpi strong { font-size: 16px; }
}

.pos-discount-approval {
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding: 14px;
  border: 1px solid #f1d59a;
  border-radius: var(--r-md);
  background: #fffbeb;
}
.pos-discount-approval[hidden] { display: none; }
.pos-discount-approval h3 { margin: 0 0 4px; color: #78350f; font-size: 13px; }
.pos-discount-approval p { color: #7c5c29; font-size: 11.5px; line-height: 1.45; }
.pos-discount-approval .pos-field { gap: 6px; }
.pos-discount-approval textarea,
.pos-discount-approval input {
  width: 100%;
  border: 1px solid #e7d2a7;
  border-radius: var(--r-sm);
  padding: 9px 10px;
  background: #fff;
  color: var(--text);
  font: inherit;
  outline: none;
}
.pos-discount-approval textarea { min-height: 64px; resize: vertical; }
.pos-discount-approval textarea:focus,
.pos-discount-approval input:focus { border-color: var(--emerald); box-shadow: 0 0 0 3px rgba(0,184,124,0.12); }
.pos-discount-approval-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pos-discount-approval-actions .pos-hint { min-height: 0; }
.pos-approval-code {
  padding: 17px 14px;
  border: 1px dashed var(--emerald);
  border-radius: var(--r-md);
  background: #f0fdf4;
  color: #064e3b;
  font: 800 24px/1.2 var(--mono);
  letter-spacing: 0.13em;
  text-align: center;
  user-select: all;
  overflow-wrap: anywhere;
}

/* ─────────── PRINT (receipt only) ─────────── */
@media print {
  body { background: #fff; overflow: visible; }
  body > *:not(#receiptModal) { display: none !important; }
  #receiptModal { position: static; background: none; padding: 0; backdrop-filter: none; }
  #receiptModal .pos-modal { box-shadow: none; max-width: 80mm; max-height: none; border-radius: 0; }
  .no-print { display: none !important; }
  .pos-receipt { font-size: 11px; }
}

/* ─────────── REFERENCE-ALIGNED STANDALONE POS SHELL ─────────── */
:root { --font: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
  background: var(--bg);
}
.pos-sidebar {
  grid-column: 1;
  grid-row: 1;
  width: 232px;
  min-width: 232px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 12px 12px;
  overflow-x: hidden;
  overflow-y: auto;
  color: #b7c4d6;
  background: var(--ink);
  border-right: 1px solid rgba(255,255,255,0.05);
}
.pos-brand {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 3px 8px 11px;
  color: #fff;
  text-decoration: none;
}
.pos-brand:hover { color: #fff; text-decoration: none; }
.pos-brand-mark {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(145deg, #fff, #dce8f4);
  color: var(--ink);
}
.pos-brand-text { gap: 2px; min-width: 0; }
.pos-brand-text strong { color: #fff; font-size: 14px; font-weight: 800; }
.pos-brand-sub { color: #10d49a; font-size: 9px; font-weight: 800; letter-spacing: 0.18em; }
.pos-sidebar-org {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  margin: 2px 2px 10px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  background: var(--ink-mid);
  color: #fff;
}
.pos-org-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #fb923c;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}
.pos-sidebar-org-info { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.pos-sidebar-org-name { overflow: hidden; color: #fff; font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.pos-sidebar-org-caption { color: #8fa3bf; font-size: 10px; }
.pos-org-select {
  grid-column: 1 / -1;
  width: 100%;
  max-width: none;
  color: #fff;
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.14);
}
.pos-nav {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: stretch;
  gap: 3px;
  min-height: 0;
  padding: 0;
  overflow-y: auto;
  border-radius: 0;
  background: transparent;
}
.pos-nav-btn,
.pos-nav-link {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  border: 0;
  border-radius: 9px;
  color: #b7c4d6;
  background: transparent;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.2;
  text-align: left;
  text-decoration: none;
  transition: background var(--ease), color var(--ease);
}
.pos-nav-btn:hover,
.pos-nav-link:hover { color: #fff; background: rgba(255,255,255,0.06); text-decoration: none; }
.pos-nav-btn.is-active {
  color: #34d399;
  background: rgba(16,185,129,0.16);
  font-weight: 700;
}
.pos-nav-btn svg,
.pos-nav-link svg {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.pos-nav-settings { margin-top: auto; }
.pos-sidebar-user {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin-top: 8px;
  padding: 12px 8px 4px;
  border-top: 1px solid rgba(255,255,255,0.09);
  color: #fff;
}
.pos-sidebar-user .pos-avatar { flex: 0 0 34px; width: 34px; height: 34px; background: var(--emerald-dk); }
.pos-sidebar-user-info { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.pos-sidebar-user .pos-user-name { display: block; overflow: hidden; color: #fff; font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.pos-sidebar-user small { color: #8fa3bf; font-size: 10px; }
.pos-workspace {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}
.pos-top {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 20px;
  height: auto;
  min-height: 76px;
  padding: 13px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  z-index: 20;
}
.pos-heading { min-width: 180px; }
.pos-eyebrow { margin-bottom: 3px; color: var(--emerald-dk); font-size: 8.5px; font-weight: 800; letter-spacing: 0.16em; }
.pos-heading h1 { color: var(--ink); font-size: 19px; font-weight: 800; letter-spacing: -0.035em; line-height: 1.2; }
.pos-page-subtitle { margin-top: 3px; color: var(--text-2); font-size: 11px; }
.pos-overview-stats { display: none; }
.pos-top-right {
  display: flex;
  flex: 0 1 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
  margin-left: auto;
}
.pos-status {
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.pos-status.is-online .pos-dot { background: var(--emerald-dk); }
.pos-status.is-offline .pos-dot { background: var(--amber); }
.pos-outbox-btn { color: #92400e; background: var(--amber-lt); border: 1px solid #f5d28c; }
.pos-offline-pin-btn { color: var(--emerald-dk); background: var(--emerald-lt); border-color: #b7ead9; }
.pos-offline-pin-btn:hover { background: #d6f4e9; }
.pos-register { color: var(--text-3); }
.pos-register select {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
}
.pos-register option { color: var(--text); }
.pos-shift-pill { color: var(--text-2); background: var(--surface-2); border-color: var(--border); }
.pos-shift-pill.is-open { color: #047857; background: var(--emerald-lt); }
.pos-shift-pill.is-closed { color: #be123c; background: var(--rose-lt); }
.pos-view { width: 100%; min-width: 0; }
.pos-page { min-height: 0; }

@media (max-width: 1150px) {
  .pos-top { gap: 12px; padding-right: 14px; padding-left: 14px; }
  .pos-top-right { gap: 6px; }
}

@media (max-width: 900px) {
  html, body { height: auto; min-height: 100%; overflow: auto; }
  body { display: flex; flex-direction: column; }
  .pos-sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    width: 100%;
    min-width: 0;
    min-height: 52px;
    flex: 0 0 auto;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    overflow: hidden;
  }
  .pos-brand { gap: 7px; padding: 0; }
  .pos-brand-mark { flex-basis: 32px; width: 32px; height: 32px; border-radius: 9px; }
  .pos-brand-text strong { font-size: 12px; }
  .pos-brand-sub { display: none; }
  .pos-sidebar-org, .pos-sidebar-user { display: none; }
  .pos-nav { flex: 1 1 auto; flex-direction: row; gap: 3px; min-width: 0; overflow-x: auto; overflow-y: hidden; }
  .pos-nav-btn, .pos-nav-link { width: auto; min-width: max-content; min-height: 34px; padding: 7px 9px; gap: 6px; font-size: 11px; }
  .pos-nav-btn svg, .pos-nav-link svg { flex-basis: 15px; width: 15px; height: 15px; }
  .pos-nav-settings { margin-top: 0; }
  .pos-workspace { grid-column: auto; grid-row: auto; min-height: calc(100vh - 52px); overflow: visible; }
  .pos-top { min-height: 0; flex-wrap: wrap; gap: 8px 12px; padding: 11px 12px; }
  .pos-heading { flex: 1 1 180px; }
  .pos-heading h1 { font-size: 17px; }
  .pos-page-subtitle { max-width: 100%; }
  .pos-top-right { flex: 1 1 100%; width: 100%; justify-content: flex-start; flex-wrap: wrap; margin-left: 0; }
  .pos-register span { display: none; }
  .pos-register select { max-width: 130px; }
  .pos-shift-pill span:last-child, .pos-status span:last-child { display: none; }
  .pos-shift-pill, .pos-status { padding: 6px 9px; }
  .pos-shift-detail { grid-template-columns: 1fr; }
  #view-sell.is-active { display: flex; flex-direction: column; }
  .pos-catalogue { min-height: 0; }
  .pos-grid-wrap { flex: none; overflow: visible; padding: 12px 12px 16px; }
  .pos-cart { border-left: 0; border-top: 1px solid var(--border); }
  .pos-cart-lines { max-height: none; overflow: visible; }
  .pos-cart-empty { padding: 28px 18px; }
  .pos-page { padding: 16px 14px 40px; }
  .pos-grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
  .pos-product { min-height: 108px; padding: 12px; }
  .pos-modal { max-height: calc(100vh - 24px); }
  .pos-pay-summary { grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
  .pos-pay-summary strong { font-size: 12.5px; }
}

@media (max-width: 560px) {
  .pos-sidebar { padding-left: 8px; padding-right: 8px; }
  .pos-brand-text { display: none; }
  .pos-nav-btn, .pos-nav-link { padding: 7px 8px; }
  .pos-nav-btn span, .pos-nav-link span { font-size: 10.5px; }
  .pos-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pos-pay-summary { grid-template-columns: 1fr; }
  .pos-tender-row { grid-template-columns: 1fr 1fr; }
  .pos-summary-strip { grid-template-columns: 1fr 1fr; }
  .pos-kpi strong { font-size: 16px; }
}

/* ─────────── POS QUICK ACTIONS + CASHIER SWITCH ─────────── */
.pos-sidebar-user {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background var(--ease);
}
.pos-sidebar-user:hover { background: rgba(255,255,255,0.05); }
.pos-sidebar-user:focus-visible { outline: 2px solid #34d399; outline-offset: 2px; }
.pos-sidebar-user-info { flex: 1 1 auto; }
.pos-sidebar-user .pos-switch-cashier-icon { color: #8fa3bf; font-size: 18px; }
.pos-search-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pos-search-row .pos-search { flex: 1 1 auto; min-width: 0; }
.pos-catalogue-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.pos-catalogue-actions .pos-btn { min-height: 40px; padding: 0 13px; white-space: nowrap; }
.pos-parked-sale { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.pos-parked-sale:last-child { border-bottom: 0; }
.pos-parked-sale-info { display: flex; min-width: 0; flex-direction: column; gap: 4px; }
.pos-parked-sale-info strong { overflow: hidden; color: var(--ink); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.pos-parked-sale-info span { color: var(--text-2); font-size: 11px; }
.pos-parked-sale-actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.pos-parked-sale-actions .pos-btn { min-height: 34px; padding: 0 11px; }
.pos-embed-access-denied { margin: 22px; padding: 24px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-xs); }
.pos-embed-access-denied h2 { color: var(--ink); font-size: 18px; }
.pos-embed-access-denied p { margin-top: 7px; color: var(--text-2); font-size: 13px; line-height: 1.55; }
#offlineCashierSelect {
  height: 44px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 10px;
  padding: 0 12px;
  color: #fff;
  background: #142540;
  font-size: 14px;
}
#offlineCashierSelect option { color: var(--text); background: #fff; }
#cancelOfflineSwitchBtn { margin-top: 12px; }

/* Books supplies its own navigation rail. In this mode the POS contributes
   only the checkout workspace and uses its live metrics, not a second rail. */
html.ll-pos-books-embed,
html.ll-pos-books-embed body { height: 100%; min-height: 0; }
html.ll-pos-books-embed body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
}
html.ll-pos-books-embed .pos-sidebar { display: none !important; }
html.ll-pos-books-embed .pos-workspace {
  grid-column: 1;
  grid-row: 1;
  min-height: 0;
  overflow: hidden;
  background: #f5f7fb;
}
html.ll-pos-books-embed .pos-top {
  flex: 0 0 auto;
  min-height: 122px;
  margin: 16px 18px 0;
  padding: 20px 24px;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(112deg, #0c1a2e 0%, #142b4b 58%, #21436a 100%);
  color: #fff;
  box-shadow: 0 10px 28px rgba(12,26,46,0.14);
}
html.ll-pos-books-embed .pos-heading { min-width: 210px; }
html.ll-pos-books-embed .pos-heading h1 { color: #fff; font-size: 24px; }
html.ll-pos-books-embed .pos-eyebrow { color: #6ee7b7; }
html.ll-pos-books-embed .pos-page-subtitle { color: #c2d0e1; font-size: 12px; }
html.ll-pos-books-embed .pos-overview-stats {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 2.6vw, 36px);
  min-width: 210px;
  margin-left: auto;
}
html.ll-pos-books-embed .pos-overview-stats > div { display: flex; flex-direction: column; gap: 7px; min-width: 82px; }
html.ll-pos-books-embed .pos-overview-stats span { color: #b5c4d8; font-size: 10px; font-weight: 600; }
html.ll-pos-books-embed .pos-overview-stats strong { color: #fff; font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
html.ll-pos-books-embed .pos-top-right { gap: 7px; }
html.ll-pos-books-embed .pos-status,
html.ll-pos-books-embed .pos-register,
html.ll-pos-books-embed .pos-shift-pill {
  color: #e5edf7;
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.16);
}
html.ll-pos-books-embed .pos-status { font-size: 10px; padding: 6px 8px; }
html.ll-pos-books-embed .pos-register { font-size: 10px; }
html.ll-pos-books-embed .pos-register select { color: #fff; background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.18); }
html.ll-pos-books-embed .pos-register option { color: var(--text); }
html.ll-pos-books-embed .pos-shift-pill { font-size: 10px; }
html.ll-pos-books-embed .pos-shift-pill.is-open { color: #a7f3d0; background: rgba(16,185,129,0.14); }
html.ll-pos-books-embed .pos-shift-pill.is-closed { color: #fecdd3; background: rgba(244,63,94,0.12); }
html.ll-pos-books-embed .pos-offline-pin-btn { color: #baf7df; background: rgba(16,185,129,0.12); border-color: rgba(110,231,183,0.35); }
html.ll-pos-books-embed .pos-outbox-btn { padding: 6px 9px; font-size: 10px; }
html.ll-pos-books-embed .pos-cat-toolbar { padding: 16px 18px 12px; }
html.ll-pos-books-embed .pos-catalogue-actions #addPosProductBtn { display: inline-flex; }
html.ll-pos-books-embed .pos-embed-access-denied { margin-top: 18px; }

@media (max-width: 900px) {
  .pos-sidebar-user {
    display: flex;
    flex: 0 0 34px;
    justify-content: center;
    width: 34px;
    min-width: 34px;
    margin: 0 0 0 2px;
    padding: 0;
    border: 0;
    border-left: 1px solid rgba(255,255,255,0.12);
    border-radius: 0;
  }
  .pos-sidebar-user-info,
  .pos-sidebar-user .pos-switch-cashier-icon { display: none; }
  .pos-sidebar-user .pos-avatar { flex: 0 0 30px; width: 30px; height: 30px; }
  .pos-search-row { flex-wrap: wrap; }
  .pos-search-row .pos-search { flex: 1 1 100%; }
  .pos-catalogue-actions { width: 100%; justify-content: flex-end; }
  html.ll-pos-books-embed,
  html.ll-pos-books-embed body { height: auto; min-height: 100%; overflow: auto; }
  html.ll-pos-books-embed body { display: flex; flex-direction: column; }
  html.ll-pos-books-embed .pos-workspace { min-height: 100vh; overflow: visible; }
  html.ll-pos-books-embed .pos-top { margin: 12px 12px 0; padding: 16px; }
  html.ll-pos-books-embed .pos-overview-stats { flex: 1 1 100%; justify-content: flex-start; margin-left: 0; }
}

@media (max-width: 560px) {
  .pos-catalogue-actions { justify-content: flex-start; }
  .pos-catalogue-actions .pos-btn { flex: 1 1 auto; }
  html.ll-pos-books-embed .pos-top { gap: 10px; padding: 14px; }
  html.ll-pos-books-embed .pos-heading { min-width: 100%; }
  html.ll-pos-books-embed .pos-heading h1 { font-size: 21px; }
  html.ll-pos-books-embed .pos-overview-stats { gap: 12px; min-width: 0; }
  html.ll-pos-books-embed .pos-overview-stats > div { min-width: 0; }
  html.ll-pos-books-embed .pos-overview-stats strong { font-size: 14px; }
}

#switchCashierModal .pos-modal-foot { justify-content: space-between; }
@media (max-width: 560px) {
  #switchCashierModal .pos-modal-foot { flex-wrap: wrap; }
  #switchCashierModal .pos-modal-foot .pos-btn { flex: 1 1 auto; }
}


/* ─────────── DESIGN-DOC POS DROP-INS ─────────── */
:root {
  --ink: #0b1a2e;
  --ink-mid: #14294a;
  --ink-light: #1d3557;
  --emerald: #10b981;
  --emerald-dk: #059669;
  --emerald-lt: #e6f9f3;
  --bg: #f3f6fa;
  --surface: #fff;
  --surface-2: #f7f9fc;
  --border: #e3e9f1;
  --border-dk: #d5deea;
  --text: #0f1b2d;
  --text-2: #6b7a90;
  --text-3: #8c9bb0;
  --shadow-xs: 0 1px 3px rgba(11,26,46,.06);
  --shadow-sm: 0 8px 22px rgba(11,26,46,.10);
  --shadow-md: 0 14px 36px rgba(11,26,46,.14);
  --shadow-lg: 0 22px 60px rgba(11,26,46,.22);
  --r-sm: 9px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --ink: #0a1320;
  --ink-mid: #101d30;
  --ink-light: #1d2d44;
  --emerald: #10b981;
  --emerald-dk: #34d399;
  --emerald-lt: #0e2a2a;
  --amber-lt: #3a2d16;
  --rose-lt: #3b1d2a;
  --sky-lt: #132f42;
  --bg: #0a1320;
  --surface: #101d30;
  --surface-2: #0e1a2b;
  --border: #1d2d44;
  --border-dk: #2b3d57;
  --text: #e8eef6;
  --text-2: #a8b5c8;
  --text-3: #8da0b8;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #0a1320;
    --ink-mid: #101d30;
    --ink-light: #1d2d44;
    --emerald: #10b981;
    --emerald-dk: #34d399;
    --emerald-lt: #0e2a2a;
    --amber-lt: #3a2d16;
    --rose-lt: #3b1d2a;
    --sky-lt: #132f42;
    --bg: #0a1320;
    --surface: #101d30;
    --surface-2: #0e1a2b;
    --border: #1d2d44;
    --border-dk: #2b3d57;
    --text: #e8eef6;
    --text-2: #a8b5c8;
    --text-3: #8da0b8;
    color-scheme: dark;
  }
}

body { background: var(--bg); color: var(--text); }
.pos-icon { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pos-icon-btn { display: inline-grid; place-items: center; }
.pos-icon-btn .pos-icon { width: 16px; height: 16px; }
.pos-page { background: var(--bg); }
.pos-page-head { border-bottom-color: var(--border); }
.pos-page-head > div:first-child::before { display: none; }
.pos-design-card { border-radius: 16px; }
.pos-table th { color: var(--text-2); background: var(--surface-2); border-bottom-color: var(--border); }
.pos-table td { color: var(--text); }
.pos-product-count, .pos-cart-count {
  display: inline-grid;
  place-items: center;
  min-width: 23px;
  height: 23px;
  padding: 0 6px;
  border-radius: 999px;
  color: #fff;
  background: var(--emerald-dk);
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.pos-product-count[hidden] { display: none; }
.pos-cart-count { margin-left: 6px; vertical-align: 2px; }
.pos-permission-check { width: 17px; height: 17px; vertical-align: middle; fill: none; stroke: var(--emerald-dk); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

/* Standalone reference: persistent navy rail; the till owns its rail and
   keeps register, connection, offline and shift tools directly beneath nav. */
html.ll-pos-standalone body {
  grid-template-columns: 210px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  background: var(--bg);
}
html.ll-pos-standalone .pos-sidebar {
  width: 210px;
  min-width: 210px;
  gap: 8px;
  padding: 16px 12px 12px;
  background: var(--ink);
}
html.ll-pos-standalone .pos-brand { padding: 2px 8px 16px; }
html.ll-pos-standalone .pos-brand-mark {
  background: #fff;
  color: var(--ink);
  border-radius: 9px;
}
html.ll-pos-standalone .pos-sidebar-org { margin: 0 0 6px; background: var(--ink-mid); }
html.ll-pos-standalone .pos-org-avatar { background: #fb923c; border-radius: 8px; }
html.ll-pos-standalone .pos-nav { flex: 1 1 auto; gap: 2px; overflow-y: auto; }
html.ll-pos-standalone .pos-nav-btn { min-height: 38px; padding: 8px 10px; border-radius: 9px; }
html.ll-pos-standalone .pos-nav-btn.is-active { color: #34d399; background: rgba(16,185,129,.16); }
html.ll-pos-standalone .pos-nav-settings { margin-top: auto; }
html.ll-pos-standalone .pos-sidebar-tools { flex: 0 0 auto; margin: 4px 0 2px; }
html.ll-pos-standalone .pos-sidebar-tools .pos-top-right {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 7px;
  width: 100%;
  margin: 0;
}
html.ll-pos-standalone .pos-sidebar-tools .pos-status,
html.ll-pos-standalone .pos-sidebar-tools .pos-outbox-btn,
html.ll-pos-standalone .pos-sidebar-tools .pos-offline-pin-btn,
html.ll-pos-standalone .pos-sidebar-tools .pos-shift-pill {
  justify-content: flex-start;
  width: 100%;
  min-height: 34px;
  padding: 7px 9px;
  border-radius: 9px;
  font-size: 11px;
}
html.ll-pos-standalone .pos-sidebar-tools .pos-status { color: #b7c4d6; background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.08); }
html.ll-pos-standalone .pos-sidebar-tools .pos-register {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 38px;
  padding: 5px 8px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 9px;
  color: #8fa3bf;
  background: rgba(255,255,255,.04);
  font-size: 10px;
}
html.ll-pos-standalone .pos-sidebar-tools .pos-register span { display: inline; }
html.ll-pos-standalone .pos-sidebar-tools .pos-register select {
  max-width: 112px;
  width: 112px;
  padding: 5px 6px;
  color: #fff;
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.12);
  font-size: 10px;
}
html.ll-pos-standalone .pos-sidebar-tools .pos-register option { color: #0f1b2d; }
html.ll-pos-standalone .pos-sidebar-tools .pos-shift-pill { color: #dce6f2; background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.1); }
html.ll-pos-standalone .pos-sidebar-tools .pos-shift-pill.is-open { color: #a7f3d0; background: rgba(16,185,129,.12); border-color: rgba(16,185,129,.3); }
html.ll-pos-standalone .pos-sidebar-tools .pos-shift-pill.is-closed { color: #fecdd3; background: rgba(244,63,94,.10); border-color: rgba(244,63,94,.2); }
html.ll-pos-standalone .pos-sidebar-tools .pos-offline-pin-btn { color: #a7f3d0; background: rgba(16,185,129,.1); border-color: rgba(16,185,129,.24); text-align: left; }
html.ll-pos-standalone .pos-sidebar-tools .pos-outbox-btn { color: #fcd34d; background: rgba(245,158,11,.12); border-color: rgba(245,158,11,.25); text-align: left; }
html.ll-pos-standalone .pos-workspace { min-height: 0; background: var(--bg); }
html.ll-pos-standalone .pos-workspace > .pos-top { display: none; }
html.ll-pos-standalone #view-sell.is-active {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 370px;
  min-height: 0;
}
html.ll-pos-standalone .pos-catalogue { min-height: 0; background: var(--bg); }
html.ll-pos-standalone .pos-cat-toolbar { gap: 10px; padding: 18px 22px 12px; border: 0; background: transparent; }
html.ll-pos-standalone .pos-search { height: 44px; border-radius: 12px; background: var(--surface); }
html.ll-pos-standalone .pos-search input { font-size: 14px; }
html.ll-pos-standalone .pos-search kbd { background: var(--surface-2); }
html.ll-pos-standalone .pos-categories { gap: 8px; padding: 0 0 2px; }
html.ll-pos-standalone .pos-chip { padding: 8px 14px; background: var(--surface); font-size: 12px; font-weight: 700; }
html.ll-pos-standalone .pos-chip.is-active { color: #fff; background: var(--emerald-dk); border-color: var(--emerald-dk); }
html.ll-pos-standalone .pos-grid-wrap { padding: 2px 22px 24px; }
html.ll-pos-standalone .pos-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
html.ll-pos-standalone .pos-product {
  min-height: 174px;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--border);
  border-top: 3px solid var(--product-color, var(--emerald));
  border-radius: 16px;
  background: var(--surface);
}
html.ll-pos-standalone .pos-product:hover { border-color: var(--border-dk); border-top-color: var(--product-color, var(--emerald)); box-shadow: 0 8px 22px rgba(11,26,46,.12); }
html.ll-pos-standalone .pos-product[disabled] { opacity: .55; cursor: not-allowed; transform: none; }
.pos-product-icon, .pos-line-icon {
  display: grid;
  flex: 0 0 44px;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  color: var(--product-color, var(--emerald-dk));
  background: color-mix(in srgb, var(--product-color, var(--emerald)) 16%, transparent);
}
.pos-product-icon svg, .pos-line-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
html.ll-pos-standalone .pos-product-name { min-height: 34px; font-size: 13px; font-weight: 700; line-height: 1.3; }
html.ll-pos-standalone .pos-product-sku { color: var(--text-3); font-family: var(--mono); }
html.ll-pos-standalone .pos-product-price { margin-top: auto; font-size: 17px; font-weight: 800; }
html.ll-pos-standalone .pos-product.is-unpriced .pos-product-price { color: var(--text-2); font-size: 12px; }
html.ll-pos-standalone .pos-product-stock { color: var(--text-2); font-size: 11px; font-weight: 700; }
html.ll-pos-standalone .pos-product-stock.low { color: #b45309; }
html.ll-pos-standalone .pos-product-stock.out { color: #e11d48; }
html.ll-pos-standalone .pos-badge { align-self: flex-start; }
html.ll-pos-standalone .pos-badge.out { color: #e11d48; background: rgba(244,63,94,.15); }
html.ll-pos-standalone .pos-badge.low { color: #b45309; background: rgba(245,158,11,.18); }
html.ll-pos-standalone .pos-badge.unpriced { color: var(--text-2); background: var(--surface-2); }
html.ll-pos-standalone .pos-product-count { position: absolute; top: 10px; right: 10px; background: var(--emerald); }
html.ll-pos-standalone .pos-empty { display: flex; align-items: center; justify-content: center; gap: 9px; padding: 48px 20px; color: var(--text-2); }
html.ll-pos-standalone .pos-empty svg { width: 24px; height: 24px; fill: none; stroke: var(--text-3); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
html.ll-pos-standalone .pos-empty span { max-width: 420px; }
html.ll-pos-standalone .pos-cart { border-left: 1px solid var(--border); background: var(--surface); }
html.ll-pos-standalone .pos-cart-head { align-items: center; padding: 18px 20px 12px; }
html.ll-pos-standalone .pos-cart-head h2 { font-size: 17px; font-weight: 800; }
html.ll-pos-standalone .pos-cart-head p { color: var(--text-2); }
html.ll-pos-standalone .pos-cart-count { background: var(--emerald); }
html.ll-pos-standalone .pos-cart-empty { color: var(--text-2); }
html.ll-pos-standalone .pos-cart-empty svg { opacity: .55; }
html.ll-pos-standalone .pos-cart-lines { padding: 0 20px; }
.pos-line {
  grid-template-columns: 40px minmax(0,1fr) auto;
  gap: 8px 10px;
  padding: 11px 0;
  border-bottom: 1px dashed var(--border);
}
.pos-line-icon { grid-column: 1; grid-row: 1 / span 2; flex-basis: 40px; width: 40px; height: 40px; border-radius: 11px; }
.pos-line-icon svg { width: 20px; height: 20px; }
.pos-line-info { grid-column: 2; grid-row: 1; min-width: 0; }
.pos-line-name { color: var(--text); font-size: 13px; font-weight: 700; }
.pos-line-sub { margin-top: 2px; color: var(--text-2); font-family: var(--font); font-size: 11px; }
.pos-line-total { grid-column: 3; grid-row: 1; font-size: 13px; font-weight: 800; }
.pos-line-controls { grid-column: 2 / 4; grid-row: 2; }
html.ll-pos-standalone .pos-line-del { display: grid; place-items: center; width: 28px; height: 28px; margin-left: auto; border-radius: 7px; }
html.ll-pos-standalone .pos-line-del:hover { color: var(--rose); background: var(--rose-lt); }
html.ll-pos-standalone .pos-qty button { background: var(--surface-2); }
html.ll-pos-standalone .pos-cart-foot { padding: 14px 20px 18px; background: var(--emerald-lt); }
html.ll-pos-standalone .pos-totals { gap: 3px; }
html.ll-pos-standalone .pos-grand { margin-top: 9px; }
html.ll-pos-standalone .pos-grand dd { font-size: 26px !important; font-weight: 800 !important; }
html.ll-pos-standalone .pos-pay-btn { height: 54px; border-radius: 12px; color: #fff; background: var(--emerald); font-weight: 700; }
html.ll-pos-standalone .pos-pay-btn:hover:not(:disabled) { background: #059669; }
html.ll-pos-standalone .pos-pay-btn:disabled { color: var(--text-3); background: var(--border); }
html.ll-pos-standalone .pos-pay-btn kbd { color: rgba(255,255,255,.8); background: rgba(0,0,0,.12); border-color: rgba(0,0,0,.12); }
html.ll-pos-standalone .pos-sidebar-user { border-top-color: rgba(255,255,255,.12); }
html.ll-pos-standalone .pos-sidebar-user .pos-avatar { background: var(--emerald-dk); }
html.ll-pos-standalone .pos-switch-cashier-icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Books reference drop-in: the Books rail is outside this frame, the POS
   hero sits over the catalogue column, while the live cart spans both rows. */
html.ll-pos-books-embed .pos-workspace { background: var(--bg); }
html.ll-pos-books-embed #view-sell.is-active {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 390px);
  grid-template-rows: minmax(122px, auto) minmax(0, 1fr);
  gap: 0;
  min-height: 0;
  padding: 16px 18px 18px;
  overflow: hidden;
}
html.ll-pos-books-embed #view-sell > .pos-top {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
  min-height: 122px;
  margin: 0;
  padding: 16px 20px;
  border: 0;
  border-radius: 18px 18px 0 0;
  color: #fff;
  background: linear-gradient(120deg, #0b1a2e, #12305a);
  box-shadow: 0 8px 22px rgba(11,26,46,.12);
}
html.ll-pos-books-embed .pos-heading { min-width: 190px; }
html.ll-pos-books-embed .pos-eyebrow { color: #6ee7b7; font-size: 9px; }
html.ll-pos-books-embed .pos-heading h1 { color: #fff; font-size: 20px; font-weight: 800; }
html.ll-pos-books-embed .pos-page-subtitle { color: #9fb3ce; font-size: 12px; }
html.ll-pos-books-embed .pos-overview-stats {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 2.2vw, 28px);
  min-width: 160px;
  margin-left: auto;
}
html.ll-pos-books-embed .pos-overview-stats > div { display: flex; flex-direction: column; gap: 4px; min-width: 60px; }
html.ll-pos-books-embed .pos-overview-stats span { color: #9fb3ce; font-size: 10px; font-weight: 600; }
html.ll-pos-books-embed .pos-overview-stats strong { color: #fff; font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
html.ll-pos-books-embed .pos-top-right-slot { flex: 0 0 auto; min-width: 0; }
html.ll-pos-books-embed .pos-top-right { gap: 6px; }
html.ll-pos-books-embed .pos-status,
html.ll-pos-books-embed .pos-register,
html.ll-pos-books-embed .pos-shift-pill {
  color: #e5edf7;
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.16);
}
html.ll-pos-books-embed .pos-status { padding: 6px 8px; font-size: 10px; }
html.ll-pos-books-embed .pos-register { color: #9fb3ce; font-size: 9px; }
html.ll-pos-books-embed .pos-register select { color: #fff; background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.18); }
html.ll-pos-books-embed .pos-register option { color: #0f1b2d; }
html.ll-pos-books-embed .pos-shift-pill { padding: 6px 8px; font-size: 10px; }
html.ll-pos-books-embed .pos-shift-pill.is-open { color: #a7f3d0; background: rgba(16,185,129,.14); }
html.ll-pos-books-embed .pos-shift-pill.is-closed { color: #fecdd3; background: rgba(244,63,94,.12); }
html.ll-pos-books-embed .pos-offline-pin-btn { color: #baf7df; background: rgba(16,185,129,.12); border-color: rgba(110,231,183,.35); }
html.ll-pos-books-embed .pos-outbox-btn { padding: 6px 8px; font-size: 10px; }
html.ll-pos-books-embed .pos-catalogue { grid-column: 1; grid-row: 2; overflow: hidden; background: var(--bg); }
html.ll-pos-books-embed .pos-cat-toolbar { padding: 14px 4px 10px; border-bottom: 0; background: transparent; }
html.ll-pos-books-embed .pos-grid-wrap { padding: 2px 4px 8px; }
html.ll-pos-books-embed .pos-grid { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; }
html.ll-pos-books-embed .pos-product { min-height: 164px; border-top: 3px solid var(--product-color, var(--emerald)); border-radius: 16px; background: var(--surface); }
html.ll-pos-books-embed .pos-cart {
  grid-column: 2;
  grid-row: 1 / span 2;
  margin-left: 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  background: var(--surface);
}
html.ll-pos-books-embed .pos-cart-foot { background: var(--emerald-lt); }
html.ll-pos-books-embed .pos-embed-access-denied { position: absolute; inset: 140px 28px auto; z-index: 10; }

@media (max-width: 1180px) and (min-width: 901px) {
  html.ll-pos-books-embed #view-sell.is-active { grid-template-columns: minmax(0, 1fr) minmax(320px, 360px); padding: 12px; }
  html.ll-pos-books-embed #view-sell > .pos-top { flex-wrap: wrap; gap: 10px; padding: 14px; }
  html.ll-pos-books-embed .pos-heading { min-width: 150px; }
  html.ll-pos-books-embed .pos-overview-stats { gap: 10px; }
  html.ll-pos-books-embed .pos-overview-stats > div { min-width: 50px; }
  html.ll-pos-books-embed .pos-overview-stats strong { font-size: 15px; }
  html.ll-pos-books-embed .pos-top-right { flex-wrap: wrap; justify-content: flex-end; }
  html.ll-pos-books-embed .pos-cart { margin-left: 12px; }
}
@media (max-width: 900px) {
  html.ll-pos-standalone .pos-workspace > .pos-top { display: flex; }
  html.ll-pos-standalone .pos-sidebar-tools { display: none; }
  html.ll-pos-standalone .pos-sidebar { width: 100%; min-width: 0; }
  html.ll-pos-standalone #view-sell.is-active { display: flex; flex-direction: column; }
  html.ll-pos-standalone .pos-top-right-slot { display: flex; flex: 1 1 100%; width: 100%; }
  html.ll-pos-standalone .pos-sidebar-tools .pos-top-right { flex-direction: row; }
  html.ll-pos-standalone .pos-top-right { flex-wrap: wrap; gap: 6px; }
  html.ll-pos-standalone .pos-cart { min-height: 460px; }
  html.ll-pos-standalone .pos-line { grid-template-columns: 40px minmax(0,1fr) auto; }
  html.ll-pos-books-embed #view-sell.is-active {
    display: flex;
    flex-direction: column;
    gap: 0;
    height: auto;
    min-height: 0;
    padding: 12px;
    overflow: visible;
  }
  html.ll-pos-books-embed #view-sell > .pos-top { min-height: 0; flex-wrap: wrap; border-radius: 16px; }
  html.ll-pos-books-embed .pos-overview-stats { flex: 1 1 100%; justify-content: flex-start; margin-left: 0; }
  html.ll-pos-books-embed .pos-catalogue { overflow: visible; }
  html.ll-pos-books-embed .pos-cat-toolbar { padding: 14px 0 10px; }
  html.ll-pos-books-embed .pos-grid-wrap { padding: 0 0 14px; overflow: visible; }
  html.ll-pos-books-embed .pos-cart { min-height: 460px; margin: 0; border-radius: 16px; }
}
@media (max-width: 560px) {
  html.ll-pos-standalone .pos-cat-toolbar { padding: 14px 12px 10px; }
  html.ll-pos-standalone .pos-grid-wrap { padding: 0 12px 18px; }
  html.ll-pos-standalone .pos-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
  html.ll-pos-standalone .pos-product { min-height: 160px; padding: 12px; }
  html.ll-pos-standalone .pos-cart { min-height: 440px; }
  html.ll-pos-standalone .pos-search-row { gap: 8px; }
  html.ll-pos-books-embed #view-sell > .pos-top { gap: 10px; padding: 14px; }
  html.ll-pos-books-embed .pos-heading { min-width: 100%; }
  html.ll-pos-books-embed .pos-heading h1 { font-size: 21px; }
  html.ll-pos-books-embed .pos-overview-stats { gap: 14px; }
  html.ll-pos-books-embed .pos-overview-stats > div { min-width: 0; }
  html.ll-pos-books-embed .pos-overview-stats strong { font-size: 14px; }
}

/* Subscription recovery never exposes the till or deletes an offline queue. */
.pos-subscription-gate:not([hidden]) { position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; padding: 24px; overflow: auto; background: #f2f6fb; color: #16273b; }
.pos-subscription-card { width: min(100%, 560px); padding: clamp(24px, 6vw, 44px); background: white; border: 1px solid #dce5ed; border-radius: 22px; box-shadow: 0 18px 55px #18355817; }
.pos-subscription-card h1 { margin: 6px 0 12px; font-size: clamp(24px, 5vw, 32px); }
.pos-subscription-card p { line-height: 1.55; }
.pos-subscription-eyebrow { color: #3153b8; font-size: 12px; font-weight: 800; letter-spacing: .12em; }
.pos-subscription-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0; }
.pos-subscription-card label { display: block; margin-top: 18px; font-weight: 700; }
.pos-subscription-card select { display: block; width: 100%; margin-top: 8px; padding: 10px; border: 1px solid #cbd5e1; border-radius: 9px; background: white; color: inherit; }
.pos-subscription-note { color: #607083; font-size: 13px; }
.pos-subscription-card [hidden] { display: none !important; }
