/* ── Reset & base ── */
:root {
  color-scheme: light;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f0f2f8;
  color: #172031;
  --accent: #3345ff;
  --accent-light: #eef0ff;
  --sidebar-bg: #111827;
  --sidebar-text: #c9d0e0;
  --sidebar-active-bg: rgba(255,255,255,0.08);
  --sidebar-active-border: #3345ff;
  --sidebar-hover-bg: rgba(255,255,255,0.05);
  --border: #e2e7f3;
  --surface: #ffffff;
  --muted: #64748b;
  --error: #b81a30;
  --success-bg: #f0fdf4;
  --success-text: #15803d;
  --warning-bg: #fffbeb;
  --warning-text: #92400e;
}

* { box-sizing: border-box; }

body { margin: 0; }

/* ── Auth layout (centered) ── */
.layout {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #f0f2f8;
}

/* ── Auth panel ── */
.auth-panel {
  width: min(420px, 100%);
  background: var(--surface);
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 20px 48px rgba(14, 25, 47, 0.10);
}

.auth-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.auth-logo {
  height: 56px;
  width: auto;
}

.auth-panel h1 {
  margin: 0 0 6px;
  font-size: 1.4rem;
}

.login-form {
  display: grid;
  gap: 14px;
  margin: 20px 0;
}

.google-btn {
  width: 100%;
  margin-top: 10px;
  background: #f0f3ff;
  color: #1e2d58;
  border: 1px solid #dbe2ff;
}

.google-btn:hover {
  background: #e4e9ff;
}

/* ── App panel (full-screen shell) ── */
.app-panel {
  position: fixed;
  inset: 0;
  display: flex;
  overflow: hidden;
}

.app-shell {
  display: flex;
  width: 100%;
  height: 100%;
}

/* ── Sidebar ── */
.sidebar {
  width: 232px;
  min-width: 232px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  border-right: 1px solid rgba(255,255,255,0.06);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 18px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.sidebar-logo {
  height: 28px;
  width: auto;
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

.sidebar-brand-name {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
}

/* ── Sidebar navigation ── */
.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  padding: 14px 10px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  border-left: 2px solid transparent;
}

.nav-item:hover {
  background: var(--sidebar-hover-bg);
  color: #fff;
}

.nav-item.active {
  background: var(--sidebar-active-bg);
  border-left-color: var(--sidebar-active-border);
  color: #fff;
}

.nav-item svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.nav-item.active svg,
.nav-item:hover svg {
  opacity: 1;
}

/* ── Sidebar footer ── */
.sidebar-footer {
  padding: 14px 12px;
  border-top: 1px solid rgba(255,255,255,0.07);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: rgba(255,255,255,0.7);
}

.sidebar-user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.sidebar-user-info strong {
  font-size: 0.82rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-info span {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.45);
  text-transform: capitalize;
}

.sidebar-status {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.35);
  padding: 0 2px;
}

.sidebar-status span {
  color: rgba(255,255,255,0.6);
}

.logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  padding: 8px 12px;
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.65);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.logout-btn:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

/* ── Main content area ── */
.main-content {
  flex: 1;
  overflow-y: auto;
  background: #f0f2f8;
}

.main-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── View header ── */
.view-header {
  margin-bottom: 4px;
}

.view-header h2 {
  margin: 0 0 6px;
  font-size: 1.45rem;
  color: #111827;
}

.view-header .muted {
  margin: 0;
}

/* ── Content card / view ── */
.view {
  background: var(--surface);
  border-radius: 14px;
  padding: 24px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: 0 1px 4px rgba(14,25,47,0.05);
}

/* ── Backup permissions (auth screen) ── */
.backup-permissions {
  margin-top: 20px;
  background: #f8f9ff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
}

.backup-permissions h3 {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.backup-permissions ul {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  list-style: disc;
}

.backup-permissions li {
  font-size: 0.82rem;
  color: #374151;
}

/* ── Permissions panel (sidebar view) ── */
.permissions-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.permissions-role-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid #dbe2ff;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: capitalize;
  width: fit-content;
}

.permissions-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 4px;
}

.perm-tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  background: #f4f6ff;
  color: #2535cc;
  border: 1px solid #dbe2ff;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  font-family: "Fira Code", "Cascadia Code", monospace;
  letter-spacing: 0.01em;
  transition: background 0.12s, border-color 0.12s;
}

.perm-tag:hover {
  background: var(--accent-light);
  border-color: #b5c0ff;
}

.perm-empty {
  font-size: 0.875rem;
  color: var(--muted);
}

/* ── Module panels ── */
/* display:flex on .module-panel would override the HTML hidden attribute;
   this rule ensures [hidden] always wins regardless of display value. */
[hidden] { display: none !important; }

.module-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.module-panel h4 {
  margin: 0;
  font-size: 1rem;
  color: #111827;
}

.module-panel h5 {
  margin: 8px 0 0;
  font-size: 0.875rem;
  color: #374151;
}

/* ── Fieldset cards ── */
fieldset {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  margin: 0;
  background: #fafbff;
}

legend {
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 6px;
}

/* ── Forms ── */
label {
  display: grid;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
}

input,
select {
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 9px 12px;
  font-size: 0.9rem;
  background: #fff;
  color: #111827;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(51, 69, 255, 0.12);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── Buttons ── */
button {
  border: none;
  border-radius: 9px;
  padding: 9px 16px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}

button:hover:not([disabled]) {
  background: #2535ee;
}

button.secondary {
  background: var(--accent-light);
  color: #2535ee;
  border: 1px solid #dbe2ff;
}

button.secondary:hover:not([disabled]) {
  background: #dde3ff;
}

button[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ── Banner / status messages ── */
.banner {
  margin: 4px 0;
  font-size: 0.875rem;
  min-height: 20px;
  color: #374151;
}

.banner:not(:empty) {
  padding: 10px 14px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  color: var(--success-text);
}

.error {
  color: var(--error);
  font-size: 0.875rem;
  min-height: 20px;
  margin: 4px 0;
}

.muted {
  color: var(--muted);
  font-size: 0.875rem;
  margin: 0;
  line-height: 1.5;
}

/* ── Tables ── */
.table-wrap {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead {
  background: #f8f9fc;
}

th {
  padding: 10px 12px;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

td {
  padding: 10px 12px;
  border-bottom: 1px solid #f1f3f9;
  color: #374151;
}

tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: #f8f9fc;
}

/* ── Cost dashboard ── */
.cost-summary {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  background: #f8f9fc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 0.875rem;
}

/* ── State panels ── */
.state {
  border-radius: 12px;
  padding: 20px;
}

.state h4 {
  margin: 0 0 6px;
}

.state p {
  margin: 0;
  font-size: 0.875rem;
}

.state.denied {
  background: #fff1f2;
  color: #8e1324;
  border: 1px solid #fecdd3;
}

.state.warning {
  background: var(--warning-bg);
  color: var(--warning-text);
  border: 1px solid #fde68a;
}

/* ── Session banner ── */
#sessionBanner:empty {
  display: none;
}

#sessionBanner:not(:empty) {
  padding: 10px 16px;
  background: var(--warning-bg);
  border: 1px solid #fde68a;
  border-radius: 10px;
  font-size: 0.875rem;
  color: var(--warning-text);
}

/* ── Misc ── */
code {
  background: #f0f2f8;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.82em;
  font-family: "Fira Code", "Cascadia Code", monospace;
}

.inline-link {
  border: none;
  background: transparent;
  color: var(--accent);
  text-decoration: underline;
  padding: 0;
  font-weight: 600;
  cursor: pointer;
}

.module-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.stats-grid article {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  display: grid;
  gap: 6px;
  background: var(--surface);
}

.stats-grid span {
  font-size: 0.78rem;
  color: var(--muted);
}

.inline-form {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 200px auto;
  align-items: end;
}

.state-inline {
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.875rem;
  color: var(--muted);
}

.inline-actions {
  display: flex;
  justify-content: flex-end;
  margin: 8px 0 10px;
}

.jobs-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.jobs-controls select,
.jobs-controls input {
  min-width: 88px;
}

.jobs-badge {
  display: inline-block;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #f8f9fc;
}

/* ═══════════════════════════════════════
   POS — Punto de Venta
   ═══════════════════════════════════════ */

/* Panel overrides */
.pos-panel.module-panel {
  padding: 0;
  gap: 0;
}

/* Two-column layout */
.pos-layout {
  display: flex;
  min-height: 60vh;
}

.pos-left {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  border-right: 1px solid var(--border);
}

.pos-right {
  width: 320px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  position: sticky;
  top: 0;
  max-height: 100vh;
  overflow-y: auto;
}

/* Search */
.pos-search {
  width: 100%;
  padding: 10px 14px;
  font-size: 1rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
  background: var(--surface);
}
.pos-search:focus {
  border-color: var(--accent);
}

/* Product list */
.pos-product-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pos-product-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s;
  background: var(--surface);
  user-select: none;
}
.pos-product-card:hover {
  background: var(--accent-light);
  border-color: var(--accent);
}
.pos-product-card:active {
  opacity: 0.8;
}

.pos-product-name {
  font-size: 0.88rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pos-product-price {
  font-size: 0.85rem;
  color: var(--muted);
  white-space: nowrap;
  margin-left: 10px;
}

.pos-empty-hint {
  padding: 24px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 0.875rem;
}

/* Payment method pills */
.pos-payment-methods {
  display: flex;
  gap: 6px;
}

.pos-pill {
  flex: 1;
  padding: 7px 4px;
  border: 2px solid var(--border);
  border-radius: 20px;
  background: transparent;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
  color: var(--muted);
  letter-spacing: 0.03em;
}
.pos-pill.active {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
}
.pos-pill:hover:not(.active) {
  border-color: var(--accent);
  color: var(--accent);
}

/* Cart items */
.pos-cart-items {
  flex: 1;
  overflow-y: auto;
  max-height: 280px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pos-cart-empty {
  color: var(--muted);
  font-size: 0.875rem;
  text-align: center;
  padding: 16px 0;
}

.pos-cart-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
}

.pos-cart-item.pos-entering {
  animation: pos-item-enter 0.15s ease-out;
}

@keyframes pos-item-enter {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.pos-cart-item-info {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
}

.pos-cart-item-name {
  font-size: 0.83rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.pos-cart-item-line {
  font-size: 0.83rem;
  font-weight: 600;
  white-space: nowrap;
}

.pos-cart-item-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pos-qty-btn {
  width: 22px;
  height: 22px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.1s;
}
.pos-qty-btn:hover {
  background: var(--accent-light);
  border-color: var(--accent);
}

.pos-qty-val {
  min-width: 22px;
  text-align: center;
  font-size: 0.875rem;
  font-weight: 600;
}

.pos-cart-unit-price {
  font-size: 0.72rem;
  color: var(--muted);
  margin-left: auto;
}

.pos-remove-btn {
  width: 20px;
  height: 20px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.1s;
  margin-left: 2px;
}
.pos-remove-btn:hover {
  color: var(--error);
}

/* Totals */
.pos-totals {
  border-top: 1px solid var(--border);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.pos-totals-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--muted);
}

.pos-total-highlight {
  font-size: 1rem;
  font-weight: 700;
  color: #111;
  margin-top: 4px;
  padding-top: 6px;
  border-top: 2px solid var(--border);
}

.pos-total-highlight strong {
  font-size: 1.15rem;
  color: var(--accent);
}

/* Manual discount */
.pos-manual-discount {
  border-top: 1px solid var(--border);
  padding-top: 8px;
}

.pos-manual-discount summary {
  font-size: 0.8rem;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  padding: 2px 0;
}

.pos-manual-discount summary:hover {
  color: var(--accent);
}

/* Customer search */
.pos-customer-section {
  position: relative;
}

.pos-customer-selected {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--accent);
  border-radius: 7px;
  background: var(--accent-light);
}

.pos-customer-name {
  flex: 1;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--accent);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pos-customer-badge {
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--accent);
  color: white;
  padding: 2px 6px;
  border-radius: 10px;
  white-space: nowrap;
}

.pos-customer-search-wrap {
  position: relative;
}

.pos-customer-input {
  width: 100%;
  padding: 7px 10px;
  font-size: 0.875rem;
  border: 1px solid var(--border);
  border-radius: 7px;
  outline: none;
  transition: border-color 0.12s;
  box-sizing: border-box;
  background: var(--surface);
}

.pos-customer-input:focus {
  border-color: var(--accent);
}

.pos-customer-suggestions {
  position: absolute;
  top: calc(100% + 3px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  z-index: 300;
  overflow: hidden;
}

.pos-customer-suggestion {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  cursor: pointer;
  font-size: 0.875rem;
  transition: background 0.1s;
  border-bottom: 1px solid var(--border);
}

.pos-customer-suggestion:last-child {
  border-bottom: none;
}

.pos-customer-suggestion:hover {
  background: var(--accent-light);
}

.pos-customer-suggestion-name {
  flex: 1;
}

.pos-customer-suggestion-empty {
  padding: 10px 12px;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}

/* Payment notes */
.pos-payment-notes {
  width: 100%;
  padding: 7px 10px;
  font-size: 0.8rem;
  border: 1px solid var(--border);
  border-radius: 7px;
  outline: none;
  transition: border-color 0.12s;
  box-sizing: border-box;
  background: var(--surface);
  color: var(--muted);
}

.pos-payment-notes:focus {
  border-color: var(--accent);
  color: inherit;
}

.pos-payment-notes::placeholder {
  font-style: italic;
}

.pos-discount-field {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.pos-discount-field input {
  width: 76px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.875rem;
  outline: none;
}

.pos-discount-field input:focus {
  border-color: var(--accent);
}

.pos-discount-suffix {
  font-size: 0.875rem;
  color: var(--muted);
}

/* Charge button */
.pos-charge-btn {
  width: 100%;
  padding: 13px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
  margin-top: auto;
}

.pos-charge-btn:hover:not(:disabled) {
  opacity: 0.88;
}

.pos-charge-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

/* Mobile cart handle (hidden on desktop) */
.pos-cart-handle {
  display: none;
}

/* POS confirmation modal */
.pos-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pos-modal[hidden] {
  display: none !important;
}

.pos-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.pos-modal-box {
  position: relative;
  background: var(--surface);
  border-radius: 14px;
  padding: 28px;
  width: 420px;
  max-width: calc(100vw - 32px);
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
}

.pos-modal-box h3 {
  margin: 0;
  font-size: 1.1rem;
}

.pos-modal-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 240px;
  overflow-y: auto;
}

.pos-modal-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
}

.pos-modal-item:last-child {
  border-bottom: none;
}

.pos-modal-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  padding: 8px 0;
  border-top: 1px solid var(--border);
}

.pos-modal-total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 1rem;
  font-weight: 700;
}

.pos-modal-total-row strong {
  color: var(--accent);
  font-size: 1.25rem;
}

.pos-modal-actions {
  display: flex;
  gap: 10px;
}

.pos-modal-actions .pos-charge-btn {
  flex: 1;
  margin-top: 0;
}

.pos-btn-secondary {
  padding: 10px 16px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.1s, border-color 0.1s, color 0.1s;
  white-space: nowrap;
  color: inherit;
}

.pos-btn-secondary:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}

/* POS toast */
.pos-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #111827;
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  z-index: 2000;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.28);
  animation: pos-item-enter 0.2s ease-out;
  white-space: nowrap;
}

.pos-toast[hidden] {
  display: none !important;
}

/* Mobile layout */
@media (max-width: 767px) {
  .pos-layout {
    flex-direction: column;
    min-height: unset;
  }

  .pos-left {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding-bottom: 80px; /* space for floating cart handle */
  }

  .pos-right {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: auto;
    max-height: 72vh;
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(calc(100% - 58px));
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    z-index: 200;
    background: var(--surface);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    overflow-y: auto;
  }

  .pos-right.cart-expanded {
    transform: translateY(0);
  }

  .pos-cart-handle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 8px 0 4px;
    cursor: pointer;
  }

  .pos-cart-handle-bar {
    width: 36px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
  }

  .pos-cart-summary {
    font-size: 0.78rem;
    color: var(--muted);
    font-weight: 600;
  }
}
