:root {
  --bg: #eef3f8;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #edf3f9;
  --text: #0f172a;
  --muted: #64748b;
  --border: #dbe4ee;
  --primary: #2563eb;
  --primary-2: #0ea5e9;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --shadow: 0 18px 45px rgba(15, 23, 42, .10);
  --radius: 22px;
  --sidebar: #0f172a;
  --sidebar-soft: #18233a;
}

[data-theme="dark"] {
  --bg: #07111f;
  --surface: #0f172a;
  --surface-2: #111c30;
  --surface-3: #172236;
  --text: #e5edf7;
  --muted: #94a3b8;
  --border: #24334c;
  --shadow: 0 18px 55px rgba(0, 0, 0, .34);
  --sidebar: #050b14;
  --sidebar-soft: #111827;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, rgba(14,165,233,.13), transparent 26%), var(--bg);
  color: var(--text);
  min-height: 100vh;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.hidden { display: none !important; }

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  background: #08111f;
}
.auth-visual {
  position: relative;
  overflow: hidden;
  padding: 42px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: white;
  isolation: isolate;
}
.auth-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(135deg, rgba(8,17,31,.88), rgba(15,23,42,.40)), var(--auth-image);
  background-size: cover;
  background-position: center;
  z-index: -2;
  transform: scale(1.03);
}
.auth-visual::after {
  content: "";
  position: absolute;
  inset: auto -10% -25% -10%;
  height: 320px;
  background: radial-gradient(circle, rgba(56,189,248,.42), transparent 65%);
  z-index: -1;
}
.brand-mark {
  width: 48px; height: 48px; border-radius: 16px;
  background: linear-gradient(135deg, #38bdf8, #10b981);
  display: grid; place-items: center;
  box-shadow: 0 16px 40px rgba(16,185,129,.22);
  font-weight: 900;
  letter-spacing: -1px;
}
.auth-visual h1 { font-size: clamp(38px, 6vw, 78px); line-height: .94; margin: 0 0 18px; letter-spacing: -4px; }
.auth-visual p { max-width: 700px; color: rgba(255,255,255,.82); font-size: 18px; line-height: 1.7; }
.auth-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 32px; }
.auth-metric {
  padding: 18px; border-radius: 20px;
  background: rgba(255,255,255,.12);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,.18);
}
.auth-metric strong { display: block; font-size: 26px; }
.auth-metric span { color: rgba(255,255,255,.72); font-size: 13px; }
.auth-card-wrap { display: grid; place-items: center; padding: 34px; background: linear-gradient(180deg, #ffffff, #edf5ff); }
[data-theme="dark"] .auth-card-wrap { background: #07111f; }
.auth-card {
  width: min(470px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 30px;
}
.auth-card h2 { margin: 0 0 8px; font-size: 28px; letter-spacing: -1px; }
.auth-card p { margin: 0 0 24px; color: var(--muted); line-height: 1.5; }
.demo-accounts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 20px; }
.demo-account { border: 1px solid var(--border); background: var(--surface-2); border-radius: 15px; padding: 10px; font-size: 12px; color: var(--muted); }
.demo-account strong { color: var(--text); display: block; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 280px 1fr; }
.sidebar {
  background: linear-gradient(180deg, var(--sidebar), #09111f);
  color: #dbeafe;
  padding: 22px 18px;
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 18px;
  box-shadow: 14px 0 35px rgba(15,23,42,.18);
  z-index: 20;
}
.side-brand { display: flex; align-items: center; gap: 12px; padding: 6px 7px 18px; border-bottom: 1px solid rgba(255,255,255,.09); }
.side-brand .brand-mark { width: 44px; height: 44px; color: white; }
.side-brand strong { font-size: 18px; letter-spacing: -.5px; display: block; }
.side-brand span { color: #94a3b8; font-size: 12px; }
.nav { display: flex; flex-direction: column; gap: 5px; overflow: auto; padding-right: 4px; }
.nav::-webkit-scrollbar { width: 6px; }
.nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 10px; }
.nav-item {
  width: 100%; display: flex; align-items: center; gap: 10px;
  border: 0; background: transparent; color: #cbd5e1;
  padding: 12px 13px; border-radius: 15px; text-align: left;
  transition: .2s ease;
}
.nav-item:hover { background: rgba(255,255,255,.08); color: white; }
.nav-item.active { background: linear-gradient(135deg, rgba(37,99,235,.95), rgba(14,165,233,.82)); color: white; box-shadow: 0 12px 24px rgba(37,99,235,.25); }
.side-footer { margin-top: auto; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); border-radius: 20px; padding: 14px; }
.side-footer .role { display: inline-flex; margin-bottom: 8px; padding: 4px 9px; border-radius: 999px; background: rgba(16,185,129,.16); color: #86efac; font-size: 12px; }
.side-footer strong { display: block; color: white; }
.side-footer small { color: #94a3b8; }
.side-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }

.main { min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 15;
  display: flex; align-items: center; gap: 14px; justify-content: space-between;
  padding: 18px 26px;
  background: rgba(238,243,248,.82);
  backdrop-filter: blur(22px);
  border-bottom: 1px solid rgba(148,163,184,.22);
}
[data-theme="dark"] .topbar { background: rgba(7,17,31,.84); }
.mobile-menu { display: none; }
.topbar h1 { margin: 0; font-size: 25px; letter-spacing: -1px; }
.topbar p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.global-search { position: relative; flex: 1; max-width: 500px; }
.global-search input { padding-left: 42px; }
.global-search span { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.content { padding: 24px 26px 42px; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.card {
  background: linear-gradient(180deg, rgba(255,255,255,.86), rgba(255,255,255,.98));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
[data-theme="dark"] .card { background: linear-gradient(180deg, rgba(15,23,42,.90), rgba(15,23,42,.98)); }
.card-body { padding: 19px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 19px 19px 0; }
.card-title { margin: 0; font-size: 17px; letter-spacing: -.35px; }
.card-sub { color: var(--muted); margin: 5px 0 0; font-size: 13px; }
.kpi { position: relative; overflow: hidden; min-height: 132px; }
.kpi::after { content: ""; position: absolute; right: -36px; bottom: -60px; width: 150px; height: 150px; background: radial-gradient(circle, rgba(37,99,235,.20), transparent 65%); }
.kpi-icon { width: 43px; height: 43px; border-radius: 15px; display: grid; place-items: center; background: var(--surface-3); }
.kpi h3 { margin: 14px 0 7px; font-size: 27px; letter-spacing: -1px; }
.kpi p { margin: 0; color: var(--muted); font-size: 13px; }
.trend { margin-top: 10px; display: inline-flex; align-items: center; gap: 5px; font-size: 12px; border-radius: 999px; padding: 5px 9px; background: rgba(16,185,129,.12); color: #059669; }
.trend.down { background: rgba(239,68,68,.12); color: var(--danger); }

input, select, textarea {
  width: 100%; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); border-radius: 14px; padding: 11px 13px; outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
textarea { min-height: 94px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: rgba(37,99,235,.72); box-shadow: 0 0 0 4px rgba(37,99,235,.12); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.form-field label { display: block; font-size: 12px; color: var(--muted); margin: 0 0 7px; }
.btn {
  border: 0; border-radius: 14px; padding: 11px 14px; font-weight: 700;
  background: var(--surface-3); color: var(--text); display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: .2s ease; text-decoration: none;
}
.btn:hover { transform: translateY(-1px); filter: brightness(.99); }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: white; box-shadow: 0 12px 25px rgba(37,99,235,.25); }
.btn-success { background: linear-gradient(135deg, #059669, #10b981); color: white; }
.btn-danger { background: rgba(239,68,68,.12); color: var(--danger); }
.btn-warning { background: rgba(245,158,11,.14); color: #b45309; }
.btn-ghost { background: transparent; border: 1px solid var(--border); }
.btn-sm { padding: 7px 10px; border-radius: 11px; font-size: 12px; }
.btn:disabled { cursor: not-allowed; opacity: .52; transform: none; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar .search-box { width: min(330px, 100%); }

.table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; min-width: 820px; }
th, td { padding: 13px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--surface-2); }
td { font-size: 14px; }
tr:last-child td { border-bottom: 0; }
.row-product { display: flex; align-items: center; gap: 12px; }
.thumb { width: 46px; height: 46px; border-radius: 14px; object-fit: cover; background: var(--surface-3); border: 1px solid var(--border); }
.status, .badge {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 9px; font-size: 12px; font-weight: 700;
  background: var(--surface-3); color: var(--muted); white-space: nowrap;
}
.status.success { background: rgba(16,185,129,.12); color: #059669; }
.status.warning { background: rgba(245,158,11,.14); color: #b45309; }
.status.danger { background: rgba(239,68,68,.12); color: var(--danger); }
.status.info { background: rgba(37,99,235,.12); color: var(--primary); }

.hero {
  position: relative; color: white; min-height: 245px; border-radius: 30px; overflow: hidden;
  background-image: linear-gradient(90deg, rgba(15,23,42,.94), rgba(15,23,42,.36)), var(--hero-image);
  background-size: cover; background-position: center;
  display: flex; align-items: end; margin-bottom: 20px;
}
.hero .card-body { max-width: 760px; padding: 30px; }
.hero h2 { margin: 0 0 10px; font-size: clamp(28px, 5vw, 52px); letter-spacing: -2px; line-height: 1; }
.hero p { margin: 0; line-height: 1.6; color: rgba(255,255,255,.78); }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.credit { font-size: 11px; color: var(--muted); line-height: 1.5; }
.hero .credit { color: rgba(255,255,255,.62); margin-top: 14px; }

.pos-layout { display: grid; grid-template-columns: 1fr 420px; gap: 18px; align-items: start; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 13px; }
.product-card {
  border: 1px solid var(--border); background: var(--surface); border-radius: 20px; overflow: hidden; transition: .2s ease;
  display: flex; flex-direction: column; min-height: 244px;
}
.product-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.product-card img { width: 100%; height: 115px; object-fit: cover; background: var(--surface-3); }
.product-card .info { padding: 12px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.product-card strong { line-height: 1.25; }
.product-card small { color: var(--muted); }
.product-card .bottom { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cart { position: sticky; top: 92px; }
.cart-item { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.cart-item:last-child { border-bottom: 0; }
.qty-control { display: inline-flex; align-items: center; gap: 7px; }
.qty-control button { width: 28px; height: 28px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); }
.summary-line { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; color: var(--muted); }
.summary-line strong { color: var(--text); font-size: 19px; }
.receipt {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  background: #fff; color: #111827; padding: 18px; border-radius: 12px; line-height: 1.45;
}
.receipt h3, .receipt p { text-align: center; margin: 4px 0; }
.receipt hr { border: 0; border-top: 1px dashed #111827; margin: 12px 0; }
.receipt-row { display: flex; justify-content: space-between; gap: 12px; }

.qris-payment-panel { display: grid; gap: 18px; }
.qris-payment-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.qris-payment-header h3 { margin: 2px 0 6px; letter-spacing: -.7px; }
.eyebrow { margin: 0; color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.muted { color: var(--muted); }
.qris-payment-grid { display: grid; grid-template-columns: 315px 1fr; gap: 18px; align-items: stretch; }
.qris-box { min-height: 315px; display: grid; place-items: center; padding: 20px; border-radius: 24px; background: linear-gradient(180deg, #ffffff, #f8fafc); border: 1px solid var(--border); box-shadow: 0 18px 40px rgba(15,23,42,.08); }
.qris-canvas { display: grid; place-items: center; padding: 18px; background: #fff; border-radius: 18px; border: 1px solid #e2e8f0; }
.qris-canvas img, .qris-canvas canvas { width: 252px !important; height: 252px !important; image-rendering: pixelated; }
.qris-detail-card { display: grid; align-content: center; gap: 10px; padding: 20px; border-radius: 24px; background: var(--surface-2); border: 1px solid var(--border); }
.qris-detail-card p { margin: 4px 0; color: var(--muted); line-height: 1.55; }
.qris-missing, .qris-fallback { color: var(--muted); text-align: center; line-height: 1.5; }
@media (max-width: 760px) { .qris-payment-grid { grid-template-columns: 1fr; } .qris-payment-header { flex-direction: column; } .qris-box { min-height: auto; } .qris-canvas img, .qris-canvas canvas { width: 220px !important; height: 220px !important; } }


.chart { width: 100%; min-height: 260px; }
.progress-list { display: flex; flex-direction: column; gap: 13px; }
.progress-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; }
.progress-bar { grid-column: 1 / -1; height: 9px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.progress-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--success)); border-radius: inherit; }
.empty { text-align: center; padding: 42px 20px; color: var(--muted); }
.empty img { width: min(280px, 100%); border-radius: 24px; box-shadow: var(--shadow); margin-bottom: 14px; }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(2,6,23,.62); backdrop-filter: blur(10px); z-index: 50;
  display: flex; align-items: center; justify-content: center; padding: 18px;
}
.modal {
  width: min(820px, 100%); max-height: 92vh; overflow: auto;
  background: var(--surface); border-radius: 26px; border: 1px solid var(--border); box-shadow: 0 32px 80px rgba(0,0,0,.34);
}
.modal .card-head { padding: 22px; border-bottom: 1px solid var(--border); }
.modal .card-body { padding: 22px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 0 22px 22px; }

#toast-root { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: grid; gap: 10px; }
.toast {
  max-width: 360px; padding: 13px 15px; border-radius: 16px; background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow);
  animation: toast-in .22s ease-out;
}
.toast.success { border-color: rgba(16,185,129,.35); }
.toast.danger { border-color: rgba(239,68,68,.35); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.print-only { display: none; }

@media print {
  body * { visibility: hidden; }
  .print-target, .print-target * { visibility: visible; }
  .print-target { position: absolute; left: 0; top: 0; width: 100%; }
  .no-print { display: none !important; }
}

@media (max-width: 1180px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pos-layout { grid-template-columns: 1fr; }
  .cart { position: static; }
}
@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-visual { min-height: 430px; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-105%); transition: transform .22s ease; width: min(300px, 88vw); }
  .sidebar.open { transform: translateX(0); }
  .mobile-menu { display: inline-flex; }
  .topbar { padding: 14px 15px; }
  .topbar .global-search { display: none; }
  .content { padding: 16px 14px 30px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .auth-visual { padding: 26px; min-height: 390px; }
  .auth-metrics { grid-template-columns: 1fr; }
  .auth-card-wrap { padding: 16px; }
  .auth-card { padding: 20px; border-radius: 22px; }
  .demo-accounts { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-card { min-height: 224px; }
  .product-card img { height: 96px; }
  .toolbar-left, .toolbar-right { width: 100%; }
  .toolbar .search-box, .toolbar select, .toolbar .btn { width: 100%; }
  .modal { border-radius: 18px; }
}

/* POS production-grade cart quantity controls */
.qty-control input.cart-qty {
  width: 56px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  text-align: center;
  font-weight: 800;
}
.qty-control button:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.cart-item strong { word-break: break-word; }

/* Production audit + payment success polish */
.audit-role, .audit-severity {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  text-transform: capitalize;
  background: rgba(37, 99, 235, .10);
  color: var(--primary);
}
.audit-role.muted-role { color: var(--muted); background: var(--surface-3); }
.audit-severity.normal { background: rgba(100, 116, 139, .12); color: #475569; }
.audit-severity.important { background: rgba(245, 158, 11, .15); color: #b45309; }
.audit-severity.high { background: rgba(239, 68, 68, .14); color: #dc2626; }

.success-modal { width: min(720px, 100%); }
.success-modal .card-head { background: linear-gradient(135deg, rgba(16,185,129,.10), rgba(37,99,235,.08)); }
.payment-success-panel {
  display: grid;
  gap: 18px;
  text-align: center;
}
.payment-success-icon {
  width: 92px;
  height: 92px;
  margin: 4px auto 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #059669, #10b981);
  color: white;
  font-size: 54px;
  font-weight: 900;
  box-shadow: 0 22px 45px rgba(16,185,129,.28);
}
.payment-success-copy h2 {
  margin: 4px 0 8px;
  font-size: clamp(28px, 4vw, 38px);
  letter-spacing: -1.25px;
}
.payment-success-copy p { margin: 0 auto; max-width: 560px; color: var(--muted); line-height: 1.65; }
.payment-success-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  text-align: left;
}
.payment-success-summary div {
  padding: 15px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.payment-success-summary span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
}
.payment-success-summary strong { font-size: 15px; word-break: break-word; }
.payment-success-note {
  border: 1px solid rgba(16,185,129,.26);
  background: rgba(16,185,129,.10);
  color: #047857;
  border-radius: 18px;
  padding: 13px 15px;
  line-height: 1.55;
}
[data-theme="dark"] .payment-success-note { color: #86efac; }
@media (max-width: 640px) {
  .payment-success-summary { grid-template-columns: 1fr; }
  .modal-actions { flex-direction: column; }
  .modal-actions .btn { width: 100%; }
}

/* POS usability patch: stable search, scroll-safe cart, and cashier focus mode */
.pos-content {
  min-height: calc(100vh - 74px);
}
.pos-layout {
  min-height: calc(100vh - 138px);
  align-items: stretch;
}
.pos-products-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.pos-toolbar {
  flex: 0 0 auto;
}
#posProductGrid.product-grid {
  flex: 1 1 auto;
  min-height: 0;
  max-height: calc(100vh - 218px);
  overflow: auto;
  padding: 2px 4px 10px 2px;
  scroll-behavior: smooth;
}
.cart {
  position: sticky;
  top: 86px;
  max-height: calc(100vh - 104px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.cart > .card-head {
  flex: 0 0 auto;
}
.cart-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.cart-scroll-area {
  flex: 1 1 auto;
  min-height: 110px;
  overflow: auto;
  padding-right: 4px;
}
.cart-items-wrap {
  margin-top: 10px;
}
.cart-summary-panel {
  flex: 0 0 auto;
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,.82), var(--surface));
  padding-top: 14px;
  margin-top: 14px;
}
[data-theme="dark"] .cart-summary-panel {
  background: linear-gradient(180deg, rgba(15,23,42,.55), var(--surface));
}
.cart-summary-inner {
  margin-top: 0;
}
.pos-focus {
  grid-template-columns: 1fr;
}
.pos-focus .sidebar,
.pos-focus .topbar {
  display: none;
}
.pos-focus .content {
  padding: 14px;
  min-height: 100vh;
}
.pos-focus .pos-layout {
  min-height: calc(100vh - 28px);
  height: calc(100vh - 28px);
  grid-template-columns: minmax(0, 1fr) 430px;
}
.pos-focus #posProductGrid.product-grid {
  max-height: calc(100vh - 112px);
}
.pos-focus .cart {
  top: 14px;
  max-height: calc(100vh - 28px);
}
#posFocusToggle {
  white-space: nowrap;
}
@media (max-width: 1180px) {
  .pos-layout,
  .pos-focus .pos-layout {
    height: auto;
    min-height: auto;
    grid-template-columns: 1fr;
  }
  #posProductGrid.product-grid {
    max-height: none;
    overflow: visible;
  }
  .cart,
  .pos-focus .cart {
    position: static;
    max-height: min(760px, calc(100vh - 32px));
  }
}
@media (max-width: 560px) {
  .pos-toolbar .toolbar-right,
  .pos-toolbar .toolbar-left {
    width: 100%;
  }
  .pos-toolbar .toolbar-right .btn,
  .pos-toolbar .toolbar-left .search-box,
  .pos-toolbar .toolbar-left select {
    width: 100%;
  }
  .cart {
    max-height: calc(100vh - 18px);
  }
  .cart-scroll-area {
    min-height: 150px;
  }
}

/* === FINAL POS UX PATCH 2026-07-05 ===
   Fixes: cashier search losing focus, desktop sidebar toggle, scroll-safe cart at 100% zoom,
   and explicit full-screen cashier mode. Keep this block at the end so it overrides older rules. */
.app-shell.sidebar-collapsed {
  grid-template-columns: 84px 1fr;
}
.app-shell.sidebar-collapsed .sidebar {
  padding-left: 12px;
  padding-right: 12px;
}
.app-shell.sidebar-collapsed .side-brand {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}
.app-shell.sidebar-collapsed .side-brand div:not(.brand-mark),
.app-shell.sidebar-collapsed .nav-item span:last-child,
.app-shell.sidebar-collapsed .side-footer strong,
.app-shell.sidebar-collapsed .side-footer small,
.app-shell.sidebar-collapsed .side-footer .role,
.app-shell.sidebar-collapsed .side-actions {
  display: none;
}
.app-shell.sidebar-collapsed .nav-item {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}
.mobile-menu {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.content.pos-content {
  height: calc(100vh - 74px);
  height: calc(100dvh - 74px);
  min-height: 0;
  overflow: hidden;
  padding-bottom: 18px;
}
.content.pos-content .pos-layout {
  height: 100%;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr) minmax(390px, 420px);
  align-items: stretch;
}
.content.pos-content .pos-products-panel {
  height: 100%;
  min-height: 0;
}
.content.pos-content #posProductGrid.product-grid {
  height: 100%;
  min-height: 0;
  max-height: none;
  overflow: auto;
  padding-bottom: 18px;
  overscroll-behavior: contain;
}
.content.pos-content .cart {
  position: static !important;
  height: 100%;
  max-height: none;
  min-height: 0;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.content.pos-content .cart > .card-head {
  flex: 0 0 auto;
}
.content.pos-content .cart-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 16px;
}
.content.pos-content .cart-scroll-area {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding-right: 6px;
  overscroll-behavior: contain;
}
.content.pos-content .cart-summary-panel {
  flex: 0 0 auto;
  margin-top: 12px;
  padding-top: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,.88), var(--surface));
}
[data-theme="dark"] .content.pos-content .cart-summary-panel {
  background: linear-gradient(180deg, rgba(15,23,42,.70), var(--surface));
}
.content.pos-content .cart-summary-inner .form-field input,
.content.pos-content .cart-summary-inner .form-field select {
  min-height: 42px;
}
.content.pos-content .summary-line {
  padding: 5px 0;
}
.pos-top-focus,
#posFocusToggle {
  white-space: nowrap;
}
.pos-focus {
  grid-template-columns: 1fr !important;
}
.pos-focus .sidebar,
.pos-focus .topbar {
  display: none !important;
}
.pos-focus .content.pos-content {
  height: 100vh;
  height: 100dvh;
  padding: 14px;
}
.pos-focus .content.pos-content .pos-layout {
  height: calc(100vh - 28px);
  height: calc(100dvh - 28px);
  grid-template-columns: minmax(0, 1fr) minmax(400px, 440px);
}
.pos-focus .content.pos-content #posProductGrid.product-grid {
  height: 100%;
}
.pos-focus .content.pos-content .cart {
  height: 100%;
}
@media (max-width: 1180px) and (min-width: 901px) {
  .content.pos-content .pos-layout,
  .pos-focus .content.pos-content .pos-layout {
    grid-template-columns: minmax(0, 1fr) minmax(360px, 410px);
    height: 100%;
    min-height: 0;
  }
  .content.pos-content #posProductGrid.product-grid {
    max-height: none;
    overflow: auto;
  }
  .content.pos-content .cart,
  .pos-focus .content.pos-content .cart {
    position: static !important;
    height: 100%;
    max-height: none;
  }
}
@media (max-width: 900px) {
  .app-shell.sidebar-collapsed {
    grid-template-columns: 1fr;
  }
  .content.pos-content {
    height: auto;
    min-height: calc(100vh - 74px);
    overflow: visible;
  }
  .content.pos-content .pos-layout,
  .pos-focus .content.pos-content .pos-layout {
    height: auto;
    min-height: 0;
    grid-template-columns: 1fr;
  }
  .content.pos-content #posProductGrid.product-grid {
    height: auto;
    max-height: none;
    overflow: visible;
  }
  .content.pos-content .cart,
  .pos-focus .content.pos-content .cart {
    height: auto;
    max-height: none;
    overflow: visible;
  }
  .content.pos-content .cart-body,
  .content.pos-content .cart-scroll-area {
    overflow: visible;
  }
  .pos-top-focus {
    display: none;
  }
}
