:root {
  --primary: #E23744;
  --primary-dark: #BA1B28;
  --primary-light: #FFF1F2;
  --primary-accent: #FF4F5E;
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --surface-alt: #F1F5F9;
  --border: #E2E8F0;
  --border-focus: #E23744;
  --text-main: #0F172A;
  --text-muted: #64748B;
  --text-light: #94A3B8;
  --success: #10B981;
  --success-light: #ECFDF5;
  --warning: #F59E0B;
  --warning-light: #FFFBEB;
  --danger: #EF4444;
  --danger-light: #FEF2F2;
  --info: #3B82F6;
  --info-light: #EFF6FF;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 30px rgba(226,55,68,0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
  background-color: var(--bg);
  color: var(--text-main);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Sidebar Backdrop (Mobile/Tablet) */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 990;
  transition: opacity 0.25s ease;
}

.sidebar-backdrop.active {
  display: block;
}

/* Sidebar Styles */
.sidebar {
  width: 270px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 1000;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.25s ease;
}

.sidebar-header {
  padding: 22px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.mobile-close-sidebar {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text-muted);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  margin-left: auto;
  transition: var(--transition);
}

.mobile-close-sidebar:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

.logo-badge {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  box-shadow: 0 4px 10px rgba(226,55,68,0.3);
}

.logo-text h2 {
  font-size: 19px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.5px;
}

.logo-text span {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.8px;
}

.sidebar-nav {
  padding: 18px 12px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-label {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-light);
  font-weight: 700;
  padding: 12px 14px 6px;
  letter-spacing: 0.5px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 600;
  transition: var(--transition);
  cursor: pointer;
}

.nav-link:hover {
  background: var(--primary-light);
  color: var(--primary);
  transform: translateX(4px);
}

.nav-link.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 4px 12px rgba(226,55,68,0.25);
}

.nav-link i {
  font-size: 18px;
  width: 22px;
  text-align: center;
}

.nav-badge {
  margin-left: auto;
  background: #fff;
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.nav-link.active .nav-badge {
  background: #fff;
  color: var(--primary);
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.store-status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  animation: pulse 2s infinite;
}

.status-dot.closed {
  background: var(--danger);
  box-shadow: 0 0 8px var(--danger);
  animation: none;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.6; }
}

/* Main Content Area */
.main-wrapper {
  margin-left: 270px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Top Navbar */
.topbar {
  min-height: 72px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 32px;
  position: sticky;
  top: 0;
  z-index: 90;
}

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

.mobile-menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text-main);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  transition: var(--transition);
}

.mobile-menu-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

.topbar-title-wrap {
  display: flex;
  flex-direction: column;
}

.topbar-left h1 {
  font-size: 21px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.4px;
  line-height: 1.2;
}

.topbar-left p {
  font-size: 12px;
  color: var(--text-muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--primary-light);
  border: 1px solid rgba(226,55,68,0.2);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
}

.btn-toggle-shop {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}

.btn-toggle-shop:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(226,55,68,0.25);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(226,55,68,0.35);
}

.btn-secondary {
  background: var(--surface-alt);
  color: var(--text-main);
  border: 1px solid var(--border);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-secondary:hover {
  background: var(--border);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-danger:hover {
  background: #DC2626;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 6px;
}

/* Page Content */
.content-area {
  padding: 28px 32px;
  flex: 1;
}

.tab-content {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-content.active {
  display: block;
}

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

/* Stats Cards Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  border-color: #cbd5e1;
}

/* Responsive Dashboard Grids */
.analytics-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.quick-launch-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.stat-card-info p {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-card-info h3 {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-main);
  margin: 4px 0;
}

.stat-card-info span {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--success);
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

/* Card Containers */
.panel-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  margin-bottom: 28px;
  overflow: hidden;
}

.panel-card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.panel-card-header h2 {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-card-body {
  padding: 24px;
}

/* Search and Filters Bar */
.filter-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.search-input-box {
  position: relative;
  min-width: 260px;
}

.search-input-box i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
}

.search-input-box input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  outline: none;
  transition: var(--transition);
  background: var(--surface-alt);
}

.search-input-box input:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(226,55,68,0.12);
}

.select-box {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  background: var(--surface-alt);
  color: var(--text-main);
  outline: none;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.select-box:focus {
  border-color: var(--primary);
  background: #fff;
}

/* Data Table */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  max-width: 100%;
}

.table-responsive::-webkit-scrollbar {
  height: 6px;
}

.table-responsive::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.custom-table th {
  background: var(--surface-alt);
  padding: 14px 18px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border-bottom: 1px solid var(--border);
}

.custom-table td {
  padding: 16px 18px;
  font-size: 13.5px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

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

.custom-table tbody tr:hover {
  background: #FAFAFA;
}

.product-cell {
  display: flex;
  align-items: center;
  gap: 14px;
}

.product-cell img {
  width: 46px;
  height: 46px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-alt);
}

.product-cell-meta h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}

.product-cell-meta p {
  font-size: 12px;
  color: var(--text-muted);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 700;
}

.badge-bestseller {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(226,55,68,0.2);
}

.badge-category {
  background: var(--surface-alt);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.badge-stock-in {
  background: var(--success-light);
  color: var(--success);
}

.badge-stock-low {
  background: var(--warning-light);
  color: var(--warning);
}

.badge-stock-out {
  background: var(--danger-light);
  color: var(--danger);
}

.badge-order-0 {
  background: #FEF3C7;
  color: #92400E;
} /* Ordered */

.badge-order-1 {
  background: #DBEAFE;
  color: #1E40AF;
} /* Received */

.badge-order-2 {
  background: #EDE9FE;
  color: #5B21B6;
} /* Dispatched */

.badge-order-3 {
  background: #D1FAE5;
  color: #065F46;
} /* Delivered */

/* Actions Cell */
.actions-cell {
  display: flex;
  gap: 6px;
}

.btn-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.btn-icon:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-icon.delete:hover {
  background: var(--danger-light);
  border-color: var(--danger);
  color: var(--danger);
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

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

.modal-box {
  background: #fff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
  animation: modalPop 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-box.modal-lg {
  max-width: 860px;
}

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

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

.modal-header h3 {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
}

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

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.form-group.col-span-2 {
  grid-column: span 2;
}

.form-group label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

.form-control {
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  outline: none;
  background: var(--surface-alt);
  color: var(--text-main);
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(226,55,68,0.12);
}

/* POS Terminal Layout */
.pos-layout {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 24px;
  height: calc(100vh - 150px);
}

.pos-catalog {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
  overflow-y: auto;
  padding: 10px 2px;
  flex: 1;
}

.pos-item {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pos-item:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.pos-item img {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.pos-item h5 {
  font-size: 13px;
  font-weight: 700;
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pos-item p {
  font-size: 14px;
  font-weight: 800;
  color: var(--primary);
  margin-top: 4px;
}

.pos-billing {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pos-bill-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-alt);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pos-cart-list {
  flex: 1;
  overflow-y: auto;
  padding: 14px 20px;
}

.pos-cart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
}

.pos-cart-item-title {
  font-size: 13.5px;
  font-weight: 700;
}

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

.pos-qty-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pos-qty-btn {
  width: 24px;
  height: 24px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  font-weight: 800;
}

.pos-bill-summary {
  padding: 18px 20px;
  border-top: 1px solid var(--border);
  background: #FAFBFD;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 13.5px;
  margin-bottom: 6px;
  color: var(--text-muted);
}

.summary-row.total {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
  border-top: 1px solid var(--border);
  padding-top: 10px;
  margin-top: 10px;
}

/* Printable Bill Format */
@media print {
  body * {
    visibility: hidden;
  }
  #printableReceipt, #printableReceipt * {
    visibility: visible;
  }
  #printableReceipt {
    position: absolute;
    left: 0;
    top: 0;
    width: 80mm;
    padding: 10px;
    font-family: monospace;
    font-size: 12px;
  }
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--text-main);
  color: #fff;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideLeft 0.3s ease;
}

.toast.success {
  background: #065F46;
  border-left: 4px solid var(--success);
}

.toast.error {
  background: #991B1B;
  border-left: 4px solid var(--danger);
}

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

/* ================= COMPREHENSIVE RESPONSIVE DESIGN (TABLETS & SMARTPHONES) ================= */

/* Mobile Bottom Navigation Bar (Smartphones & Small Tablets <= 768px) */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.08);
  z-index: 9990;
  padding: 4px 6px;
  padding-bottom: max(6px, env(safe-area-inset-bottom));
  justify-content: space-around;
  align-items: center;
}

.mobile-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: #64748B;
  font-size: 11px;
  font-weight: 600;
  gap: 3px;
  padding: 6px 2px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  text-decoration: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.mobile-nav-item i {
  font-size: 18px;
  transition: transform 0.2s ease, color 0.2s ease;
}

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

.mobile-nav-item.active {
  color: var(--primary);
  font-weight: 700;
}

.mobile-nav-item.active i {
  color: var(--primary);
  transform: translateY(-1px);
}

.mobile-nav-icon-wrap {
  position: relative;
  display: inline-flex;
}

.mobile-nav-badge {
  position: absolute;
  top: -5px;
  right: -9px;
  background: #DC2626;
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 800;
  min-width: 17px;
  height: 17px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.4);
}

/* --- 1. Desktops & Laptops (1025px - 1300px) --- */
@media (max-width: 1300px) {
  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
  .catalog-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
  }
  .quick-launch-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
}

/* --- 2. Tablets & Small Laptops (769px - 1024px) --- */
@media (max-width: 1024px) {
  /* Sidebar Drawer */
  .sidebar {
    width: min(300px, 85vw);
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 10000;
    transform: translateX(-100%);
    box-shadow: 0 0 40px rgba(15, 23, 42, 0.45);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

  .sidebar-backdrop.active {
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-close-sidebar {
    display: flex;
  }

  .main-wrapper {
    margin-left: 0 !important;
    width: 100%;
    max-width: 100vw;
    min-width: 0;
  }

  .mobile-menu-btn {
    display: inline-flex;
  }

  .topbar {
    padding: 12px 18px;
    min-height: 64px;
    gap: 14px;
  }

  .topbar-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
  }

  .content-area {
    padding: 18px 16px;
  }

  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
  }

  .analytics-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .pos-layout {
    grid-template-columns: 1fr;
    height: auto;
    gap: 18px;
  }

  .pos-catalog {
    max-height: 520px;
  }

  .pos-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
  }

  .catalog-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
  }

  #deliveryMap {
    height: 380px;
  }

  .modal-box,
  .modal-card {
    max-width: 90vw !important;
    max-height: 88vh !important;
  }
}

/* --- 3. Smartphones & Tablets Portrait (<= 768px) --- */
@media (max-width: 768px) {
  /* Bottom Nav active on mobile */
  .mobile-bottom-nav {
    display: flex;
  }

  .content-area {
    padding: 12px 12px 84px 12px !important;
  }

  /* Two-row mobile topbar: Clean title row + swipeable chip bar */
  .topbar {
    padding: 10px 14px 6px 14px;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    min-height: auto;
    position: sticky;
    top: 0;
    z-index: 100;
  }

  .topbar-left {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .topbar-title-wrap {
    flex: 1;
    margin-left: 8px;
  }

  .topbar-title-wrap h1 {
    font-size: 17px;
    line-height: 1.2;
  }

  .topbar-title-wrap p {
    font-size: 11px;
    display: none; /* Hidden on phones to keep topbar ultra compact */
  }

  /* Horizontal swipeable chip bar on phone - ZERO clutter */
  .topbar-actions {
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    gap: 8px;
    padding: 2px 2px 6px 2px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .topbar-actions::-webkit-scrollbar {
    display: none;
  }

  .topbar-actions button,
  .topbar-actions .live-indicator,
  .topbar-actions .btn-toggle-rain {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 6px 12px !important;
    font-size: 12px !important;
    border-radius: 20px;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
  }

  /* Panel cards */
  .panel-card {
    margin-bottom: 16px;
    border-radius: 14px;
  }

  .panel-card-header {
    padding: 12px 14px;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .panel-card-header h2 {
    font-size: 15px;
  }

  .panel-card-body {
    padding: 14px 12px;
  }

  /* Dashboard Filter Bar on Mobile */
  .dashboard-filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .dashboard-filter-left {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .date-range-preset-group {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 6px;
    width: 100%;
    padding-bottom: 2px;
  }

  .date-range-preset-group::-webkit-scrollbar {
    display: none;
  }

  .date-preset-btn {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 6px 12px;
    font-size: 12px;
  }

  .dashboard-filter-right {
    width: 100%;
  }

  .btn-customize-dashboard {
    width: 100%;
    justify-content: center;
    padding: 8px 12px;
  }

  /* Search & Filter controls */
  .filter-bar {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .search-input-box {
    width: 100%;
    min-width: 100%;
  }

  .select-box {
    width: 100%;
    font-size: 14px;
  }

  .filter-bar .btn-primary {
    width: 100%;
    justify-content: center;
    min-height: 40px;
  }

  /* 2-Column Stats Grid on Mobile (Blinkit / Swiggy partner dashboard style) */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  .stat-card {
    padding: 12px 14px;
    border-radius: 12px;
  }

  .stat-card-info p {
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .stat-card-info h3 {
    font-size: 19px;
    margin: 3px 0;
  }

  .stat-card-info span {
    font-size: 10px;
  }

  .stat-icon {
    width: 36px;
    height: 36px;
    font-size: 16px;
    border-radius: 8px;
  }

  .quick-launch-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  /* Table responsiveness & smooth scrolling */
  .table-responsive {
    border-radius: 10px;
    -webkit-overflow-scrolling: touch;
    box-shadow: inset -5px 0 8px -4px rgba(15, 23, 42, 0.08);
  }

  .custom-table {
    min-width: 580px;
    font-size: 12px;
  }

  .custom-table th {
    position: sticky;
    top: 0;
    z-index: 3;
    padding: 10px 12px;
    white-space: nowrap;
  }

  .custom-table td {
    padding: 10px 12px;
  }

  .badge {
    font-size: 10.5px;
    padding: 3px 7px;
    white-space: nowrap;
  }

  .action-cell,
  .custom-table td:last-child {
    white-space: nowrap;
  }

  .custom-table td .btn-icon,
  .custom-table td button {
    touch-action: manipulation;
  }

  /* Siren Banner on Mobile */
  .siren-alert-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px 14px;
    text-align: center;
    border-radius: 12px;
  }

  .siren-alert-banner > div:first-child {
    flex-direction: column;
    text-align: center;
    align-items: center;
    gap: 6px;
  }

  .siren-alert-banner > div:last-child {
    width: 100%;
    display: flex;
    gap: 8px;
  }

  .siren-alert-banner button {
    flex: 1;
    text-align: center;
    justify-content: center;
    padding: 8px 12px;
    font-size: 12px;
  }

  /* POS layout on Mobile */
  .pos-layout {
    grid-template-columns: 1fr;
    height: auto;
    gap: 16px;
  }

  .pos-catalog {
    max-height: 460px;
    padding: 14px;
    border-radius: 12px;
  }

  .pos-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
    padding: 6px 2px;
  }

  .pos-item {
    padding: 10px 8px;
  }

  .pos-item img {
    width: 56px;
    height: 56px;
  }

  .pos-item h5 {
    font-size: 12px;
    max-width: 120px;
  }

  .pos-billing {
    border-radius: 12px;
  }

  .pos-bill-header {
    padding: 12px 14px;
  }

  .pos-cart-list {
    max-height: 240px;
    padding: 10px 14px;
  }

  .pos-bill-summary {
    padding: 14px;
  }

  #deliveryMap {
    height: 300px;
    border-radius: 10px;
  }

  /* Modals on Mobile */
  .modal-backdrop,
  .modal-overlay {
    padding: 10px;
    align-items: center;
    justify-content: center;
  }

  .modal-card,
  .modal-box {
    width: 95vw !important;
    max-width: 95vw !important;
    max-height: 88vh !important;
    padding: 18px 14px !important;
    margin: auto !important;
    border-radius: 16px !important;
  }

  .modal-header {
    padding: 14px 16px;
  }

  .modal-header h3 {
    font-size: 16px;
  }

  .modal-body {
    padding: 16px 14px;
  }

  .form-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .form-group.col-span-2 {
    grid-column: span 1 !important;
  }

  /* 16px font size on inputs to strictly prevent iOS Safari auto-zoom */
  .form-control,
  .select-box,
  input[type="text"],
  input[type="number"],
  input[type="date"],
  input[type="datetime-local"],
  input[type="tel"],
  input[type="password"],
  select,
  textarea {
    font-size: 16px !important;
    min-height: 42px;
  }

  .modal-footer {
    padding: 14px 16px;
    flex-direction: column-reverse;
    gap: 8px;
    width: 100%;
  }

  .modal-footer button {
    width: 100%;
    min-height: 42px;
    justify-content: center;
  }

  /* Toasts safely above Mobile Bottom Nav */
  .toast-container {
    bottom: 76px !important;
    left: 12px !important;
    right: 12px !important;
    max-width: calc(100vw - 24px) !important;
  }

  .toast {
    padding: 10px 14px;
    font-size: 12px;
    border-radius: 10px;
  }
}

/* --- 4. Small Smart Phones (<= 480px) --- */
@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  .stat-card {
    padding: 10px 12px;
    border-radius: 10px;
  }

  .stat-card-info p {
    font-size: 10px;
  }

  .stat-card-info h3 {
    font-size: 17px;
    margin: 2px 0;
  }

  .stat-card-info span {
    font-size: 9px;
  }

  .stat-icon {
    width: 32px;
    height: 32px;
    font-size: 14px;
    border-radius: 6px;
  }

  .topbar-title-wrap h1 {
    font-size: 15.5px;
  }

  .product-cell img {
    width: 34px;
    height: 34px;
  }

  .pos-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  #deliveryMap {
    height: 250px;
  }

  .login-card {
    padding: 24px 18px;
    margin: 10px;
    border-radius: 16px;
  }
}

/* --- 5. Ultra-Compact Devices (<= 360px) --- */
@media (max-width: 360px) {
  .stats-grid {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .topbar-title-wrap h1 {
    font-size: 14px;
  }

  .mobile-bottom-nav {
    height: 58px;
  }

  .mobile-nav-item span {
    font-size: 9.5px;
  }
}

/* Admin Login Overlay */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at center, rgba(226, 55, 68, 0.08) 0%, rgba(15, 23, 42, 0.85) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  background: var(--surface);
  width: 100%;
  max-width: 420px;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  padding: 36px 30px;
  animation: modalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-header {
  text-align: center;
}

/* Modal Overlay & Card Support */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex !important;
}

.modal-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 48px rgba(0,0,0,0.25);
  border: 1px solid var(--border);
  animation: modalPop 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Siren Alert Banner */
.siren-alert-banner {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(90deg, #DC2626, #991B1B, #DC2626);
  background-size: 200% 200%;
  animation: sirenPulse 0.8s ease infinite;
  color: #fff;
  padding: 12px 24px;
  z-index: 999999;
  box-shadow: 0 4px 25px rgba(220, 38, 38, 0.7);
  align-items: center;
  justify-content: space-between;
}

.siren-alert-banner.active {
  display: flex !important;
}

@keyframes sirenPulse {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Rain / Surge Pricing Toggle */
.btn-toggle-rain {
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  color: #2563EB;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}

.btn-toggle-rain:hover {
  background: #DBEAFE;
}

.btn-toggle-rain.active {
  background: linear-gradient(135deg, #1D4ED8, #2563EB) !important;
  color: #ffffff !important;
  border-color: #1D4ED8 !important;
  box-shadow: 0 0 16px rgba(37, 99, 235, 0.45);
  animation: rainGlow 1.5s infinite alternate;
}

@keyframes rainGlow {
  from { box-shadow: 0 0 6px rgba(37,99,235,0.4); }
  to { box-shadow: 0 0 18px rgba(37,99,235,0.85); }
}

/* Delivery Fleet & Map */
#deliveryMap {
  height: 540px;
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  z-index: 1;
}

.rider-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  margin-bottom: 10px;
}

.rider-card:hover {
  border-color: #94A3B8;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.rider-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #E0E7FF;
  color: #4F46E5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
}

.status-badge-avail {
  background: #DCFCE7;
  color: #15803D;
  font-weight: 700;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
}

.status-badge-busy {
  background: #FEF3C7;
  color: #B45309;
  font-weight: 700;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
}

/* Barcode Scanner Modal Viewfinder */
#barcodeScannerReader {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 2px dashed #94A3B8;
  background: #000;
}

/* Expiry Date Warnings */
.badge-expiry-urgent {
  background: #FEE2E2;
  color: #DC2626;
  border: 1px solid #FCA5A5;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
}

.badge-expiry-warning {
  background: #FEF3C7;
  color: #D97706;
  border: 1px solid #FCD34D;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
}

/* Thermal POS Printing Support (58mm / 80mm) */
@media print {
  body * {
    visibility: hidden !important;
  }
  #printableReceipt, #printableReceipt * {
    visibility: visible !important;
  }
  #printableReceipt {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 76mm !important;
    padding: 3mm !important;
    font-family: 'Courier New', Courier, monospace !important;
    color: #000000 !important;
    background: #ffffff !important;
    font-size: 12px !important;
    line-height: 1.3 !important;
    display: block !important;
  }
  @page {
    size: 80mm auto;
    margin: 0;
  }
}

/* ================= FESTIVAL & CAMPAIGN SHOWCASE MANAGER ================= */
.campaign-master-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #1E293B, #0F172A);
  color: #FFFFFF;
  padding: 24px;
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.1);
  flex-wrap: wrap;
  gap: 16px;
}
.campaign-master-info h3 {
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.campaign-master-info p {
  color: #94A3B8;
  font-size: 13px;
  max-width: 600px;
}
.campaign-toggle-wrapper {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.08);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.campaign-toggle-wrapper .switch-label {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.5px;
}
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 56px;
  height: 30px;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #64748B;
  transition: .3s;
  border-radius: 30px;
}
.toggle-slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.toggle-switch input:checked + .toggle-slider {
  background-color: #10B981;
}
.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(26px);
}
.preset-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}
.preset-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #FFFFFF;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition);
}
.preset-chip-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.color-input-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}
.color-input-wrapper input[type="color"] {
  -webkit-appearance: none;
  border: 1px solid var(--border);
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: none;
  padding: 2px;
}
.color-input-wrapper input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}
.color-input-wrapper input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 6px;
}
.campaign-preview-box {
  background: #F1F5F9;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: sticky;
  top: 90px;
}
.campaign-preview-phone {
  background: #FFFFFF;
  border-radius: 24px;
  box-shadow: 0 15px 35px rgba(0,0,0,0.12);
  border: 4px solid #E2E8F0;
  padding: 16px;
  max-width: 380px;
  margin: 0 auto;
}
.campaign-preview-hero {
  border-radius: 18px;
  padding: 16px;
  color: #FFFFFF;
  transition: all 0.3s ease;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}
.campaign-preview-bento {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 10px;
  margin-top: 12px;
}
.preview-bento-hero {
  border-radius: 14px;
  background: #FFFFFF;
  color: #0F172A;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 190px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.06);
}
.preview-bento-small-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.preview-bento-small-card {
  border-radius: 12px;
  background: #FFFFFF;
  color: #0F172A;
  padding: 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 91px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}
.bento-tag-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: #FFF1F2;
  color: var(--primary);
  width: fit-content;
}

/* Responsive Campaign Grid */
.campaign-editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.bento-small-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.bento-small-card-grid .form-group:last-child {
  grid-column: 1 / -1;
  margin-bottom: 0;
}
.campaign-theme-colors-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

/* Universal Gallery Upload Component */
.gallery-upload-group {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
}
.gallery-upload-group .form-control {
  flex: 1 1 auto;
  min-width: 0;
}
.btn-gallery-pick {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #F1F5F9;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
  height: 40px;
}
.btn-gallery-pick:hover {
  background: #E2E8F0;
  border-color: #94A3B8;
  color: var(--primary);
  transform: translateY(-1px);
}
.gallery-thumb-container {
  position: relative;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 6px;
  border: 1.5px solid var(--border);
  overflow: hidden;
  background: #F8FAFC;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-thumb-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gallery-thumb-clear {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 16px;
  height: 16px;
  background: rgba(15, 23, 42, 0.75);
  color: #FFFFFF;
  border: none;
  border-radius: 50%;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  transition: background 0.2s;
}
.gallery-thumb-clear:hover {
  background: #EF4444;
}

/* Preview Hero Background (Images & Animated GIFs) */
.campaign-preview-hero {
  position: relative;
  overflow: hidden;
}
.preview-hero-bg {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
}
.preview-hero-scrim {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.2), rgba(0,0,0,0.6));
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
}
.preview-hero-content {
  position: relative;
  z-index: 3;
}

/* Responsive Media Queries */
@media (max-width: 1100px) {
  .campaign-editor-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .campaign-preview-box {
    position: static;
    max-width: 480px;
    margin: 20px auto 0;
  }
}

@media (max-width: 768px) {
  .campaign-master-banner {
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    gap: 14px;
  }
  .campaign-toggle-wrapper {
    width: 100%;
    justify-content: space-between;
  }
  .bento-small-card-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .bento-small-card-grid .form-group:last-child {
    grid-column: 1 / -1;
  }
  .campaign-theme-colors-grid {
    grid-template-columns: 1fr;
  }
  .preset-chips-container {
    gap: 8px;
  }
  .preset-chip-btn {
    padding: 6px 12px;
    font-size: 12px;
  }
  .campaign-preview-box {
    padding: 14px;
    max-width: 100%;
  }
  .campaign-preview-phone {
    border-radius: 18px;
    padding: 12px;
    max-width: 100%;
  }
}

@media (max-width: 540px) {
  .bento-small-card-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .gallery-upload-group {
    flex-wrap: wrap;
  }
  .gallery-upload-group .btn-gallery-pick {
    width: 100%;
    justify-content: center;
  }
}

/* --- ADVANCED ADMIN PANEL SUITE EXTENSIONS --- */

/* Expanded Order Badges */
.badge-order-0 { background: #EEF2FF; color: #4F46E5; border: 1px solid #C7D2FE; } /* Placed / New */
.badge-order-1 { background: #E0F2FE; color: #0284C7; border: 1px solid #BAE6FD; } /* Confirmed */
.badge-order-2 { background: #FEF3C7; color: #D97706; border: 1px solid #FDE68A; } /* Preparing */
.badge-order-3 { background: #F3E8FF; color: #7C3AED; border: 1px solid #DDD6FE; } /* Out for Delivery */
.badge-order-4 { background: #FEE2E2; color: #DC2626; border: 1px solid #FECACA; } /* Cancelled */
.badge-order-5 { background: #ECFDF5; color: #059669; border: 1px solid #A7F3D0; } /* Delivered */
.badge-order-6 { background: #FFF1F2; color: #E11D48; border: 1px solid #FFE4E6; } /* Return / Refund */

/* Customer Block / Active Status */
.status-pill-active {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 12px;
  background: #ECFDF5;
  color: #059669;
  font-size: 11px;
  font-weight: 700;
}
.status-pill-blocked {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 12px;
  background: #FEE2E2;
  color: #DC2626;
  font-size: 11px;
  font-weight: 700;
}

/* Inventory Ledger Table & Reasons */
.stock-badge-restock { background: #ECFDF5; color: #059669; padding: 2px 8px; border-radius: 6px; font-weight: 600; font-size: 11px; }
.stock-badge-damaged { background: #FEE2E2; color: #DC2626; padding: 2px 8px; border-radius: 6px; font-weight: 600; font-size: 11px; }
.stock-badge-expired { background: #FFFBEB; color: #D97706; padding: 2px 8px; border-radius: 6px; font-weight: 600; font-size: 11px; }
.stock-badge-audit { background: #EFF6FF; color: #2563EB; padding: 2px 8px; border-radius: 6px; font-weight: 600; font-size: 11px; }

/* Reports Filter Bar & Export Actions */
.reports-filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  padding: 16px 20px;
  background: #F8FAFC;
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}
.btn-export-excel {
  background: #10B981;
  color: #FFFFFF;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-export-excel:hover {
  background: #059669;
}
.btn-print-report {
  background: #3B82F6;
  color: #FFFFFF;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-print-report:hover {
  background: #2563EB;
}

/* Settings Sections */
.settings-section-card {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.settings-section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 0;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #F1F5F9;
  padding-bottom: 10px;
}

/* ================= ENTERPRISE ADMIN FEATURES STYLING ================= */

/* Dashboard Date Filter & Customization Bar */
.dashboard-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: #FFFFFF;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.btn-customize-dashboard {
  background: #F1F5F9;
  color: #334155;
  border: 1px solid #CBD5E1;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}
.btn-customize-dashboard:hover {
  background: #E2E8F0;
  color: #0F172A;
}

/* Widget Toggle Checkbox Grid inside Modal */
.widgets-toggle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.widget-toggle-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
}
.widget-toggle-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* Customer Segmentation Pills */
.segment-pills-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 16px;
}
.segment-pill {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  background: #F1F5F9;
  color: #475569;
  border: 1px solid #E2E8F0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}
.segment-pill:hover {
  background: #E2E8F0;
  color: #0F172A;
}
.segment-pill.active {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
  box-shadow: 0 2px 6px rgba(226, 55, 68, 0.25);
}

/* Fraud Badges & Account Restriction Pills */
.badge-fraud-warning {
  background: #FEF3C7;
  color: #B45309;
  font-weight: 700;
  font-size: 10.5px;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #FCD34D;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.badge-cod-restricted {
  background: #FEE2E2;
  color: #DC2626;
  font-weight: 700;
  font-size: 10.5px;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #FCA5A5;
}
.badge-banned {
  background: #1E293B;
  color: #FFFFFF;
  font-weight: 700;
  font-size: 10.5px;
  padding: 2px 6px;
  border-radius: 4px;
}

/* Audit Log Category Badges */
.audit-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
}
.audit-tag-product { background: #E0E7FF; color: #4338CA; }
.audit-tag-stock { background: #FEF3C7; color: #B45309; }
.audit-tag-order { background: #ECFDF5; color: #059669; }
.audit-tag-wallet { background: #F3E8FF; color: #7E22CE; }
.audit-tag-setting { background: #F1F5F9; color: #334155; }
.audit-tag-coupon { background: #FCE7F3; color: #BE185D; }
.audit-tag-security { background: #FEE2E2; color: #DC2626; }

/* Stock Delta & Adjustment Badges */
.stock-delta-positive {
  color: #059669;
  font-weight: 800;
}
.stock-delta-negative {
  color: #DC2626;
  font-weight: 800;
}

/* Delivery Zone Tag */
.zone-pill {
  background: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}



