/* ==========================================================================
   MicroPOS Cloud — Design System & Stylesheet (v2.5 Pro Edition)
   Aesthetic: Clean Dark Slate, Emerald Terminal, High-Density Ergonomics
   ========================================================================== */

:root {
  --bg-app: #06090c;
  --bg-topbar: #0c1117;
  --bg-surface: #101720;
  --bg-surface-elevated: #16202c;
  --bg-card: rgba(22, 32, 44, 0.7);
  --bg-card-hover: #1c2938;

  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-focus: #10b981;
  --border-highlight: rgba(16, 185, 129, 0.35);

  --emerald-500: #10b981;
  --emerald-400: #34d399;
  --emerald-600: #059669;
  --emerald-glow: rgba(16, 185, 129, 0.15);

  --slate-100: #f8fafc;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-800: #1e293b;

  --amber-400: #fbbf24;
  --rose-400: #f87171;

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

button {
  font-family: inherit;
  border: none;
  background: none;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

body.pos-app-body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--slate-100);
  line-height: 1.45;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

/* Tabular Numbers */
.mono-amount {
  font-family: var(--font-mono);
  letter-spacing: -0.02em;
}

/* ==========================================================================
   1. Topbar Navigation
   ========================================================================== */
.app-topbar {
  height: 58px;
  background-color: var(--bg-topbar);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 50;
  flex-shrink: 0;
}

.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-pill {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #10b981 0%, #047857 100%);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.brand-logo-icon svg {
  width: 18px;
  height: 18px;
}

.brand-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.brand-title .highlight {
  color: var(--emerald-400);
}

.brand-tag {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: var(--slate-400);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Preset Segmented Control */
.preset-segmented-control {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 3px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  max-width: 62vw;
  scrollbar-width: none;
}

.preset-segmented-control::-webkit-scrollbar {
  display: none;
}

.preset-btn {
  background: transparent;
  border: none;
  color: var(--slate-400);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.preset-btn:hover {
  color: var(--slate-200);
}

.preset-btn.active {
  background-color: var(--emerald-500);
  color: #022013;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.icon-svg {
  width: 14px;
  height: 14px;
}

.icon-svg-sm {
  width: 13px;
  height: 13px;
}

/* Branch & Shift Badge */
.branch-pill {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 5px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--emerald-400);
  box-shadow: 0 0 8px var(--emerald-400);
  animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.branch-pill select {
  background: transparent;
  border: none;
  color: var(--slate-200);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

.branch-pill select option {
  background-color: var(--bg-surface);
  color: var(--slate-100);
}

.shift-badge {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  font-size: 11px;
  color: var(--slate-400);
  display: flex;
  align-items: center;
  gap: 6px;
}

.shift-badge strong {
  color: var(--slate-200);
}

/* ==========================================================================
   2. Main Workspace Layout
   ========================================================================== */
.pos-workspace {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 400px;
  height: calc(100vh - 58px);
  overflow: hidden;
}

/* Catalog Section */
.catalog-section {
  display: flex;
  flex-direction: column;
  background-color: var(--bg-app);
  height: 100%;
  overflow: hidden;
  border-right: 1px solid var(--border-subtle);
}

.catalog-controls {
  padding: 16px 20px 12px 20px;
  border-bottom: 1px solid var(--border-subtle);
  background-color: rgba(12, 17, 23, 0.6);
  backdrop-blur: 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 14px;
  width: 17px;
  height: 17px;
  color: var(--slate-500);
  pointer-events: none;
}

.search-input-wrapper input {
  width: 100%;
  height: 42px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0 45px 0 40px;
  color: var(--slate-100);
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
  transition: all 0.2s ease;
}

.search-input-wrapper input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
  background-color: var(--bg-surface-elevated);
}

.search-kbd {
  position: absolute;
  right: 12px;
  font-size: 11px;
  font-weight: 700;
  color: var(--slate-500);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 7px;
  border-radius: 5px;
  border: 1px solid var(--border-subtle);
}

/* Category Filters Scroll */
.category-filters-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.category-filters-scroll::-webkit-scrollbar {
  display: none;
}

.cat-chip, .category-chip {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--slate-400);
  padding: 7px 14px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.cat-chip:hover, .category-chip:hover {
  background-color: var(--bg-surface-elevated);
  color: var(--slate-200);
}

.cat-chip.active, .category-chip.active {
  background: var(--emerald-500);
  color: #032314;
  font-weight: 800;
  border-color: var(--emerald-500);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

/* Products Matrix Grid */
.products-matrix {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px 80px 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
  align-content: start;
}

.product-bento-card, .pos-item-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  min-height: 140px;
}

.product-bento-card:hover, .pos-item-card:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--border-highlight);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.6);
}

.product-bento-card:active, .pos-item-card:active {
  transform: scale(0.97);
}

.product-bento-card.in-cart, .pos-item-card.in-cart {
  border-color: var(--emerald-500);
  background-color: rgba(16, 185, 129, 0.08);
}

.product-bento-card.out-of-stock, .pos-item-card.out-of-stock {
  opacity: 0.45;
  filter: grayscale(0.8);
  cursor: not-allowed;
  pointer-events: none;
}

.p-top, .item-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.p-badge, .item-tag-badge, .stock-indicator {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--slate-400);
}

.p-badge.low, .stock-indicator.low {
  background: rgba(248, 113, 113, 0.15);
  color: var(--rose-400);
}

.p-name, .item-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--slate-100);
  margin-bottom: 4px;
  line-height: 1.35;
}

.p-sku, .item-sku {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--slate-500);
}

.p-bottom, .item-card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed rgba(255, 255, 255, 0.06);
}

.p-price, .item-price {
  font-size: 14px;
  font-weight: 800;
  color: var(--emerald-400);
}

.p-add-btn, .btn-quick-add {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: rgba(16, 185, 129, 0.15);
  color: var(--emerald-400);
  border: 1px solid rgba(16, 185, 129, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  transition: all 0.15s ease;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.product-bento-card:hover .p-add-btn,
.pos-item-card:hover .btn-quick-add,
.product-bento-card:hover .btn-quick-add,
.pos-item-card:hover .p-add-btn,
.product-bento-card.in-cart .p-add-btn,
.pos-item-card.in-cart .btn-quick-add,
.p-add-btn.active,
.btn-quick-add.active {
  background: var(--emerald-500);
  color: #032014;
  border-color: var(--emerald-500);
}

.badge-qty {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
}

.empty-catalog-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 20px;
  color: var(--slate-500);
}

/* ==========================================================================
   3. Register Terminal (Right Panel)
   ========================================================================== */
.register-terminal {
  background-color: var(--bg-surface);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.3);
}

.terminal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  background-color: var(--bg-surface-elevated);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.order-id-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.order-tag {
  font-size: 9px;
  font-weight: 800;
  background: rgba(16, 185, 129, 0.15);
  color: var(--emerald-400);
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.order-number {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--slate-200);
}

.order-type-switch {
  display: flex;
  gap: 4px;
}

.type-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--slate-400);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.type-btn.active {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-icon-clear {
  width: 32px;
  height: 32px;
  background: rgba(248, 113, 113, 0.1);
  color: var(--rose-400);
  border: 1px solid rgba(248, 113, 113, 0.2);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-icon-clear:hover {
  background: var(--rose-400);
  color: #ffffff;
}

.btn-icon-clear svg {
  width: 15px;
  height: 15px;
}

/* Customer Bar */
.customer-bar {
  padding: 10px 20px;
  background-color: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.cust-icon {
  width: 15px;
  height: 15px;
  color: var(--slate-500);
}

.customer-bar input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--slate-200);
  font-size: 12.5px;
  font-weight: 600;
  outline: none;
}

.cust-type-pill {
  font-size: 10px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.05);
  color: var(--slate-400);
  padding: 2px 7px;
  border-radius: 4px;
}

/* Cart Items Container */
.cart-items-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cart-empty-state, .empty-cart-state {
  margin: auto;
  text-align: center;
  padding: 30px 10px;
  color: var(--slate-500);
}

.cart-empty-icon {
  font-size: 34px;
  margin-bottom: 8px;
  opacity: 0.6;
}

.cart-empty-state p, .empty-cart-state p {
  font-size: 13px;
  font-weight: 700;
  color: var(--slate-400);
  margin-bottom: 4px;
}

.cart-empty-state small, .empty-cart-state small {
  font-size: 11px;
}

.cart-row, .cart-line-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: all 0.15s ease;
}

.cart-row:hover, .cart-line-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
}

.cart-item-details, .cart-line-info {
  flex: 1;
  min-width: 0;
}

.cart-item-title, .line-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--slate-200);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-price, .line-unit-price {
  font-size: 11.5px;
  color: var(--slate-400);
  margin-top: 2px;
}

.cart-stepper, .qty-stepper {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 2px 4px;
}

.stepper-btn, .step-btn {
  width: 22px;
  height: 22px;
  background: transparent;
  border: none;
  color: var(--slate-300);
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.stepper-btn:hover, .step-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.stepper-val, .step-value {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  min-width: 20px;
  text-align: center;
}

.cart-item-subtotal, .line-subtotal {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--emerald-400);
  text-align: right;
  min-width: 70px;
}

.btn-remove-line {
  background: transparent;
  border: none;
  color: var(--slate-500);
  font-size: 18px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
  transition: all 0.15s ease;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.btn-remove-line:hover {
  color: var(--rose-400);
  background: rgba(248, 113, 113, 0.15);
}

/* Terminal Billing Area */
.terminal-billing {
  background-color: var(--bg-surface-elevated);
  border-top: 1px solid var(--border-subtle);
  padding: 16px 20px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.billing-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  color: var(--slate-400);
}

.toggle-control {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.toggle-control input {
  display: none;
}

.slider {
  width: 28px;
  height: 16px;
  background-color: var(--slate-800);
  border-radius: 999px;
  position: relative;
  transition: all 0.2s ease;
}

.slider::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--slate-400);
  top: 2px;
  left: 2px;
  transition: all 0.2s ease;
}

.toggle-control input:checked + .slider {
  background-color: var(--emerald-500);
}

.toggle-control input:checked + .slider::after {
  left: 14px;
  background-color: #032014;
}

.total-highlight {
  border-top: 1px dashed var(--border-subtle);
  padding-top: 10px;
  margin-top: 2px;
}

.total-label {
  font-size: 13px;
  font-weight: 800;
  color: var(--slate-200);
}

.total-items-badge {
  font-size: 11px;
  color: var(--slate-500);
  margin-left: 6px;
}

.total-amount {
  font-size: 20px;
  font-weight: 900;
  color: var(--emerald-400);
}

/* Quick Cash Row */
.quick-cash-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 2px;
}

.cash-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--slate-300);
  padding: 6px 2px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cash-chip:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #ffffff;
}

.change-row {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 6px;
  padding: 6px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--emerald-300);
}

.change-amount {
  font-weight: 800;
  font-size: 14px;
}

/* Checkout Action Buttons */
.checkout-actions-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 8px;
  margin-top: 4px;
}

.btn-checkout {
  border: none;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
}

.btn-qris {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #022013;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-qris:hover {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  transform: translateY(-1px);
}

.btn-cash {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--slate-200);
}

.btn-cash:hover {
  background: var(--bg-surface-elevated);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-action-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.btn-action-text strong {
  display: block;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
}

.btn-action-text small {
  display: block;
  font-size: 9.5px;
  opacity: 0.8;
}

/* Mobile Bottom Bar (Hidden on desktop) */
.mobile-bottom-bar {
  display: none;
}

/* ==========================================================================
   4. Modals & Receipt Styles
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}

.modal-backdrop.active {
  display: flex;
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 400px;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
  animation: modal-pop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-pop {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.qris-brand .qris-text {
  font-weight: 900;
  font-size: 16px;
  letter-spacing: 1px;
  color: #ffffff;
}

.qris-brand .qris-sub {
  display: block;
  font-size: 10px;
  color: var(--slate-400);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--slate-400);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.qris-body {
  padding: 24px 20px;
  text-align: center;
}

.qris-meta {
  font-size: 12.5px;
  color: var(--slate-300);
  margin-bottom: 16px;
}

.qris-nominal {
  font-size: 18px;
  font-weight: 800;
  color: var(--emerald-400);
}

.qris-code-frame {
  width: 200px;
  height: 200px;
  margin: 0 auto 16px auto;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  position: relative;
  background: #ffffff;
}

.qr-vector-svg {
  width: 100%;
  height: 100%;
}

.qris-timer {
  font-size: 12px;
  color: var(--slate-400);
  margin-bottom: 16px;
}

.qris-timer strong {
  color: var(--amber-400);
  font-family: var(--font-mono);
}

.btn-simulate-scan {
  width: 100%;
  background: var(--emerald-500);
  color: #032014;
  border: none;
  font-weight: 800;
  font-size: 13.5px;
  padding: 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
  transition: all 0.2s ease;
}

.btn-simulate-scan:hover {
  background: var(--emerald-400);
  transform: translateY(-1px);
}

/* Thermal Paper Styling */
.receipt-paper-wrapper {
  max-width: 380px;
  width: 100%;
  animation: modal-pop 0.25s ease;
}

.receipt-paper {
  background: #fdfdfd;
  color: #1e293b;
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 24px 20px;
  border-radius: 8px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9);
  line-height: 1.4;
  position: relative;
}

.receipt-cut-edge {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: radial-gradient(circle, transparent 4px, #fdfdfd 5px);
  background-size: 10px 10px;
  background-position: -5px -5px;
}

.receipt-header {
  text-align: center;
  margin-bottom: 10px;
}

.r-store-name {
  font-size: 15px;
  font-weight: 900;
  letter-spacing: -0.01em;
  margin-bottom: 2px;
}

.r-address, .r-phone {
  font-size: 10px;
  color: #64748b;
}

.r-line {
  color: #cbd5e1;
  text-align: center;
  margin: 6px 0;
  overflow: hidden;
}

.r-meta {
  font-size: 11px;
  color: #475569;
}

.r-meta div {
  margin-bottom: 2px;
}

.r-items {
  margin: 8px 0;
}

.r-item-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 3px;
}

.r-totals .r-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 3px;
}

.r-totals .r-grand {
  font-weight: 900;
  font-size: 13.5px;
  color: #0f172a;
  border-top: 1px dashed #94a3b8;
  padding-top: 4px;
  margin-top: 4px;
}

.r-footer {
  text-align: center;
  font-size: 10px;
  color: #64748b;
  margin-top: 10px;
}

.r-footer strong {
  color: #0f172a;
}

.receipt-actions-bar {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.btn-receipt-action {
  flex: 1;
  padding: 12px;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.btn-print {
  background: var(--bg-surface-elevated);
  color: #ffffff;
  border: 1px solid var(--border-subtle);
}

.btn-print:hover {
  background: #1e2d3d;
}

.btn-new {
  background: var(--emerald-500);
  color: #032014;
}

.btn-new:hover {
  background: var(--emerald-400);
}

/* Toast Hub */
.toast-hub {
  position: fixed;
  bottom: 24px;
  left: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 300;
  pointer-events: none;
}

.pos-toast, .toast-item {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-highlight);
  color: var(--slate-100);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toast-in 0.25s ease;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.pos-toast.fade-out, .toast-item.fade-out {
  opacity: 0;
  transform: translateY(-8px);
}

.pos-toast.warning, .toast-item.warning {
  border-color: rgba(251, 191, 36, 0.4);
}

.toast-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--emerald-400);
  flex-shrink: 0;
}

.toast-item.warning .toast-dot {
  background-color: var(--amber-400);
}

.toast-msg {
  display: inline-block;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   5. Mobile & Responsive Layouts
   ========================================================================== */
@media (max-width: 860px) {
  html {
    scroll-padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
  }

  .app-topbar {
    height: auto;
    min-block-size: 52px;
    padding: 8px 14px;
    gap: 8px;
  }

  .topbar-left {
    gap: 8px;
    min-width: 0;
  }

  .topbar-right {
    gap: 8px;
    min-width: 0;
    flex: 1;
    justify-content: flex-end;
  }

  .brand-tag {
    display: none;
  }

  .brand-title {
    font-size: 14px;
    white-space: nowrap;
  }

  .branch-pill {
    max-width: 195px;
    min-width: 0;
    padding: 5px 9px;
  }

  .branch-pill select {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Prevent iOS/Android pinch-zoom when tapping search, customer, or branch inputs */
  input, select, textarea,
  .search-input-wrapper input,
  .customer-bar input,
  .branch-pill select {
    font-size: max(1rem, 16px) !important;
  }

  .search-kbd {
    display: none;
  }

  .pos-workspace {
    grid-template-columns: 1fr;
    height: auto;
    overflow-y: auto;
  }

  body.pos-app-body {
    overflow-y: auto;
    height: auto;
  }

  .products-matrix {
    padding: 14px 14px 96px 14px !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  .p-add-btn, .btn-quick-add {
    width: 30px !important;
    height: 30px !important;
    padding: 0 !important;
    line-height: 1 !important;
    position: relative;
  }

  .p-add-btn::after, .btn-quick-add::after {
    content: "";
    position: absolute;
    inset: -7px;
  }

  .toast-hub {
    top: max(60px, calc(54px + env(safe-area-inset-top, 0px)));
    bottom: auto;
    left: 12px;
    right: 12px;
    align-items: center;
  }

  .pos-toast, .toast-item {
    padding: 8px 14px;
    font-size: 12px;
    max-width: 100%;
  }

  .preset-segmented-control {
    display: none;
  }

  .shift-badge {
    display: none;
  }

  .register-terminal {
    display: none;
  }

  .register-terminal.mobile-open,
  .register-terminal.drawer-open {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 150;
  }

  .mobile-drawer-close {
    display: inline-flex !important;
  }

  .mobile-bottom-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #0e1620;
    border-top: 1px solid var(--border-highlight);
    padding: 12px 18px;
    z-index: 120;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.6);
  }

  .mobile-bar-info {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
  }

  .mobile-cart-badge {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: var(--emerald-500);
    color: #032014;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
  }

  .mobile-cart-badge svg {
    width: 18px;
    height: 18px;
  }

  .mobile-cart-badge span {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 999px;
  }

  .mobile-total-text {
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 800;
    color: var(--emerald-400);
  }

  .mobile-subtext {
    font-size: 10px;
    color: var(--slate-400);
  }

  .mobile-pay-btn {
    background: var(--emerald-500);
    color: #032014;
    font-family: var(--font-sans);
    font-weight: 800;
    font-size: 13px;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
  }
}
