/* ==========================================================================
   BURGER POS & KITCHEN PRINTING SYSTEM - MODERN FAST STYLESHEET
   Clean, touch-friendly, ultra-fast, responsive desktop & mobile PWA
   ========================================================================== */

:root {
  --primary: #e11d48;
  --primary-hover: #be123c;
  --primary-light: #ffe4e6;
  --primary-dark: #881337;
  --secondary: #0f172a;
  --surface: #ffffff;
  --background: #f8fafc;
  --border: #e2e8f0;
  --border-focus: #cbd5e1;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --success: #16a34a;
  --success-light: #dcfce7;
  --warning: #f59e0b;
  --danger: #dc2626;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  --transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --sidebar-width: 90px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

input, textarea, select {
  user-select: text;
  font-family: inherit;
}

body {
  font-family: var(--font-family);
  background-color: var(--background);
  color: var(--text-main);
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* -------------------------------------------------------------
   APP LAYOUT (Desktop Sidebar + Main View)
   ------------------------------------------------------------- */
#app-container {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* Sidebar navigation */
.app-sidebar {
  width: var(--sidebar-width);
  background-color: var(--secondary);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 0;
  flex-shrink: 0;
  z-index: 40;
}

.brand-icon {
  font-size: 32px;
  margin-bottom: 24px;
  cursor: pointer;
  transition: transform 0.2s ease;
}
.brand-icon:hover {
  transform: scale(1.1);
}

.nav-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  align-items: center;
  flex: 1;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 64px;
  border-radius: var(--radius-md);
  color: #94a3b8;
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  transition: var(--transition);
  cursor: pointer;
  background: transparent;
  border: none;
}

.nav-item .icon {
  font-size: 20px;
  margin-bottom: 4px;
}

.nav-item:hover {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.08);
}

.nav-item.active {
  color: #fff;
  background-color: var(--primary);
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.4);
}

.nav-item.pos-highlight {
  border: 1px solid rgba(225, 29, 72, 0.3);
}

/* Main Content Area */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  position: relative;
  background-color: var(--background);
}

/* Network offline/online indicator */
.network-status-bar {
  display: none;
  background-color: #334155;
  color: #fff;
  font-size: 12px;
  font-weight: bold;
  text-align: center;
  padding: 6px 12px;
  z-index: 100;
}
.network-status-bar.offline {
  display: block;
  background-color: #ef4444;
}
.network-status-bar.online-alert {
  display: block;
  background-color: #10b981;
}

/* View switcher */
.view-section {
  display: none;
  height: 100%;
  width: 100%;
  overflow: hidden;
}
.view-section.active {
  display: flex;
}

/* -------------------------------------------------------------
   POS SECTION (2-Panel Desktop: Left Products, Right Order)
   ------------------------------------------------------------- */
.pos-layout {
  display: flex;
  width: 100%;
  height: 100%;
}

.pos-left-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  border-right: 1px solid var(--border);
  overflow: hidden;
  background-color: var(--background);
}

/* POS Top Bar */
.pos-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.pos-title-block h1 {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.order-badge-live {
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
}

/* Prominent Animated PWA Install Button */
.pwa-install-btn {
  background: linear-gradient(135deg, #e11d48, #be123c);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.2px;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.38), 0 0 12px rgba(225, 29, 72, 0.25);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  animation: pwaBreath 2.6s infinite ease-in-out;
}

/* Shimmer light sweep animation across button */
.pwa-install-btn::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -60%;
  width: 40%;
  height: 200%;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.35) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: rotate(25deg);
  animation: pwaShimmer 3.2s infinite ease-in-out;
}

.pwa-install-btn:hover {
  background: linear-gradient(135deg, #be123c, #9f1239);
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 6px 20px rgba(225, 29, 72, 0.5);
}

.pwa-install-btn:active {
  transform: scale(0.96);
}

.pwa-install-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pwaIconBounce 1.8s infinite ease-in-out;
}

.pwa-pulse-dot {
  width: 7px;
  height: 7px;
  background-color: #4ade80;
  border-radius: 50%;
  box-shadow: 0 0 8px #4ade80;
  display: inline-block;
  animation: pwaDotPulse 1.4s infinite ease-in-out;
}

@keyframes pwaBreath {
  0%, 100% {
    box-shadow: 0 4px 14px rgba(225, 29, 72, 0.35), 0 0 10px rgba(225, 29, 72, 0.2);
  }
  50% {
    box-shadow: 0 6px 22px rgba(225, 29, 72, 0.6), 0 0 18px rgba(255, 42, 95, 0.45);
    transform: translateY(-0.5px);
  }
}

@keyframes pwaShimmer {
  0% {
    left: -70%;
  }
  25%, 100% {
    left: 140%;
  }
}

@keyframes pwaIconBounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-2px);
  }
}

@keyframes pwaDotPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.4);
    opacity: 1;
    box-shadow: 0 0 12px #4ade80;
  }
}

/* Category Tabs */
.category-tabs-container {
  padding: 12px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}
.category-tabs-container::-webkit-scrollbar {
  display: none;
}

.category-tabs {
  display: flex;
  gap: 8px;
}

.cat-tab-btn {
  padding: 8px 18px;
  border-radius: 30px;
  background: #f1f5f9;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.cat-tab-btn:hover {
  background: #e2e8f0;
  color: var(--text-main);
}

.cat-tab-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 3px 10px rgba(225, 29, 72, 0.3);
}

/* Product Cards Grid */
.products-scroll-area {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  position: relative;
}

.product-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.product-card:active {
  transform: scale(0.98);
}

.product-img-wrapper {
  width: 100%;
  height: 125px;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.product-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.product-card:hover .product-thumb-img {
  transform: scale(1.04);
}

.product-fallback-icon {
  font-size: 40px;
}

.product-card-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
}

.product-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-price {
  font-size: 16px;
  font-weight: 800;
  color: var(--primary);
}

/* -------------------------------------------------------------
   CURRENT ORDER PANEL (Right Side)
   ------------------------------------------------------------- */
.pos-order-panel {
  width: 380px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  height: 100%;
  flex-shrink: 0;
  box-shadow: -2px 0 10px rgba(0,0,0,0.03);
}

.order-panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fafafa;
}

.order-panel-header .order-num {
  font-size: 18px;
  font-weight: 800;
}

.order-type-badge {
  font-size: 12px;
  font-weight: 600;
  background: #e2e8f0;
  padding: 3px 8px;
  border-radius: 12px;
  color: #475569;
}

.clear-cart-btn {
  background: none;
  border: none;
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}
.clear-cart-btn:hover {
  background: #fee2e2;
}

/* Cart Items List */
.cart-items-container {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cart-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  gap: 8px;
}
.cart-empty-icon {
  font-size: 40px;
  opacity: 0.5;
}

.cart-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--background);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  gap: 8px;
}

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

.cart-item-title {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-price-each {
  font-size: 11px;
  color: var(--text-muted);
}

.qty-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text-main);
  font-size: 14px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}
.qty-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}
.qty-btn:active {
  transform: scale(0.9);
}

.qty-display {
  font-size: 14px;
  font-weight: 700;
  min-width: 20px;
  text-align: center;
}

.cart-item-total {
  font-size: 13px;
  font-weight: 800;
  min-width: 60px;
  text-align: right;
  color: var(--text-main);
}

.cart-item-remove-btn {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 16px;
  padding: 2px 4px;
}
.cart-item-remove-btn:hover {
  color: var(--danger);
}

/* Order Footer & Calculations */
.order-panel-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  background: #fafafa;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.order-calc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-muted);
}

.discount-input-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
}

.discount-input-wrapper input {
  width: 75px;
  padding: 4px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  text-align: right;
  font-size: 12px;
  font-weight: 600;
}

.order-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}

.order-total-large {
  font-size: 24px;
  font-weight: 900;
  color: var(--primary);
}

.order-notes-input {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  resize: none;
  height: 38px;
}

.checkout-action-btn {
  width: 100%;
  padding: 14px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.35);
}

.checkout-action-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}
.checkout-action-btn:active {
  transform: scale(0.99);
}
.checkout-action-btn:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
  box-shadow: none;
}

/* -------------------------------------------------------------
   CHECKOUT POPUP / MODAL
   ------------------------------------------------------------- */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(2px);
  z-index: 999;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-overlay.open {
  display: flex;
}

.checkout-modal {
  background: #fff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  0% { transform: scale(0.92); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

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

.modal-close-btn {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
}

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.checkout-summary-box {
  background: #f8fafc;
  padding: 14px;
  border-radius: var(--radius-md);
  text-align: center;
  border: 1px solid var(--border);
}
.checkout-summary-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}
.checkout-summary-amount {
  font-size: 30px;
  font-weight: 900;
  color: var(--primary);
  margin-top: 2px;
}

.payment-method-options {
  display: flex;
  gap: 8px;
}

.pay-method-btn {
  flex: 1;
  padding: 12px 8px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: var(--transition);
}
.pay-method-btn.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary-dark);
}

.cash-calculation-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.calc-field-group label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  display: block;
  margin-bottom: 4px;
}

.calc-field-group input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: bold;
}
.calc-field-group input:focus {
  border-color: var(--primary);
  outline: none;
}

.change-due-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--success-light);
  color: #14532d;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 15px;
}

.modal-footer-actions {
  display: flex;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  background: #fafafa;
}

.btn-secondary {
  flex: 1;
  padding: 12px;
  background: #e2e8f0;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
}
.btn-primary {
  flex: 2;
  padding: 12px;
  background: var(--primary);
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  cursor: pointer;
  transition: var(--transition);
}
.btn-primary:hover {
  background: var(--primary-hover);
}

/* -------------------------------------------------------------
   ORDER SUCCESS / PRINT DIALOG MODAL
   ------------------------------------------------------------- */
.success-modal {
  text-align: center;
}
.success-check-icon {
  font-size: 48px;
  color: var(--success);
  margin-bottom: 8px;
}
.success-modal h2 {
  font-size: 20px;
  font-weight: 800;
}
.success-order-num {
  font-size: 26px;
  font-weight: 900;
  color: var(--text-main);
  margin: 4px 0 12px;
}

.print-actions-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.print-btn-large {
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
}
.print-btn-large:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.print-btn-large.primary-print {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.print-btn-large.primary-print:hover {
  background: var(--primary-hover);
}

.receipt-preview-toggle {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  margin-top: 8px;
}

.receipt-preview-area {
  display: none;
  max-height: 260px;
  overflow-y: auto;
  border: 1px dashed var(--border);
  padding: 12px;
  background: #fff;
  border-radius: var(--radius-sm);
  margin-top: 10px;
  text-align: left;
}
.receipt-preview-area.active {
  display: block;
}

/* -------------------------------------------------------------
   SALES, PURCHASES, EXPENSES, REPORTS, SETTINGS PANELS
   ------------------------------------------------------------- */
.section-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  overflow-y: auto;
  padding: 24px;
  gap: 20px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.section-header h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-main);
}

/* Summary metrics cards row */
.metrics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.metric-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.metric-value {
  font-size: 26px;
  font-weight: 900;
  color: var(--text-main);
}

.metric-value.highlight-sales {
  color: var(--primary);
}
.metric-value.highlight-purchases {
  color: #ea580c;
}
.metric-value.highlight-expenses {
  color: #dc2626;
}
.metric-value.highlight-net {
  color: #16a34a;
}

/* Filter pills */
.filter-pills-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.filter-pill {
  padding: 6px 14px;
  border-radius: 20px;
  background: #f1f5f9;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}
.filter-pill:hover {
  background: #e2e8f0;
}
.filter-pill.active {
  background: var(--secondary);
  color: #fff;
}

/* Modern clean tables */
.table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.data-table th {
  background: #f8fafc;
  padding: 12px 16px;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-main);
}

.data-table tbody tr:hover {
  background-color: #fafbfc;
}

.table-action-btn {
  padding: 5px 10px;
  border-radius: 6px;
  background: #f1f5f9;
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-main);
}
.table-action-btn:hover {
  background: var(--primary-light);
  color: var(--primary-dark);
  border-color: var(--primary);
}

/* Forms layout */
.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  outline: none;
}

/* Product catalog admin grid */
.admin-products-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.admin-product-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-prod-details {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-prod-thumb {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border);
}

.admin-prod-emoji {
  font-size: 28px;
}

/* Toast alert notification */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--secondary);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn 0.2s ease;
}
.toast.toast-success {
  background: #15803d;
}
.toast.toast-error {
  background: #b91c1c;
}

@keyframes slideIn {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* -------------------------------------------------------------
   MOBILE ADAPTIVE UI (< 768px)
   ------------------------------------------------------------- */
.mobile-cart-bar {
  display: none;
}
.mobile-bottom-nav {
  display: none;
}

@media (max-width: 768px) {
  html, body {
    height: 100%;
    width: 100%;
    overflow: hidden;
  }

  #app-container {
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    width: 100vw;
    overflow: hidden;
  }

  .app-sidebar {
    display: none;
  }

  .main-content {
    flex: 1;
    height: calc(100vh - 60px);
    height: calc(100dvh - 60px); /* accounts for mobile dynamic viewport */
    width: 100vw;
    overflow: hidden;
    position: relative;
  }

  .view-section {
    height: 100%;
    width: 100%;
    overflow: hidden;
  }

  /* POS Layout in Mobile */
  .pos-layout {
    flex-direction: column;
    height: 100%;
    width: 100%;
    position: relative;
    overflow: hidden;
  }

  .pos-left-panel {
    width: 100%;
    height: 100%;
    border-right: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  /* Mobile Top Bar */
  .pos-top-bar {
    padding: 10px 14px;
    flex-shrink: 0;
  }

  .pos-title-block h1 {
    font-size: 16px;
    gap: 6px;
  }

  .order-badge-live {
    font-size: 11px;
    padding: 3px 8px;
  }

  .pos-top-bar .pwa-install-btn {
    padding: 8px 14px;
    font-size: 12.5px;
    font-weight: 800;
    border-radius: 18px;
    gap: 6px;
    background: linear-gradient(135deg, #e11d48, #be123c) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    box-shadow: 0 4px 14px rgba(225, 29, 72, 0.45), 0 0 12px rgba(225, 29, 72, 0.3) !important;
  }

  /* Mobile Category Menu (Two clean rows, perfectly separated, no overflow clipping) */
  .category-tabs-container {
    padding: 10px 12px;
    flex-shrink: 0;
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
    position: relative;
    z-index: 10;
    overflow: visible;
  }

  .category-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    width: 100%;
    min-width: unset;
  }

  .cat-tab-btn {
    padding: 8px 6px;
    font-size: 12.5px;
    font-weight: 700;
    border-radius: 12px;
    white-space: nowrap;
    text-align: center;
    background: #f8fafc;
    color: #475569;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .cat-tab-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
  }

  .cat-tab-btn.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(225, 29, 72, 0.35);
    transform: translateY(-1px);
  }

  /* Products Area with padding for bottom floating cart */
  .products-scroll-area {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px 14px 130px 14px; /* room for sticky cart + floating bottom nav */
  }

  /* Responsive 2-column Product Cards Grid */
  .products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .product-card {
    border-radius: 14px;
    min-height: auto;
    border: 1px solid #edf2f7;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }

  .product-card:active {
    transform: scale(0.97);
  }

  .product-img-wrapper {
    height: 115px;
    background: #f8fafc;
  }

  .product-thumb-img {
    height: 100%;
  }

  .product-card-body {
    padding: 10px 12px;
  }

  .product-name {
    font-size: 13px;
    line-height: 1.3;
    margin-bottom: 4px;
    font-weight: 700;
  }

  .product-price {
    font-size: 15px;
    font-weight: 800;
  }

  /* Mobile Cart Slide-up Bottom Sheet */
  .pos-order-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100vw;
    height: 85vh;
    height: 85dvh;
    max-height: 85vh;
    z-index: 500;
    border-radius: 24px 24px 0 0;
    transform: translateY(105%);
    transition: transform 0.28s cubic-bezier(0.32, 1, 0.23, 1);
    box-shadow: 0 -10px 40px rgba(0,0,0,0.25);
    background: #ffffff;
    display: flex;
    flex-direction: column;
  }

  .pos-order-panel.mobile-open {
    transform: translateY(0);
  }

  #mobile-close-cart-btn {
    display: block !important;
    font-size: 24px;
    padding: 2px 8px;
    color: var(--text-muted);
  }

  .mobile-cart-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    z-index: 490;
  }
  .mobile-cart-backdrop.open {
    display: block;
  }

  /* Floating Sticky Cart Bar */
  .mobile-cart-bar {
    display: none; /* Managed by JS based on cart count */
    position: fixed;
    bottom: 78px; /* sits cleanly above modern floating nav */
    left: 14px;
    right: 14px;
    height: 52px;
    background: #0f172a;
    color: #fff;
    border-radius: 16px;
    padding: 0 16px;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 10px 25px -3px rgba(0,0,0,0.35);
    z-index: 400;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.12);
    backdrop-filter: blur(8px);
  }

  .mobile-cart-info {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .mobile-cart-count {
    background: var(--primary);
    color: #fff;
    font-weight: 800;
    font-size: 11px;
    padding: 3px 9px;
    border-radius: 12px;
  }

  .mobile-cart-total {
    font-size: 15px;
    font-weight: 800;
  }

  .mobile-cart-btn-txt {
    background: var(--primary);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    padding: 6px 14px;
    border-radius: 8px;
    letter-spacing: 0.3px;
  }

  /* -------------------------------------------------------------
     2026 ULTRA-MODERN FLOATING PILL BOTTOM NAVIGATION (HARMONIZED BRAND RED THEME)
     ------------------------------------------------------------- */
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 12px;
    left: 14px;
    right: 14px;
    width: auto;
    height: 64px;
    background: linear-gradient(135deg, rgba(30, 7, 14, 0.95), rgba(76, 5, 25, 0.92));
    backdrop-filter: blur(20px) saturate(200%);
    -webkit-backdrop-filter: blur(20px) saturate(200%);
    border-radius: 24px;
    border: 1px solid rgba(225, 29, 72, 0.35);
    box-shadow: 0 16px 36px -6px rgba(0, 0, 0, 0.5), 0 0 24px rgba(225, 29, 72, 0.28);
    z-index: 450;
    justify-content: space-around;
    align-items: center;
    padding: 0 6px;
  }

  .mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    color: #fecdd3;
    opacity: 0.75;
    text-decoration: none;
    background: transparent;
    border: none;
    flex: 1;
    height: 52px;
    cursor: pointer;
    gap: 3px;
    border-radius: 16px;
    transition: all 0.24s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
  }

  .nav-icon-bubble {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 30px;
    border-radius: 12px;
    transition: all 0.24s cubic-bezier(0.34, 1.56, 0.64, 1);
  }

  .mobile-nav-item svg {
    color: #fecdd3;
    transition: color 0.2s ease, transform 0.2s ease, filter 0.2s ease;
  }

  .mobile-nav-item:active {
    transform: scale(0.92);
  }

  /* 2026 Electric Crimson Neon Active State */
  .mobile-nav-item.active {
    color: #ff2a5f; /* Electric Crimson Neon glow */
    opacity: 1;
    font-weight: 800;
    text-shadow: 0 0 14px rgba(255, 42, 95, 0.9), 0 0 28px rgba(255, 42, 95, 0.5);
  }

  .mobile-nav-item.active .nav-icon-bubble {
    background: linear-gradient(135deg, rgba(255, 42, 95, 0.32), rgba(225, 29, 72, 0.18));
    border: 1px solid rgba(255, 42, 95, 0.65);
    box-shadow: 0 0 18px rgba(255, 42, 95, 0.55), inset 0 0 10px rgba(255, 42, 95, 0.3);
    transform: translateY(-2px);
  }

  .mobile-nav-item.active svg {
    color: #ff2a5f;
    transform: scale(1.12);
    stroke-width: 2.6;
    filter: drop-shadow(0 0 8px #ff2a5f) drop-shadow(0 0 14px rgba(255, 42, 95, 0.6));
  }

  .section-container {
    padding: 16px;
    padding-bottom: 95px; /* Room for modern floating bottom navigation */
  }

  .metrics-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .metric-card {
    padding: 12px;
  }

  .metric-value {
    font-size: 20px;
  }

  .form-grid-2 {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .data-table th, .data-table td {
    padding: 10px 8px;
    font-size: 12px;
  }
}
