/* ==========================================================================
   DESIGN SYSTEM & CSS VARIABLES
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Color Palette */
  --bg-primary: #0b0f19;
  --bg-secondary: #161f30;
  --bg-tertiary: #1f2c45;
  --glass-bg: rgba(22, 31, 48, 0.7);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-highlight: rgba(255, 255, 255, 0.03);
  
  --accent-primary: #6366f1; /* Indigo */
  --accent-primary-hover: #4f46e5;
  --accent-secondary: #0ea5e9; /* Sky Cyan */
  --accent-secondary-hover: #0284c7;
  
  --success: #10b981; /* Emerald */
  --warning: #f59e0b; /* Amber */
  --danger: #ef4444; /* Rose Red */
  --info: #3b82f6; /* Blue */
  
  /* Text Colors */
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --text-on-accent: #ffffff;

  /* Typography */
  --font-display: 'Outfit', 'Inter', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Spacing */
  --sidebar-width: 260px;
  --border-radius-sm: 8px;
  --border-radius-md: 12px;
  --border-radius-lg: 20px;
  --border-radius-xl: 30px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.15);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 15px rgba(99, 102, 241, 0.4);
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s ease;
}

/* ==========================================================================
   BASE STYLES & RESET
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(14, 165, 233, 0.12) 0px, transparent 50%);
  background-attachment: scroll;
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: hidden;
  display: flex;
  position: relative;
}

input, button, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

a {
  text-decoration: none;
  color: inherit;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

/* ==========================================================================
   APP LAYOUT STRUCTURE
   ========================================================================== */
.app-container {
  display: flex;
  width: 100vw;
  min-height: 100vh;
  position: relative;
}

/* Sidebar Styling */
.sidebar {
  width: var(--sidebar-width);
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  transition: var(--transition-normal);
}

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

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow);
}

.logo-text h1 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(to right, #ffffff, #c7d2fe);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-text p {
  font-size: 11px;
  color: var(--accent-secondary);
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.sidebar-menu {
  list-style: none;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
  overflow-y: auto;
}

.menu-item a {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-radius: var(--border-radius-md);
  color: var(--text-secondary);
  font-weight: 500;
  transition: var(--transition-fast);
  cursor: pointer;
}

.menu-item a:hover {
  color: var(--text-primary);
  background: var(--glass-highlight);
}

.menu-item.active a {
  color: var(--text-on-accent);
  background: linear-gradient(90deg, var(--accent-primary), rgba(99, 102, 241, 0.4));
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.25);
}

.menu-item i {
  font-size: 20px;
  width: 24px;
  text-align: center;
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.25);
  gap: 8px;
}

.sidebar-user-click {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--border-radius-sm);
  transition: background 0.2s;
  min-width: 0;
}

.sidebar-user-click:hover {
  background: rgba(255, 255, 255, 0.05);
}

.btn-logout {
  width: 34px;
  height: 34px;
  border-radius: var(--border-radius-sm);
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
  flex-shrink: 0;
}

.btn-logout:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

.btn-logout i {
  width: 16px;
  height: 16px;
}

.user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-secondary), var(--accent-primary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: #fff;
  border: 2px solid var(--glass-border);
}

.user-info h4 {
  font-size: 14px;
  font-weight: 600;
}

.user-info p {
  font-size: 11px;
  color: var(--text-secondary);
}

/* Main Content Area */
.main-content {
  margin-left: var(--sidebar-width);
  flex-grow: 1;
  padding: 24px 32px 40px;
  width: calc(100% - var(--sidebar-width));
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow-x: hidden;
}

/* Top bar style */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--glass-border);
}

/* Mobile top bar header (hidden on desktop) */
.mobile-top-header {
  display: none;
}

.page-title h2 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.page-title p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 2px;
}

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

.live-clock {
  font-family: monospace;
  font-size: 14px;
  color: var(--accent-secondary);
  background: rgba(14, 165, 233, 0.1);
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid rgba(14, 165, 233, 0.2);
}

/* ==========================================================================
   UI COMPONENT UTILITIES & GLASS CARDS
   ========================================================================== */
.card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  position: relative;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.15), transparent);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--border-radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  border: none;
  font-size: 14px;
}

.btn-icon-only {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--border-radius-sm);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-primary-hover));
  color: var(--text-on-accent);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.btn-success {
  background: linear-gradient(135deg, var(--success), #059669);
  color: white;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger), #dc2626);
  color: white;
}

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

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-success {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-info {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

/* ==========================================================================
   PAGES / VIEWS (SPA Switchable)
   ========================================================================== */
.page-view {
  display: none;
}

.page-view.active {
  display: flex;
  flex-direction: column;
  gap: 24px;
  /* No 'forwards' fill-mode: after animation completes, transform returns to none.
     This is critical — keeping transform:translateY(0) via forwards would make
     any position:fixed descendants (FAB, drawer) anchor to this element
     instead of the viewport. */
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  /* Only fade opacity — no transform, so position:fixed children stay fixed to viewport */
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ==========================================================================
   DASHBOARD VIEW
   ========================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 20px;
}

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.stat-icon.primary { background: rgba(99, 102, 241, 0.15); color: #818cf8; }
.stat-icon.secondary { background: rgba(14, 165, 233, 0.15); color: #38bdf8; }
.stat-icon.success { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.stat-icon.warning { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }

.stat-details p {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.stat-details h3 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  margin-top: 4px;
}

.dashboard-charts {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

@media (max-width: 1024px) {
  .dashboard-charts {
    grid-template-columns: 1fr;
  }
}

.chart-container {
  height: 280px;
  position: relative;
}

.dashboard-sections-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 900px) {
  .dashboard-sections-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   KASIR (TRANSACTION) VIEW — FULLSCREEN CAPABLE
   ========================================================================== */

/* Default 2-panel layout inside normal page flow */
.kasir-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 0;
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--glass-border);
  background: var(--bg-secondary);
  overflow: hidden;
  min-height: 75vh;
}

/* LEFT PANEL */
.kasir-panel-left {
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
  min-height: 75vh;
}

/* Topbar inside kasir */
.kasir-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--glass-border);
  background: var(--bg-secondary);
  flex-shrink: 0;
}

/* Category pills */
.kasir-cat-pills {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Hide scrollbar Firefox */
}

.kasir-cat-pills::-webkit-scrollbar {
  display: none; /* Hide scrollbar Chrome/Safari */
}

.kasir-cat-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.18s, transform 0.18s;
  white-space: nowrap;
  font-family: var(--font-body);
  flex-shrink: 0; /* Prevent squeezing */
}

.kasir-cat-btn:hover {
  background: rgba(255,255,255,0.07);
  color: var(--text-primary);
}

.kasir-cat-btn.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #fff;
}

/* Fullscreen button */
.kasir-fs-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 12px;
  border-radius: 20px;
  margin-left: auto;
}

/* Product grid inside kasir — scrollable */
.kasir-product-grid {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  align-content: start;
}

/* RIGHT PANEL (Cart) */
.kasir-panel-right {
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--glass-border);
  background: var(--bg-secondary);
  padding: 14px 16px;
  min-height: 500px;
  max-height: calc(100vh - 160px);
  overflow-y: auto;
}

/* Customer area */
.kasir-customer-area {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-md);
  padding: 12px 14px;
  margin-bottom: 10px;
  flex-shrink: 0;
}

/* Cart list scrollable */
.kasir-panel-right .cart-list {
  flex: 1;
  overflow-y: auto;
  min-height: 60px;
}

/* Checkout summary */
.kasir-panel-right .checkout-summary {
  flex-shrink: 0;
}

/* Pay button */
.kasir-pay-btn {
  width: 100%;
  padding: 13px;
  font-size: 15px;
  font-weight: 700;
  border-radius: var(--border-radius-md);
  margin-top: 12px;
  flex-shrink: 0;
}

/* ============================================================
   FULLSCREEN MODE — section fills entire viewport
   ============================================================ */
#view-kasir.kasir-fullscreen {
  position: fixed !important;
  top: 0;
  left: 0;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 9999;
  padding: 0 !important;
  margin: 0 !important;
  gap: 0 !important;
  display: flex !important;
  flex-direction: column;
  animation: kasirFadeIn 0.22s ease;
}

#view-kasir.kasir-fullscreen .kasir-layout {
  flex: 1;
  height: 100%;
  border-radius: 0;
  border: none;
  grid-template-columns: 1fr 360px;
  min-height: 0;
}

#view-kasir.kasir-fullscreen .kasir-panel-left {
  min-height: 0;
  height: 100%;
}

#view-kasir.kasir-fullscreen .kasir-panel-right {
  min-height: 0;
  max-height: none;
  height: 100%;
}

#view-kasir.kasir-fullscreen .kasir-topbar {
  padding: 12px 20px;
  background: rgba(10,10,20,0.98);
  backdrop-filter: blur(12px);
}

#view-kasir.kasir-fullscreen .kasir-product-grid {
  padding: 20px;
}

#view-kasir.kasir-fullscreen .kasir-panel-right {
  padding: 16px 20px;
}

@keyframes kasirFadeIn {
  from { opacity: 0.6; }
  to   { opacity: 1; }
}

@media (max-width: 1100px) {
  .kasir-layout {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .kasir-panel-left { min-height: 60vh; }
  .kasir-panel-right {
    height: auto;
    max-height: none;
    border-left: none;
    border-top: 1px solid var(--glass-border);
  }
}

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.form-control {
  background: var(--bg-primary);
  border: 1px solid var(--glass-border);
  padding: 10px 14px;
  border-radius: var(--border-radius-sm);
  color: white;
  transition: var(--transition-fast);
  outline: none;
}

select.form-control {
  height: 42px;
  padding-top: 0;
  padding-bottom: 0;
}

.form-control:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.2);
}

/* Prescription Grid (OD/OS) */
.prescription-container {
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--border-radius-md);
  border: 1px solid var(--glass-border);
  padding: 16px;
  margin-bottom: 20px;
}

.prescription-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--accent-secondary);
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 8px;
}

.rx-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 12px;
  text-align: center;
}

.rx-table th {
  font-size: 11px;
  color: var(--text-secondary);
  padding: 4px;
  font-weight: 600;
  text-transform: uppercase;
}

.rx-table td {
  padding: 4px;
}

.rx-table td:first-child {
  font-weight: 700;
  font-size: 12px;
  text-align: left;
  color: var(--text-primary);
  width: 60px;
}

.rx-input {
  width: 100%;
  padding: 6px;
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  color: white;
  text-align: center;
}

.edit-order-rx-mobile-cards {
  display: none;
}

/* Styled Switch Slider */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--glass-border);
  transition: .3s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: #94a3b8;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: rgba(99, 102, 241, 0.2);
  border-color: var(--accent-primary);
}

input:checked + .slider:before {
  transform: translateX(20px);
  background-color: var(--accent-primary);
}

/* Product Search & Catalog */
.catalog-search-box {
  position: relative;
  margin-bottom: 16px;
}

.catalog-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-sm);
  max-height: 250px;
  overflow-y: auto;
  z-index: 50;
  box-shadow: var(--shadow-lg);
  display: none;
}

.catalog-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--glass-border);
  transition: var(--transition-fast);
}

.catalog-item:hover {
  background: var(--bg-tertiary);
}

.catalog-item-info h5 {
  font-size: 14px;
  font-weight: 600;
}

.catalog-item-info p {
  font-size: 11px;
  color: var(--text-secondary);
}

.catalog-item-price {
  text-align: right;
}

.catalog-item-price .price {
  font-weight: 700;
  color: var(--accent-secondary);
  font-size: 14px;
}

.catalog-item-price .stock {
  font-size: 10px;
  color: var(--text-secondary);
}

/* Shopping Cart */
.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--glass-border);
}

.cart-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 2px;
  margin-bottom: 16px;
  min-height: 80px;
}

/* Custom scrollbar for cart list */
.cart-list::-webkit-scrollbar {
  width: 4px;
}
.cart-list::-webkit-scrollbar-track {
  background: transparent;
}
.cart-list::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.12);
  border-radius: 4px;
}
.cart-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.22);
}

.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 0;
  color: var(--text-muted);
  gap: 8px;
  text-align: center;
}

.cart-empty i {
  width: 36px;
  height: 36px;
  opacity: 0.4;
}

.cart-empty p {
  font-size: 12px;
  line-height: 1.5;
  max-width: 180px;
  opacity: 0.6;
}

/* ── Cart Item — Premium Redesign ── */
.cart-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  padding: 10px 12px;
  transition: background 0.15s, border-color 0.15s;
  position: relative;
}

.cart-item:hover {
  background: rgba(255,255,255,0.055);
  border-color: rgba(99,102,241,0.25);
}

/* Left: item number badge */
.cart-item-num {
  width: 22px;
  height: 22px;
  min-width: 22px;
  background: rgba(99,102,241,0.15);
  border: 1px solid rgba(99,102,241,0.3);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-primary);
  margin-top: 1px;
}

/* Middle: description */
.cart-item-desc {
  flex: 1;
  min-width: 0;
}

.cart-item-desc h5 {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.cart-item-type-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 2px 6px;
  border-radius: 4px;
  margin-bottom: 4px;
}

.cart-item-type-badge.frame   { background: rgba(99,102,241,0.15); color: #a5b4fc; }
.cart-item-type-badge.lensa   { background: rgba(14,165,233,0.15); color: #7dd3fc; }
.cart-item-type-badge.aksesoris { background: rgba(16,185,129,0.15); color: #6ee7b7; }

.cart-item-unit-price {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 1px;
}

/* Right: qty + price + delete */
.cart-item-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.cart-item-price {
  font-size: 13px;
  font-weight: 800;
  color: #e2e8f0;
  white-space: nowrap;
}

/* Qty control */
.qty-control {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  overflow: hidden;
  height: 26px;
}

.qty-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  width: 26px;
  height: 26px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 300;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}

.qty-btn:hover {
  background: rgba(99,102,241,0.2);
  color: #a5b4fc;
}

.qty-val {
  width: 26px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  border-left: 1px solid rgba(255,255,255,0.08);
  border-right: 1px solid rgba(255,255,255,0.08);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Delete icon */
.cart-item-delete {
  color: rgba(255,255,255,0.2);
  cursor: pointer;
  transition: color 0.15s;
  width: 14px;
  height: 14px;
  position: absolute;
  top: 8px;
  right: 10px;
}

.cart-item-delete:hover {
  color: var(--danger);
}

/* Cart Summary & Checkout */
.checkout-summary {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid var(--glass-border);
  padding-top: 16px;
  margin-bottom: 20px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-secondary);
}

.summary-row.total {
  font-size: 18px;
  font-weight: 800;
  color: white;
  border-top: 1px dotted var(--glass-border);
  padding-top: 10px;
  margin-top: 5px;
}

.summary-row.total .price {
  color: var(--accent-secondary);
}

.dp-options-container {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-md);
  padding: 12px;
  margin-bottom: 16px;
}

/* ==========================================================================
   STATUS PESANAN VIEW (ORDER LIST)
   ========================================================================== */
.filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.search-input-group {
  position: relative;
  flex-grow: 1;
  max-width: 400px;
}

.search-input-group i,
.search-input-group svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.search-input-group input {
  padding-left: 38px;
  width: 100%;
}

.table-container {
  overflow-x: auto;
  margin-top: 8px;
}

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

.app-table th {
  background: rgba(0, 0, 0, 0.2);
  padding: 14px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--glass-border);
}

.app-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--glass-border);
  font-size: 13px;
  color: var(--text-primary);
  vertical-align: middle;
}

.app-table tbody tr {
  transition: var(--transition-fast);
}

.app-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.customer-cell h5 {
  font-size: 14px;
  font-weight: 600;
}

.customer-cell p {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.rx-tag-container {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.rx-tag {
  background: var(--bg-primary);
  border: 1px solid var(--glass-border);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
}

/* ==========================================================================
   STOK VIEW (INVENTORY MANAGEMENT)
   ========================================================================== */
.tabs-container {
  display: flex;
  border-bottom: 1px solid var(--glass-border);
  gap: 8px;
  margin-bottom: 16px;
}

.tab-btn {
  padding: 12px 20px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  position: relative;
  transition: var(--transition-fast);
}

.tab-btn:hover {
  color: white;
}

.tab-btn.active {
  color: var(--accent-primary);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-primary);
  box-shadow: 0 -2px 10px var(--accent-primary);
}

/* ==========================================================================
   MODAL DIALOGS
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(4, 6, 10, 0.8);
  backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(0.9) translateY(20px);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .modal-content {
  transform: scale(1) translateY(0);
}

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

.modal-header h3 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 24px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.modal-close-btn:hover {
  color: white;
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--glass-border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: rgba(0, 0, 0, 0.15);
}

/* Responsive layout styles for details modals */
.detail-modal-profile-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 20px;
  margin-bottom: 24px;
}

.detail-modal-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.edit-order-grid {
  padding: 24px;
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 24px;
  max-height: 70vh;
  overflow-y: auto;
}

/* ==========================================================================
   PRINT INVOICE TEMPLATE
   ========================================================================== */
.receipt-paper {
  background: #ffffff;
  color: #111827;
  padding: 24px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 12px;
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  border-radius: 4px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.receipt-header {
  text-align: center;
  border-bottom: 1px dashed #9ca3af;
  padding-bottom: 16px;
  margin-bottom: 16px;
}

.receipt-header h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  margin-bottom: 4px;
  font-weight: 700;
  text-transform: uppercase;
}

.receipt-info {
  margin-bottom: 16px;
  line-height: 1.4;
}

.receipt-rx {
  border: 1px solid #111827;
  border-radius: 4px;
  padding: 8px;
  margin-bottom: 16px;
  font-size: 11px;
}

.receipt-rx h4 {
  font-family: sans-serif;
  font-size: 12px;
  margin-bottom: 6px;
  border-bottom: 1px solid #111827;
  padding-bottom: 2px;
}

.receipt-rx-table {
  width: 100%;
  border-collapse: collapse;
}

.receipt-rx-table th {
  padding: 2px;
  font-size: 9px;
  text-align: center;
  border-bottom: 1px dotted #111827;
}

.receipt-rx-table td {
  padding: 3px 2px;
  text-align: center;
}

.receipt-rx-table td:first-child {
  font-weight: bold;
  text-align: left;
}

.receipt-items {
  border-bottom: 1px dashed #9ca3af;
  padding-bottom: 12px;
  margin-bottom: 12px;
}

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

.receipt-summary {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-bottom: 1px dashed #9ca3af;
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.receipt-summary-row {
  display: flex;
  justify-content: space-between;
}

.receipt-summary-row.bold {
  font-weight: bold;
  font-size: 13px;
}

.receipt-footer {
  text-align: center;
  color: #6b7280;
  font-size: 10px;
}

/* Print CSS override (only triggered during actual printing) */
@media print {
  body * {
    visibility: hidden;
  }
  body.print-mode-rx #print-rx-card-modal,
  body.print-mode-rx #print-rx-card-modal * {
    visibility: visible;
  }
  body.print-mode-rx #print-rx-card-modal {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    background: white;
  }
  body.print-mode-invoice #print-invoice-modal,
  body.print-mode-invoice #print-invoice-modal * {
    visibility: visible;
  }
  body.print-mode-invoice #print-invoice-modal {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    background: white;
  }
  body.print-mode-warranty #print-warranty-modal,
  body.print-mode-warranty #print-warranty-modal * {
    visibility: visible;
  }
  body.print-mode-warranty #print-warranty-modal {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    background: white;
  }
  body:not(.print-mode-rx):not(.print-mode-invoice):not(.print-mode-warranty) #print-receipt-modal,
  body:not(.print-mode-rx):not(.print-mode-invoice):not(.print-mode-warranty) #print-receipt-modal * {
    visibility: visible;
  }
  body:not(.print-mode-rx):not(.print-mode-invoice):not(.print-mode-warranty) #print-receipt-modal {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    background: white;
  }
  .modal-overlay {
    background: transparent;
    position: absolute;
  }
  .modal-content {
    border: none;
    box-shadow: none;
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 100%;
    margin: 0;
    padding: 0;
    transform: none !important;
  }
  .modal-header, .modal-footer {
    display: none !important;
  }
  .receipt-paper {
    box-shadow: none;
    max-width: 100%;
    padding: 0;
    margin: 0;
  }
}

/* ==========================================================================
   DASHBOARD CUSTOM PIE & TREND GRAPH (for CSS fallback)
   ========================================================================== */
.empty-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--text-muted);
  gap: 12px;
  text-align: center;
}

.empty-placeholder i {
  font-size: 48px;
}

/* ==========================================================================
   PRODUCT GALLERY GRID & CARDS
   ========================================================================== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 4px;
  margin-top: 10px;
}

.product-item-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: var(--transition-normal);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.product-item-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.product-card-img-wrapper {
  display: block !important;
  width: 100% !important;
  height: 110px !important;
  border-radius: var(--border-radius-sm) !important;
  overflow: hidden !important;
  position: relative !important;
  background: var(--bg-primary) !important;
}

.product-card-img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  transition: var(--transition-slow);
}

.product-item-card:hover .product-card-img {
  transform: scale(1.08);
}

.product-card-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
  z-index: 5;
}

.badge-frame-tag { background: rgba(99, 102, 241, 0.85); color: #fff; }
.badge-lensa-tag { background: rgba(14, 165, 233, 0.85); color: #fff; }
.badge-aksesoris-tag { background: rgba(16, 185, 129, 0.85); color: #fff; }

.product-card-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-grow: 1;
}

.product-card-title {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  line-height: 1.3;
  height: 34px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card-subtitle {
  font-size: 10px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

.product-card-price {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-secondary);
}

.product-card-stock {
  font-size: 10px;
  color: var(--text-secondary);
}

.product-card-stock.low {
  color: var(--warning);
  font-weight: 700;
}

.product-card-stock.empty {
  color: var(--danger);
  font-weight: 700;
}

/* Button Group Styling */
.btn-group {
  display: inline-flex;
  border-radius: var(--border-radius-sm);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

.btn-group .btn {
  border-radius: 0 !important;
  margin: 0 !important;
  border: none !important;
  border-right: 1px solid var(--glass-border) !important;
  font-size: 11px !important;
  padding: 6px 12px !important;
  height: 28px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  box-shadow: none !important;
  transform: none !important;
}

.btn-group .btn:last-child {
  border-right: none !important;
}

.btn-group .btn:hover {
  transform: none !important;
  opacity: 0.9;
}

/* Custom Dropdown Action Menu Styles */
.dropdown-action-container {
  position: relative;
  display: inline-block;
}

.dropdown-trigger-btn {
  height: 30px !important;
  padding: 4px 14px !important;
  font-size: 12px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: var(--border-radius-sm) !important;
  background: var(--bg-tertiary) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--glass-border) !important;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.dropdown-trigger-btn:hover {
  background: var(--bg-secondary) !important;
}

.dropdown-action-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 6px;
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-sm);
  min-width: 140px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45);
  z-index: 100;
  overflow: hidden;
}

.dropdown-action-menu.show {
  display: block;
  animation: fadeInDropdown 0.15s ease-out;
}

.dropdown-action-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 12px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s;
  text-align: left;
}

.dropdown-action-menu a:hover {
  background: rgba(255, 255, 255, 0.05);
}

.dropdown-action-menu a i {
  width: 14px;
  height: 14px;
  color: var(--text-secondary);
}

.dropdown-action-menu a.delete-action {
  color: var(--danger);
  border-top: 1px solid var(--glass-border);
}

.dropdown-action-menu a.delete-action i {
  color: var(--danger);
}

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

.dropdown-action-menu.pop-upward {
  top: auto !important;
  bottom: 100% !important;
  margin-top: 0 !important;
  margin-bottom: 6px !important;
  animation: fadeInUpDropdown 0.15s ease-out !important;
}

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


/* ============================================================
   SETTINGS VIEW
   ============================================================ */
.settings-section-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.settings-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.settings-icon-wrap i {
  width: 20px;
  height: 20px;
}

#view-settings .card {
  transition: box-shadow 0.2s;
}

#view-settings .card:hover {
  box-shadow: 0 0 0 1px rgba(99,102,241,0.2), 0 8px 24px rgba(0,0,0,0.3);
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.settings-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 18px;
}

.settings-export-import-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 18px;
}

.settings-footer-actions {
  position: sticky;
  bottom: 0;
  background: linear-gradient(to top, var(--bg-primary) 80%, transparent);
  padding: 16px 0 4px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  z-index: 10;
}

#view-settings .form-group label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.settings-password-input {
  padding-right: 42px !important;
}

/* ==========================================================================
   LOGIN SCREEN STYLES
   ========================================================================== */
.login-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 40px 20px;
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.18) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(14, 165, 233, 0.15) 0px, transparent 50%);
  background-attachment: fixed;
  box-sizing: border-box;
}

.login-card {
  margin: auto;
  width: 100%;
  max-width: 420px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  padding: 40px 30px;
  box-shadow: var(--shadow-lg), 0 0 40px rgba(99, 102, 241, 0.05);
  display: flex;
  flex-direction: column;
  gap: 24px;
  animation: loginFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

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

.login-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.login-logo {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow), 0 8px 24px rgba(99, 102, 241, 0.2);
  margin-bottom: 8px;
}

.login-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  background: linear-gradient(135deg, #ffffff, #9ca3af);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0;
}

.login-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.login-input-group {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.login-input-group label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.login-input-wrapper {
  position: relative;
  width: 100%;
}

.login-input-wrapper > i,
.login-input-wrapper > svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 18px;
  height: 18px;
  pointer-events: none;
  transition: var(--transition-fast);
}

.login-input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-md);
  font-size: 14px;
  transition: var(--transition-normal);
  color: var(--text-primary);
}

.login-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  background: rgba(15, 23, 42, 0.8);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.login-input:focus + i,
.login-input:focus + svg {
  color: var(--accent-primary);
}

.login-password-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-password-toggle:hover {
  color: var(--text-primary);
}

.login-alert {
  padding: 12px;
  border-radius: var(--border-radius-md);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  margin-top: -4px;
  display: none; /* hidden by default */
}

.login-alert.shake {
  animation: shake 0.35s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.login-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border: none;
  border-radius: var(--border-radius-md);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: var(--transition-normal);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: var(--shadow-sm);
}

.login-btn:hover {
  background: linear-gradient(135deg, var(--accent-primary-hover), var(--accent-secondary-hover));
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow), var(--shadow-md);
}

.login-btn:active {
  transform: translateY(1px);
}

/* Mobile responsive overrides for login screen elements */
@media (max-width: 480px) {
  .login-wrapper {
    padding: 16px 12px;
  }
  .login-card {
    padding: 24px 16px;
    gap: 16px;
  }
  .login-header {
    gap: 8px;
  }
  .login-logo {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    margin-bottom: 2px;
  }
  .login-logo i,
  .login-logo svg {
    width: 20px !important;
    height: 20px !important;
  }
  .login-title {
    font-size: 22px;
  }
  .login-subtitle {
    font-size: 11px;
  }
  .login-form {
    gap: 14px;
  }
  .login-input-group {
    gap: 4px;
  }
  .login-input {
    padding: 10px 12px 10px 38px;
    font-size: 13px;
  }
  .login-input-wrapper > i,
  .login-input-wrapper > svg {
    left: 12px;
    width: 16px;
    height: 16px;
  }
  .login-btn {
    padding: 11px;
    font-size: 13px;
  }
}


/* ==========================================================================
   TOAST NOTIFICATION SYSTEM
   ========================================================================== */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 100005; /* higher than modals and overlays */
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-md);
  color: var(--text-primary);
  box-shadow: var(--shadow-lg), 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 300px;
  max-width: 450px;
  pointer-events: auto;
  opacity: 0;
  transform: translateY(-20px) scale(0.9);
  transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.toast.hide {
  opacity: 0;
  transform: scale(0.9);
  transition: all 0.25s ease;
}

.toast svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.toast-message {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}

/* Toast types */
.toast-info svg {
  color: var(--info);
}
.toast-info {
  border-left: 3px solid var(--info);
}

.toast-success svg {
  color: var(--success);
}
.toast-success {
  border-left: 3px solid var(--success);
}

.toast-warning svg {
  color: var(--warning);
}
.toast-warning {
  border-left: 3px solid var(--warning);
}

.toast-error svg {
  color: var(--danger);
}
.toast-error {
  border-left: 3px solid var(--danger);
}

/* ============================================================
   RESPONSIVE MOBILE VIEW STYLES
   ============================================================ */

/* Menu Toggle Button (Desktop: Hidden) */
.btn-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: #fff;
  cursor: pointer;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  transition: all 0.2s ease;
  margin-right: 12px;
  flex-shrink: 0;
}

.btn-menu-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--accent-secondary);
}

.btn-menu-toggle i {
  width: 18px;
  height: 18px;
}

/* Mobile cart floating bar (Desktop: Hidden) */
.mobile-cart-bar {
  display: none !important;
}

/* Mobile bottom navigation bar (Desktop: Hidden) */
.mobile-bottom-nav {
  display: none !important;
}

/* Mobile More Bottom Sheet Overlay (Desktop: Hidden) */
.mobile-more-overlay {
  display: none !important;
}

/* Sidebar overlay backdrop styling */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 99;
}
.sidebar-overlay.active {
  display: block;
}

@media (max-width: 768px) {
  body {
    display: block !important;
    min-height: 100vh !important;
    min-height: 100svh !important;
    overflow: visible !important;
  }
  
  /* Disable heavy backdrop-filters on mobile to boost rendering speed and fix disappearing contents */
  .card, 
  .sidebar, 
  .global-loader, 
  .mobile-kasir-tabs, 
  .mobile-cart-bar.active, 
  .mobile-more-overlay, 
  .sidebar-overlay, 
  .modal-overlay,
  .mobile-cart-drawer-overlay,
  .toast,
  .login-card {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  /* Increase background opacities slightly on mobile for high readability without blur */
  .sidebar-overlay {
    background: rgba(0, 0, 0, 0.65) !important;
  }
  .mobile-more-overlay {
    background: rgba(0, 0, 0, 0.75) !important;
  }
  .mobile-cart-drawer-overlay {
    background: rgba(0, 0, 0, 0.75) !important;
  }
  .modal-overlay {
    background: rgba(4, 6, 10, 0.9) !important;
  }
  
  .app-container {
    display: block !important;
    width: 100% !important;
    min-height: auto !important;
  }

  /* ── HIDE DESKTOP ELEMENTS ── */
  .btn-menu-toggle {
    display: none !important;
  }
  
  .sidebar {
    display: none !important;
  }

  /* ── MOBILE TOP HEADER (fixed at top, always visible) ── */
  .mobile-top-header {
    display: flex !important;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    height: 56px;
    background: rgba(11, 15, 25, 0.95);
    border-bottom: 1px solid rgba(255,255,255,0.07);
    box-shadow: 0 2px 24px rgba(0,0,0,0.4);
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
  }

  .mobile-top-header .mth-brand {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .mobile-top-header .mth-logo-icon {
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px rgba(99,102,241,0.4);
    flex-shrink: 0;
  }

  .mobile-top-header .mth-logo-icon i {
    width: 16px;
    height: 16px;
    color: #fff;
  }

  .mobile-top-header .mth-title {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 700;
    background: linear-gradient(to right, #ffffff, #c7d2fe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.3px;
  }

  .mobile-top-header .mth-clock {
    font-family: monospace;
    font-size: 11px;
    color: var(--accent-secondary);
    background: rgba(14, 165, 233, 0.12);
    padding: 4px 8px;
    border-radius: 12px;
    border: 1px solid rgba(14, 165, 233, 0.2);
    white-space: nowrap;
  }

  /* ── HIDE DESKTOP TOP BAR ON MOBILE ── */
  .top-bar {
    display: none !important;
  }

  /* ── MAIN CONTENT ── */
  .main-content {
    margin-left: 0 !important;
    width: 100% !important;
    /* padding-top: 56px agar konten tidak tertutup fixed header */
    padding: 56px 0 140px 0 !important;
    gap: 0 !important;
    display: block !important;
    min-height: auto !important;
    overflow: visible !important;
  }

  .main-content > .page-view {
    padding-left: 12px !important;
    padding-right: 12px !important;
    padding-top: 16px !important;
    gap: 14px !important;
  }

  .main-content > .page-view.active {
    display: block !important;
    animation: fadeIn 0.25s ease-in-out !important;
  }

  /* ── STATS CARDS ── */
  .stats-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
    margin-bottom: 24px !important;
  }
  
  .stat-card {
    padding: 14px 12px !important;
    gap: 10px !important;
    background: rgba(255, 255, 255, 0.02) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 14px !important;
    display: flex !important;
    align-items: center !important;
    position: relative;
    overflow: hidden;
  }

  /* Add subtle background glow based on card type to feel premium */
  .stat-card:nth-child(1) { border-color: rgba(16, 185, 129, 0.15) !important; }
  .stat-card:nth-child(2) { border-color: rgba(99, 102, 241, 0.15) !important; }
  .stat-card:nth-child(3) { border-color: rgba(245, 158, 11, 0.15) !important; }
  .stat-card:nth-child(4) { border-color: rgba(14, 165, 233, 0.15) !important; }
  
  .stat-card .stat-icon {
    width: 36px !important;
    height: 36px !important;
    border-radius: 10px !important;
    min-width: 36px !important;
  }
  
  .stat-card .stat-icon i,
  .stat-card .stat-icon svg {
    width: 16px !important;
    height: 16px !important;
  }
  
  .stat-card .stat-details p {
    font-size: 10px !important;
    line-height: 1.2 !important;
    margin: 0 !important;
  }

  .stat-card .stat-details h3 {
    font-size: 15px !important;
    margin-top: 2px !important;
    font-weight: 800 !important;
  }

  /* ── DASHBOARD GRIDS ── */
  .dashboard-charts {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    margin-bottom: 24px !important;
  }

  .dashboard-sections-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .chart-container {
    height: 220px !important;
  }

  /* Responsive Dashboard Widgets (Tables -> List Cards) */
  #dashboard-active-orders-list,
  #dashboard-low-stock-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
  }

  #dashboard-active-orders-list tr,
  #dashboard-low-stock-list tr {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
    position: relative !important;
    padding: 12px !important;
    border-radius: 12px !important;
    background: rgba(255,255,255,0.02) !important;
    border: 1px solid rgba(255,255,255,0.06) !important;
    box-sizing: border-box !important;
    width: 100% !important;
  }

  #dashboard-active-orders-list td,
  #dashboard-low-stock-list td {
    display: block !important;
    border: none !important;
    padding: 0 !important;
    width: 100% !important;
    white-space: normal !important;   /* Allow text wrapping */
    word-break: break-word !important; /* Force wrap on long product names */
  }

  /* Absolute badges for lists */
  #dashboard-active-orders-list td:nth-child(3),
  #dashboard-low-stock-list td:nth-child(3) {
    position: absolute !important;
    right: 12px !important;
    top: 12px !important;
    width: auto !important;
  }

  #dashboard-active-orders-list tr {
    padding-right: 100px !important;
  }

  #dashboard-low-stock-list tr {
    padding-right: 90px !important;
  }

  #dashboard-low-stock-list td:nth-child(2) {
    font-size: 10px !important;
    font-weight: 700 !important;
    color: var(--accent-secondary) !important;
    text-transform: uppercase !important;
    margin-top: 2px !important;
  }

  #view-dashboard .table-container thead {
    display: none !important;
  }

  #view-dashboard .table-container {
    border: none !important;
    background: transparent !important;
    overflow-x: visible !important; /* Prevent horizontal scroll inside dashboard cards */
  }

  #view-dashboard .app-table {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important; /* Overrides the global .app-table min-width of 480px to prevent card clipping */
  }

  /* ── CARDS ── */
  .card {
    padding: 16px !important;
    border-radius: 14px !important;
  }

  /* ── TABLES – horizontal scroll wrapper ── */
  .table-container {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .app-table {
    min-width: 480px !important;
    font-size: 12px !important;
  }

  .app-table th,
  .app-table td {
    padding: 8px 10px !important;
    white-space: nowrap !important;
  }

  /* ── MODALS ── */
  .modal-overlay {
    align-items: flex-end !important;
    padding: 0 !important;
  }

  .modal-content {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    border-radius: 20px 20px 0 0 !important;
    padding: 0 0 32px 0 !important;
    max-height: 92vh;
    overflow-y: auto;
    overflow-x: hidden !important; /* prevent horizontal scroll on the modal card itself */
  }

  /* Modal header & body padding on mobile */
  .modal-header {
    padding: 16px 18px 14px !important;
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
    z-index: 2;
    border-radius: 20px 20px 0 0;
  }

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

  .modal-body {
    padding: 16px 16px 8px !important;
  }

  /* ── EDIT ORDER MODAL RESPONSIVENESS ── */
  .edit-order-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    max-height: none !important;
    overflow: visible !important;
  }

  .edit-order-grid > div {
    min-width: 0 !important;
  }

  .edit-order-grid select.form-control,
  .edit-order-grid input.form-control {
    height: 40px !important;
    font-size: 14px !important;
  }

  .edit-order-add-tool {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }

  .edit-order-add-tool select {
    width: 100% !important;
    height: 40px !important;
    font-size: 14px !important;
  }

  .edit-order-add-tool button {
    width: 100% !important;
    height: 40px !important;
    justify-content: center !important;
    font-size: 14px !important;
  }

  .edit-order-table-container {
    max-height: none !important;
    overflow-x: hidden !important; /* prevent any horizontal overflow scroll */
    overflow-y: visible !important;
    border: none !important;
    background: transparent !important;
    margin: 0 0 16px 0 !important;
    padding: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .edit-order-footer {
    flex-direction: column-reverse !important;
    padding: 16px 16px !important;
    gap: 8px !important;
  }

  .edit-order-footer button {
    width: 100% !important;
    margin: 0 !important;
    justify-content: center !important;
  }

  .edit-order-table,
  .edit-order-table thead,
  .edit-order-table tbody,
  .edit-order-table th,
  .edit-order-table td {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important; /* override global min-width of 480px */
  }

  .edit-order-table tr {
    display: block !important;
    width: auto !important; /* let browser calculate width to avoid padding overflow */
    min-width: 0 !important;
  }

  .edit-order-table thead {
    display: none !important;
  }

  .edit-order-table .btn {
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .edit-order-table tr {
    border: 1px solid var(--glass-border) !important;
    padding: 12px 12px !important;
    background: rgba(255, 255, 255, 0.02) !important;
    border-radius: 12px !important;
    margin-bottom: 12px !important;
    box-sizing: border-box !important;
  }

  .edit-order-table td {
    padding: 8px 0 !important;
    text-align: left !important;
    border: none !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    white-space: normal !important; /* override global nowrap */
    box-sizing: border-box !important;
    width: 100% !important; /* force full width of card */
  }

  .edit-order-table td:first-child {
    display: block !important;
    font-size: 14px !important;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.05) !important;
    padding-bottom: 8px !important;
    margin-bottom: 8px !important;
  }

  .edit-order-table td:nth-child(2)::before {
    content: "Jumlah (Qty):";
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
  }

  .edit-order-table td:nth-child(3)::before {
    content: "Harga Satuan:";
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
  }

  .edit-order-table td:nth-child(4)::before {
    content: "Subtotal:";
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
  }

  .edit-order-table td:last-child {
    justify-content: space-between !important;
    padding-top: 10px !important;
    border-top: 1px dashed rgba(255, 255, 255, 0.05) !important;
  }

  .edit-order-table td:last-child::before {
    content: "Hapus Item:";
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
  }

  /* ── RX MODAL: replace table with card layout on mobile ── */
  .rx-table {
    display: none !important;  /* hide desktop table */
  }

  .rx-mobile-cards {
    display: block !important; /* show mobile cards */
  }

  .edit-order-rx-mobile-cards {
    display: flex !important;
    flex-direction: column;
    gap: 12px;
  }

  .edit-order-rx-section {
    grid-column: span 1 !important;
    width: auto !important;
    box-sizing: border-box !important;
  }

  /* ── EDIT ORDER FINANCIALS RESPONSIVENESS ── */
  .edit-order-financials {
    padding: 14px !important;
    gap: 12px !important;
    width: auto !important;
    box-sizing: border-box !important;
  }

  .edit-order-totals-summary {
    grid-template-columns: repeat(3, 1fr) !important;
    padding: 8px !important;
    gap: 6px !important;
    width: auto !important;
    box-sizing: border-box !important;
  }

  .edit-order-totals-summary span {
    font-size: 8px !important;
  }

  .edit-order-totals-summary span[id],
  .edit-order-totals-summary div[id] {
    font-size: 11px !important;
  }

  .edit-order-inputs-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    width: auto !important;
    box-sizing: border-box !important;
  }

  .edit-order-rx-toggle-container {
    padding: 10px 12px !important;
    width: auto !important;
    box-sizing: border-box !important;
  }

  /* Mobile Rx cards (shown only on mobile) */
  .rx-mobile-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 12px;
  }

  .rx-mobile-card-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--accent-secondary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .rx-mobile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .rx-mobile-field label {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 5px;
  }

  .rx-mobile-field input {
    width: 100%;
    background: rgba(255,255,255,0.06);
    border: 1.5px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 16px; /* prevents iOS zoom */
    font-family: var(--font-body);
    padding: 10px 12px;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
  }

  .rx-mobile-field input:focus {
    border-color: var(--accent-primary);
    background: rgba(99,102,241,0.08);
  }

  /* Full-width field (PD & notes) */
  .rx-mobile-field.full {
    grid-column: 1 / -1;
  }

  /* Action buttons in Rx modal: stack on mobile */
  #rx-modal .modal-body > div:last-child {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  #rx-modal .modal-body > div:last-child > div {
    flex-direction: column !important;
    gap: 8px !important;
  }

  #rx-modal .modal-body > div:last-child .btn {
    width: 100% !important;
    justify-content: center !important;
    padding: 12px !important;
    font-size: 14px !important;
  }

  /* Historical Rx table: make scrollable & hide less important columns */
  #rx-modal .table-container {
    border-radius: 12px !important;
  }

  /* ── CUSTOMER SELECT MODAL on mobile ── */
  #cust-select-modal .modal-body {
    padding: 14px 14px 8px !important;
  }

  /* Quick action buttons: full width each */
  #cust-select-modal .filter-bar + div {
    flex-direction: column !important;
    gap: 8px !important;
  }

  /* Customer table: make rows tappable */
  #cust-select-modal .app-table td,
  #cust-select-modal .app-table th {
    padding: 10px 8px !important;
    font-size: 13px !important;
  }

  /* Larger tap targets for Pilih buttons in customer table */
  #cust-select-modal .app-table .btn {
    padding: 7px 12px !important;
    font-size: 12px !important;
    width: 100% !important;
  }

  /* Search input: bigger on mobile */
  #cust-select-search {
    font-size: 16px !important; /* prevent iOS zoom */
    padding: 12px 14px !important;
    height: auto !important;
  }



  /* Form inputs in modals: prevent iOS zoom */
  .modal-content input[type="text"],
  .modal-content input[type="number"],
  .modal-content textarea {
    font-size: 16px !important;
  }

  /* ── KASIR POS ── */
  .kasir-layout {
    grid-template-columns: 1fr !important;
    min-height: auto !important;
  }
  
  .kasir-panel-left {
    padding: 12px !important;
  }
  
  .kasir-panel-right {
    border-left: none !important;
    border-top: 1px solid var(--glass-border) !important;
    max-height: none !important;
    overflow-y: visible !important;
    padding: 12px !important;
  }
  
  /* Mobile cart floating bar - positioned ABOVE bottom nav */
  .mobile-cart-bar.active {
    display: flex !important;
    position: fixed;
    bottom: 80px !important;
    left: 12px;
    right: 12px;
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 12px 18px;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 98;
    animation: fadeInUpMobileBar 0.3s ease-out;
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
  }
  
  .mobile-cart-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  
  .mobile-cart-info .label {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }
  
  .mobile-cart-info .value {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent-secondary);
  }
  
  /* Mobile bottom navigation bar styles */
  .mobile-bottom-nav {
    display: flex !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(11, 15, 25, 0.96);
    border-top: 1px solid rgba(255,255,255,0.07);
    justify-content: space-around;
    align-items: center;
    z-index: 99;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
    padding: 4px 0 env(safe-area-inset-bottom, 0px);
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
  }
  
  .mobile-nav-item {
    background: none;
    border: none;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    font-size: 9px;
    font-weight: 600;
    cursor: pointer;
    flex: 1;
    transition: all 0.2s ease;
    outline: none;
    padding: 6px 4px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
  }
  
  .mobile-nav-item i {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
    transition: color 0.2s;
  }
  
  .mobile-nav-item.active {
    color: var(--accent-primary);
  }
  
  .mobile-nav-item.active i {
    color: var(--accent-primary);
    filter: drop-shadow(0 0 4px rgba(99,102,241,0.6));
  }

  /* ── KASIR POS FILTER ── */
  .kasir-topbar {
    padding: 8px 12px !important;
  }

  .kasir-topbar > div {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .kasir-cat-pills {
    width: 100% !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    display: flex !important;
    gap: 8px !important;
    padding-bottom: 6px !important;
    scrollbar-width: none !important;
  }

  .kasir-cat-pills::-webkit-scrollbar {
    display: none !important;
  }

  .kasir-cat-btn {
    padding: 6px 14px !important;
    font-size: 11px !important;
    flex-shrink: 0 !important;
  }

  /* Mobile POS Product List */
  .kasir-product-grid {
    padding: 8px !important;
  }
  
  .product-grid {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    max-height: calc(100vh - 280px) !important;
    padding-right: 0 !important;
  }

  .product-item-card {
    flex-direction: row !important;
    align-items: center !important;
    padding: 10px 14px !important;
    gap: 14px !important;
    background: rgba(255, 255, 255, 0.02) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: 12px !important;
    min-height: auto !important;
  }

  .product-card-img-wrapper {
    width: 64px !important;
    height: 48px !important;
    flex-shrink: 0 !important;
    background: rgba(0, 0, 0, 0.2) !important;
    border-radius: 8px !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
  }

  .product-card-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
  }

  .product-card-badge {
    font-size: 8px !important;
    padding: 1px 4px !important;
    top: 2px !important;
    left: 2px !important;
    border-radius: 3px !important;
  }

  .product-card-info {
    flex: 1 !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
  }

  .product-card-title {
    font-size: 13px !important;
    font-weight: 700 !important;
    white-space: normal !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    color: #ffffff !important;
    margin: 0 !important;
    line-height: 1.3 !important;
  }

  .product-card-subtitle {
    font-size: 10px !important;
    color: var(--text-secondary) !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .product-card-footer {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    justify-content: center !important;
    gap: 4px !important;
    margin-top: 0 !important;
    flex-shrink: 0 !important;
  }

  .product-card-price {
    font-size: 13px !important;
    font-weight: 700 !important;
    color: var(--accent-secondary) !important;
  }

  .product-card-stock {
    font-size: 9px !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    font-weight: 600 !important;
  }

  /* ── FORMS ── */
  .form-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .form-control,
  .form-select {
    font-size: 16px !important; /* prevent iOS zoom */
  }

  /* ── BUTTONS ── */
  .btn {
    padding: 10px 16px !important;
    font-size: 13px !important;
  }

  /* ── PAGE SECTION HEADERS ── */
  .page-section-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
  }

  .page-section-header .btn-group {
    width: 100% !important;
  }

  .page-section-header .btn-group .btn {
    flex: 1 !important;
    justify-content: center !important;
  }

  /* ── INVENTORY TABLE ── */
  .inventory-toolbar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }
}

/* Mobile More Bottom Sheet overlay and container */
.mobile-more-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100;
  justify-content: flex-end;
  flex-direction: column;
}

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

.mobile-more-sheet {
  background: var(--bg-secondary);
  border-top: 1px solid var(--glass-border);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  padding: 20px 20px calc(95px + env(safe-area-inset-bottom, 20px));
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-height: 85vh;
  overflow-y: auto;
}

.mobile-more-overlay.active .mobile-more-sheet {
  transform: translateY(0);
}

.mobile-more-sheet .sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 12px;
}

.mobile-more-sheet .sheet-header h4 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.mobile-more-sheet .sheet-close-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.mobile-more-sheet .sheet-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.sheet-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 16px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
  border-collapse: collapse;
}

.sheet-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent-secondary);
}

.sheet-item i {
  width: 20px;
  height: 20px;
  color: var(--accent-secondary);
}

.sheet-item.danger i {
  color: var(--danger);
}

.sheet-item.danger:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

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

/* ============================================================
   MOBILE KASIR TAB NAVIGATION STYLES
   ============================================================ */
.mobile-kasir-tabs {
  display: none;
}

@media (max-width: 768px) {
  .mobile-kasir-tabs {
    display: flex !important;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 6px;
    margin-bottom: 16px;
    gap: 6px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

  .kasir-tab-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 12px 10px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
  }

  .kasir-tab-btn i {
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
  }

  .kasir-tab-btn.active {
    background: linear-gradient(90deg, var(--accent-primary), rgba(99, 102, 241, 0.6));
    color: #fff;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.25);
  }

  .kasir-tab-btn.active i {
    color: #fff;
  }

  .kasir-tab-btn .cart-badge {
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(239, 68, 68, 0.3);
  }

  /* Show/hide panels on mobile based on selected tab */
  .kasir-layout.show-katalog .kasir-panel-left {
    display: flex !important;
  }
  .kasir-layout.show-katalog .kasir-panel-right {
    display: none !important;
  }
  .kasir-layout.show-transaksi .kasir-panel-left {
    display: none !important;
  }
  .kasir-layout.show-transaksi .kasir-panel-right {
    display: flex !important;
  }
}

/* ==========================================================================
   MOBILE GOJEK-STYLE KASIR POS
   (All rules below are mobile-only via @media or display:none by default)
   ========================================================================== */

/* ── Hidden on desktop ── */
.mobile-pos-topbar,
.mobile-pos-list,
.mobile-pos-fab,
.mobile-cart-drawer-overlay,
.mobile-cart-drawer,
.orders-mobile-list,
.prescriptions-mobile-list,
.customers-mobile-list,
.inventory-mobile-list { display: none; }

@media (max-width: 768px) {

  /* ── Hide desktop kasir layout ── */
  #view-kasir .kasir-layout,
  #view-kasir .mobile-kasir-tabs {
    display: none !important;
  }

  /* ── Remove page-view padding for kasir on mobile (topbar handles it) ── */
  #view-kasir.page-view {
    padding: 0 !important;
    gap: 0 !important;
  }

  /* ===========================================
     MOBILE POS TOPBAR (Search + Chips)
     Fixed just below the mobile header
     (sticky doesn't work because parent has overflow-x: hidden)
     =========================================== */
  .mobile-pos-topbar {
    display: block !important;
    position: fixed;          /* <-- fixed, not sticky */
    top: 56px;                /* below the mobile header */
    left: 0;
    right: 0;
    z-index: 80;
    background: rgba(11, 15, 25, 0.98);
    border-bottom: 1px solid rgba(255,255,255,0.07);
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
    padding: 10px 14px 8px;
  }

  /* Search bar */
  .mobile-pos-search {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.06);
    border: 1.5px solid rgba(255,255,255,0.1);
    border-radius: 14px;
    padding: 0 14px;
    height: 46px;
    gap: 10px;
    transition: border-color 0.2s;
  }

  .mobile-pos-search:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
  }

  .mobile-pos-search .mps-icon {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    flex-shrink: 0;
  }

  .mobile-pos-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 15px;
    font-family: var(--font-body);
  }

  .mobile-pos-input::placeholder {
    color: var(--text-muted);
  }

  .mobile-pos-clear {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
  }

  .mobile-pos-clear i {
    width: 16px;
    height: 16px;
  }

  /* Category chips */
  .mobile-pos-chips {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
  }

  .mobile-pos-chips::-webkit-scrollbar { display: none; }

  .mpc-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1.5px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.04);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.18s;
    font-family: var(--font-body);
  }

  .mpc-btn i {
    width: 13px;
    height: 13px;
  }

  .mpc-btn.active {
    background: linear-gradient(135deg, var(--accent-primary), #4f46e5);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 3px 12px rgba(99,102,241,0.35);
  }

  /* ===========================================
     MOBILE PRODUCT LIST
     =========================================== */
  .mobile-pos-list {
    display: flex !important;
    flex-direction: column;
    gap: 10px;
    /* padding-top = topbar height (~110px) so list starts below fixed topbar */
    padding: 114px 14px calc(64px + env(safe-area-inset-bottom, 0px) + 16px);
    transition: padding-bottom 0.2s ease;
  }

  .mobile-pos-list.has-fab {
    padding-bottom: calc(146px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* Mobile product card — Gojek-style horizontal card */
  .mobile-product-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(22, 31, 48, 0.85);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 16px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.18s ease;
    position: relative;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-product-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(99,102,241,0.3), transparent);
  }

  .mobile-product-card:active {
    transform: scale(0.98);
    background: rgba(99,102,241,0.12);
    border-color: rgba(99,102,241,0.3);
  }

  .mobile-product-card.out-of-stock {
    opacity: 0.5;
    pointer-events: none;
  }

  /* Card image */
  .mpc-img-wrap {
    width: 70px;
    height: 70px;
    border-radius: 12px;
    background: rgba(0,0,0,0.25);
    border: 1px solid rgba(255,255,255,0.06);
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .mpc-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  /* Card info */
  .mpc-info {
    flex: 1;
    min-width: 0;
  }

  .mpc-type-chip {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 2px 7px;
    border-radius: 6px;
    margin-bottom: 4px;
  }

  .mpc-type-chip.frame { background: rgba(99,102,241,0.2); color: #818cf8; }
  .mpc-type-chip.lensa { background: rgba(14,165,233,0.2); color: #38bdf8; }
  .mpc-type-chip.aksesoris { background: rgba(16,185,129,0.2); color: #34d399; }

  .mpc-name {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
  }

  .mpc-sub {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Card right: price + stock + add button */
  .mpc-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
  }

  .mpc-price {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 800;
    color: var(--accent-secondary);
  }

  .mpc-stock {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 6px;
  }

  .mpc-stock.ok { background: rgba(16,185,129,0.15); color: #34d399; }
  .mpc-stock.low { background: rgba(245,158,11,0.15); color: #fbbf24; }
  .mpc-stock.empty { background: rgba(239,68,68,0.15); color: #f87171; }

  .mpc-add-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), #4f46e5);
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(99,102,241,0.4);
    transition: transform 0.15s;
    margin-top: 2px;
    flex-shrink: 0;
  }

  .mpc-add-btn i { width: 16px; height: 16px; }
  .mpc-add-btn:active { transform: scale(0.88); }

  /* In-cart quantity control on card */
  .mpc-qty-control {
    display: flex;
    align-items: center;
    background: rgba(99,102,241,0.15);
    border: 1px solid rgba(99,102,241,0.3);
    border-radius: 20px;
    overflow: hidden;
    margin-top: 2px;
  }

  .mpc-qty-btn {
    background: none;
    border: none;
    color: #a5b4fc;
    font-size: 18px;
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    transition: background 0.15s;
  }

  .mpc-qty-btn:active { background: rgba(99,102,241,0.25); }

  .mpc-qty-val {
    font-size: 14px;
    font-weight: 800;
    color: #fff;
    min-width: 24px;
    text-align: center;
  }

  /* Empty state */
  .mobile-pos-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-muted);
    gap: 10px;
    text-align: center;
  }

  .mobile-pos-empty i { width: 40px; height: 40px; }
  .mobile-pos-empty p { font-size: 14px; font-weight: 600; }
  .mobile-pos-empty span { font-size: 12px; }

  /* ===========================================
     MOBILE CART FAB (Gojek floating button)
     Hidden by default — shown only via .active class (toggled by JS)
     =========================================== */
  .mobile-pos-fab {
    position: fixed !important;
    bottom: calc(64px + env(safe-area-inset-bottom, 0px) + 8px) !important; /* above bottom nav */
    left: 14px;
    right: 14px;
    height: 58px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    border-radius: 16px;
    display: none;   /* hidden by default; JS adds .active to show */
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    box-shadow: 0 6px 24px rgba(99,102,241,0.5);
    z-index: 95;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
  }

  /* FAB visible state — toggled by JS via classList */
  .mobile-pos-fab.active {
    display: flex !important;
    animation: fabSlideUp 0.3s cubic-bezier(0.34,1.56,0.64,1) both;
  }

  .mobile-pos-fab:active {
    transform: scale(0.97);
    box-shadow: 0 3px 12px rgba(99,102,241,0.4);
  }

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

  .fab-left {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .fab-badge-wrap {
    position: relative;
  }

  .fab-icon { width: 22px; height: 22px; color: #fff; }

  .fab-count {
    position: absolute;
    top: -6px;
    right: -8px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 1.5px solid #4f46e5;
  }

  .fab-label {
    color: rgba(255,255,255,0.9);
    font-size: 13px;
    font-weight: 700;
  }

  .fab-right {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .fab-total {
    font-size: 15px;
    font-weight: 800;
    color: #fff;
  }

  .fab-chevron { width: 16px; height: 16px; color: rgba(255,255,255,0.7); }

  /* ===========================================
     MOBILE CART DRAWER (Bottom Sheet)
     =========================================== */
  .mobile-cart-drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 110;
  }

  .mobile-cart-drawer-overlay.open {
    display: block !important;
    animation: overlayFadeIn 0.25s ease;
  }

  @keyframes overlayFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
  }

  .mobile-cart-drawer {
    display: flex !important;
    flex-direction: column;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 88vh;
    background: var(--bg-secondary);
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    border-top: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 -10px 40px rgba(0,0,0,0.6);
    z-index: 120;
    /* Hidden off-screen until .open is applied */
    transform: translateY(110%);
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0s linear 0.35s;
  }

  .mobile-cart-drawer.open {
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0s linear 0s;
  }

  /* Drag handle */
  .drawer-handle-wrap {
    display: flex;
    justify-content: center;
    padding: 12px 0 6px;
    cursor: pointer;
    flex-shrink: 0;
  }

  .drawer-handle-bar {
    width: 40px;
    height: 4px;
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
  }

  /* Drawer header */
  .drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px 14px;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255,255,255,0.07);
  }

  .drawer-header-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 700;
  }

  .drawer-header-title i { width: 20px; height: 20px; color: var(--accent-primary); }

  .drawer-item-pill {
    background: rgba(99,102,241,0.2);
    color: #a5b4fc;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
  }

  .drawer-clear-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.2);
    color: #f87171;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s;
    font-family: var(--font-body);
  }

  .drawer-clear-btn i { width: 14px; height: 14px; }
  .drawer-clear-btn:active { background: rgba(239,68,68,0.25); }

  /* Scrollable area */
  .drawer-scroll-area {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  /* Customer section inside drawer */
  .drawer-customer-section {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 16px;
  }

  .drawer-section-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin-bottom: 8px;
  }

  .drawer-section-label i { width: 13px; height: 13px; }

  .drawer-cust-name-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
  }

  .drawer-cust-name {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    font-family: var(--font-display);
  }

  .drawer-rx-chip {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 8px;
    background: rgba(245,158,11,0.15);
    color: #fbbf24;
    border: 1px solid rgba(245,158,11,0.25);
    white-space: nowrap;
    flex-shrink: 0;
  }

  .drawer-rx-chip.has-rx {
    background: rgba(14,165,233,0.15);
    color: #38bdf8;
    border-color: rgba(14,165,233,0.25);
  }

  .drawer-cust-action-row {
    display: flex;
    gap: 8px;
  }

  .drawer-action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 8px 10px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s;
    font-family: var(--font-body);
  }

  .drawer-action-btn i { width: 13px; height: 13px; }
  .drawer-action-btn.rx { border-color: rgba(14,165,233,0.25); color: var(--accent-secondary); }
  .drawer-action-btn:active { background: rgba(255,255,255,0.1); }

  .drawer-rx-preview {
    font-size: 11px;
    margin-top: 10px;
    color: var(--text-secondary);
    padding: 8px 10px;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    border-left: 2px solid var(--accent-secondary);
    line-height: 1.5;
  }

  /* Divider */
  .drawer-divider {
    height: 1px;
    background: rgba(255,255,255,0.06);
    margin: 4px 0 16px;
  }

  /* Cart items in drawer */
  .drawer-cart-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 4px;
  }

  /* Drawer cart item row */
  .drawer-cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
    padding: 12px 14px;
  }

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

  .drawer-cart-item-name {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .drawer-cart-item-type {
    font-size: 10px;
    color: var(--accent-secondary);
    text-transform: capitalize;
    margin-top: 2px;
  }

  .drawer-cart-item-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
  }

  .drawer-cart-item-price {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-primary);
  }

  .drawer-cart-item-controls {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.06);
    border-radius: 10px;
    overflow: hidden;
  }

  .drawer-qty-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    width: 30px;
    height: 28px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    font-family: var(--font-body);
  }

  .drawer-qty-btn:active { background: rgba(255,255,255,0.1); color: #fff; }

  .drawer-qty-val {
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    min-width: 22px;
    text-align: center;
  }

  .drawer-item-delete {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    transition: color 0.15s;
  }

  .drawer-item-delete i { width: 15px; height: 15px; }
  .drawer-item-delete:active { color: var(--danger); }

  /* Empty state in drawer */
  .drawer-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 0 24px;
    color: var(--text-muted);
    gap: 8px;
    text-align: center;
  }

  .drawer-empty i { width: 36px; height: 36px; opacity: 0.5; }
  .drawer-empty p { font-size: 14px; font-weight: 600; color: var(--text-secondary); }
  .drawer-empty span { font-size: 12px; }

  /* Summary section in drawer */
  .drawer-summary {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 14px;
    padding: 14px;
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

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

  .drawer-discount-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    padding: 4px 10px;
    font-size: 13px;
    color: var(--text-muted);
  }

  .drawer-discount-input {
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 13px;
    width: 80px;
    text-align: right;
    font-family: var(--font-body);
  }

  .drawer-summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px dashed rgba(255,255,255,0.1);
    font-size: 16px;
    font-weight: 700;
    color: #fff;
  }

  .drawer-total-price {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 800;
    color: var(--accent-secondary);
  }

  /* Drawer footer pay button */
  .drawer-footer {
    padding: 14px 18px;
    padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid rgba(255,255,255,0.07);
    background: var(--bg-secondary);
    flex-shrink: 0;
  }

  .drawer-pay-btn {
    width: 100%;
    height: 54px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 20px rgba(99,102,241,0.4);
    font-family: var(--font-display);
    transition: all 0.18s;
  }

  .drawer-pay-btn i { width: 20px; height: 20px; }
  .drawer-pay-btn:active { transform: scale(0.98); box-shadow: 0 2px 10px rgba(99,102,241,0.3); }

  /* ── INVENTORY/STOK VIEW ── */
  .inventory-mobile-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
  }

  /* Hide table on mobile */
  #view-inventory .table-container {
    display: none !important;
  }

  /* Make tabs container scroll horizontally on mobile */
  #view-inventory .tabs-container {
    display: flex !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
    gap: 6px !important;
    border-bottom: 1px solid rgba(255,255,255,0.07) !important;
    padding-bottom: 4px !important;
    scrollbar-width: none !important; /* Hide scrollbar for Firefox */
    margin-bottom: 12px !important;
  }
  
  #view-inventory .tabs-container::-webkit-scrollbar {
    display: none !important; /* Hide scrollbar for Chrome/Safari */
  }

  #view-inventory .tabs-container .tab-btn {
    flex: 0 0 auto !important;
    padding: 10px 14px !important;
    font-size: 13px !important;
  }

  /* Mobile Inventory Card */
  .inv-mobile-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform 0.2s, border-color 0.2s;
  }

  .inv-mobile-card:active {
    transform: scale(0.99);
    border-color: rgba(99, 102, 241, 0.3);
  }

  .inv-card-top {
    display: flex;
    gap: 12px;
    align-items: flex-start;
  }

  .inv-card-img-wrap {
    width: 60px;
    height: 60px;
    min-width: 60px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow: hidden;
  }

  .inv-card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .inv-card-info {
    flex: 1;
    min-width: 0;
  }

  .inv-card-sku {
    display: inline-block;
    font-family: monospace;
    font-size: 10px;
    font-weight: 700;
    color: var(--accent-secondary);
    background: rgba(14, 165, 233, 0.12);
    padding: 2px 6px;
    border-radius: 6px;
    border: 1px solid rgba(14, 165, 233, 0.2);
    margin-bottom: 4px;
  }

  .inv-card-name {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .inv-card-meta {
    font-size: 11px;
    color: var(--text-secondary);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .inv-card-meta span {
    background: rgba(255,255,255,0.04);
    padding: 1px 6px;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.05);
  }

  .inv-card-prices {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0,0,0,0.15);
    border-radius: 10px;
    padding: 8px 12px;
    border: 1px solid rgba(255,255,255,0.03);
  }

  .inv-price-item {
    display: flex;
    flex-direction: column;
  }

  .inv-price-item label {
    font-size: 9px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 2px;
  }

  .inv-price-item span {
    font-size: 12px;
    font-weight: 700;
  }

  .inv-price-item span.modal-price {
    color: var(--text-secondary);
  }

  .inv-price-item span.sell-price {
    color: #fff;
    font-size: 13px;
  }

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

  .inv-actions {
    display: flex;
    gap: 8px;
  }

  .inv-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
  }

  .inv-action-btn i,
  .inv-action-btn svg {
    width: 14px;
    height: 14px;
  }

  .inv-action-btn:active {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-primary);
    border-color: rgba(99, 102, 241, 0.3);
  }

  .inv-action-btn.delete:active {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.3);
  }

  /* ── STOCK LOG CARD (HISTORY TAB) ── */
  .inv-log-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .inv-log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .inv-log-date {
    font-size: 11px;
    color: var(--text-muted);
  }

  .inv-log-item-name {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
  }

  .inv-log-item-id {
    font-family: monospace;
    font-size: 10px;
    color: var(--accent-secondary);
    margin-top: 1px;
  }

  .inv-log-notes {
    font-size: 11px;
    color: var(--text-secondary);
    background: rgba(0,0,0,0.12);
    padding: 6px 10px;
    border-radius: 8px;
    margin-top: 4px;
    border-left: 2px solid var(--accent-primary);
  }

  .inv-log-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255,255,255,0.05);
    padding-top: 8px;
    margin-top: 2px;
  }

  .inv-log-qty {
    font-size: 13px;
    font-weight: 800;
  }

  .inv-log-operator {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .inv-log-operator i,
  .inv-log-operator svg {
    width: 12px;
    height: 12px;
  }

  /* ── DAFTAR PESANAN VIEW ── */
  #view-orders .table-container {
    display: none !important;
  }

  .orders-mobile-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
  }

  .order-mobile-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .order-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 8px;
  }

  .order-card-id {
    font-family: monospace;
    font-weight: 700;
    color: var(--accent-secondary);
    font-size: 13px;
  }

  .order-card-date {
    font-size: 11px;
    color: var(--text-muted);
  }

  .order-card-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .order-card-customer {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
  }

  .order-card-rx-preview {
    font-size: 11px;
    color: var(--text-secondary);
    background: rgba(0,0,0,0.15);
    padding: 6px 10px;
    border-radius: 8px;
    border-left: 2px solid var(--accent-secondary);
  }

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

  .order-card-total {
    font-size: 14px;
    font-weight: 800;
    color: #fff;
  }

  .order-card-badges {
    display: flex;
    gap: 6px;
  }

  .order-card-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    border-top: 1px solid rgba(255,255,255,0.04);
    padding-top: 8px;
    margin-top: 2px;
  }

  /* ── RIWAYAT RESEP VIEW ── */
  #view-prescriptions .table-container {
    display: none !important;
  }

  .prescriptions-mobile-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
  }

  .hide-mobile-desc {
    display: none !important;
  }

  .rx-mobile-history-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .rx-history-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 8px;
  }

  .rx-history-card-name {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
  }

  .rx-history-card-date {
    font-size: 11px;
    color: var(--text-muted);
  }

  .rx-history-card-eyes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    background: rgba(0,0,0,0.15);
    padding: 10px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.02);
  }

  .rx-eye-preview {
    font-size: 11px;
  }

  .rx-eye-preview label {
    display: block;
    font-size: 9px;
    font-weight: 700;
    color: var(--accent-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 3px;
  }

  .rx-eye-preview span {
    color: #fff;
    font-weight: 500;
  }

  .rx-history-card-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px dashed rgba(255,255,255,0.06);
    padding-top: 8px;
    margin-top: 2px;
    font-size: 11px;
  }

  .rx-history-pd {
    color: var(--text-secondary);
    font-weight: 600;
  }

  .rx-history-notes {
    color: var(--text-muted);
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
  }

  /* ── KELOLA PELANGGAN VIEW ── */
  #view-customers .table-container {
    display: none !important;
  }

  .customers-mobile-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
  }

  .cust-mobile-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .cust-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 8px;
  }

  .cust-card-name {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
  }

  .cust-card-phone {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .cust-card-phone i,
  .cust-card-phone svg {
    width: 12px;
    height: 12px;
  }

  .cust-card-stats {
    display: flex;
    justify-content: space-between;
    background: rgba(0,0,0,0.15);
    border-radius: 10px;
    padding: 8px 12px;
    border: 1px solid rgba(255,255,255,0.02);
  }

  .cust-stat-item {
    display: flex;
    flex-direction: column;
  }

  .cust-stat-item label {
    font-size: 9px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 2px;
  }

  .cust-stat-item span {
    font-size: 12px;
    font-weight: 700;
    color: #fff;
  }

  .cust-card-rx {
    font-size: 11px;
    color: var(--text-secondary);
    background: rgba(99,102,241,0.06);
    border: 1px solid rgba(99,102,241,0.1);
    padding: 6px 10px;
    border-radius: 8px;
    line-height: 1.4;
  }

  .cust-card-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    border-top: 1px solid rgba(255,255,255,0.04);
    padding-top: 8px;
    margin-top: 2px;
  }

  /* ── PENGATURAN / SETTINGS VIEW (RESPONSIVE MOBILE ENHANCEMENTS) ── */
  #view-settings {
    padding-bottom: calc(160px + env(safe-area-inset-bottom, 0px)) !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }

  .settings-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .settings-grid > * {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .settings-form-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .settings-form-grid > * {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    grid-column: 1 / -1 !important;
  }

  .settings-export-import-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .settings-export-import-grid > * {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  #view-settings .card {
    padding: 14px !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  #view-settings .form-control,
  #view-settings input,
  #view-settings select,
  #view-settings textarea {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  /* Sticky Save Bar on Mobile */
  .settings-footer-actions {
    position: fixed !important;
    bottom: calc(64px + env(safe-area-inset-bottom, 0px)) !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
    background: rgba(15, 23, 42, 0.96) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px)) !important;
    border-top: 1px solid var(--glass-border) !important;
    box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.6) !important;
    margin-top: 0 !important;
    justify-content: space-between !important;
    display: flex !important;
    gap: 8px !important;
    z-index: 95 !important;
  }

  .settings-footer-actions .btn {
    flex: 1 1 50% !important;
    min-width: 0 !important;
    justify-content: center !important;
    font-size: 11.5px !important;
    padding: 10px 4px !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    min-height: 40px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .settings-logo-header-label {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 4px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .settings-logo-upload-wrap {
    flex-direction: column !important;
    align-items: center !important;
    gap: 12px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  #setting-logo-preview-container {
    margin: 0 auto !important;
  }

  .settings-logo-controls {
    min-width: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .settings-logo-btn-group {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .settings-logo-btn-group .btn {
    width: 100% !important;
    justify-content: center !important;
  }

  .settings-gsheet-url-wrap {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .settings-gsheet-url-wrap .btn {
    width: 100% !important;
    justify-content: center !important;
    min-height: 40px !important;
  }

  .settings-gsheet-sync-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .settings-gsheet-sync-bar p {
    margin-left: 0 !important;
  }

  .settings-gsheet-sync-bar .btn {
    width: 100% !important;
    justify-content: center !important;
    min-height: 40px !important;
  }

  .settings-danger-actions {
    flex-direction: column !important;
    width: 100% !important;
    gap: 10px !important;
    box-sizing: border-box !important;
  }

  .settings-danger-actions .btn {
    width: 100% !important;
    justify-content: center !important;
    padding: 10px 12px !important;
    min-height: 42px !important;
    white-space: normal !important;
    word-break: break-word !important;
  }

  .settings-export-import-grid .btn {
    white-space: normal !important;
    word-break: break-word !important;
    line-height: 1.3 !important;
    text-align: left !important;
  }

  #import-drop-zone {
    padding: 18px 10px !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  @media (max-width: 480px) {
    #view-settings {
      padding-left: 4px !important;
      padding-right: 4px !important;
    }

    #view-settings .card {
      padding: 12px !important;
      border-radius: 10px !important;
    }

    .settings-section-header {
      gap: 10px !important;
    }

    .settings-section-header h3 {
      font-size: 13.5px !important;
    }

    .settings-section-header p {
      font-size: 10.5px !important;
    }

    .settings-icon-wrap {
      width: 34px !important;
      height: 34px !important;
      border-radius: 8px !important;
    }

    .settings-icon-wrap i {
      width: 16px !important;
      height: 16px !important;
    }

    #google-script-modal .modal-content {
      max-width: calc(100vw - 20px) !important;
      margin: 10px auto !important;
    }
  }

} /* end @media (max-width: 768px) */

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spin {
  animation: spin 1s linear infinite;
}

/* ==========================================================
   DASHBOARD FILTER BUTTONS
   ========================================================== */
.dashboard-filter-btn {
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  border: none;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.dashboard-filter-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.dashboard-filter-btn.active {
  background: linear-gradient(135deg, var(--accent-primary), #4f46e5);
  color: #fff;
  box-shadow: 0 3px 12px rgba(99, 102, 241, 0.35);
}

/* ==========================================================
   REALTIME PULSE INDICATOR
   ========================================================== */
@keyframes pulse-ring {
  0% {
    transform: scale(0.95);
    opacity: 0.8;
  }
  85%, 100% {
    transform: scale(2.6);
    opacity: 0;
  }
}

.pulse-dot {
  position: relative;
  width: 8px;
  height: 8px;
  background-color: #34d399;
  border-radius: 50%;
  display: inline-block;
}

.pulse-dot::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #34d399;
  border-radius: 50%;
  animation: pulse-ring 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
  will-change: transform, opacity;
}

.realtime-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.1);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* clickable-price custom styling */
.clickable-price {
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-bottom: 1px dashed rgba(255,255,255,0.2);
}
.clickable-price:hover {
  color: var(--accent-secondary) !important;
  border-bottom-color: var(--accent-secondary);
}
.clickable-price i {
  opacity: 0.6;
  transition: opacity 0.2s ease;
}
.clickable-price:hover i {
  opacity: 1;
}

/* ==========================================================
   PAGE PRELOADER & LOADING OVERLAY
   ========================================================== */
.preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-primary, #0b0f19);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  opacity: 1;
  visibility: visible;
}

.preloader.fade-out {
  opacity: 0;
  visibility: hidden;
}

.preloader-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.preloader-logo {
  margin-bottom: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  will-change: transform, opacity;
}

.preloader:not(.fade-out) .preloader-logo {
  animation: pulse-logo 2.5s infinite ease-in-out;
}

.preloader-logo i {
  color: var(--accent-primary, #6366f1);
  filter: drop-shadow(0 0 15px rgba(99, 102, 241, 0.5));
}

@keyframes pulse-logo {
  0%, 100% { transform: scale(0.96); opacity: 0.7; }
  50% { transform: scale(1.04); opacity: 1; }
}

.preloader-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(255, 255, 255, 0.05);
  border-top: 3px solid var(--accent-primary, #6366f1);
  border-radius: 50%;
  margin: 0 auto 20px auto;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
  will-change: transform;
}

.preloader:not(.fade-out) .preloader-spinner,
.global-loader.active .preloader-spinner {
  animation: spin 0.8s linear infinite;
}

.preloader-text {
  font-family: var(--font-display, 'Outfit', 'Inter', sans-serif);
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 1px;
  margin: 0 0 8px 0;
}

.preloader-subtitle {
  font-family: var(--font-body, 'Inter', sans-serif);
  color: var(--text-secondary, #9ca3af);
  font-size: 13px;
  margin: 0;
}

/* Page load progress bar at top of screen for SPA transitions */
.top-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(to right, var(--accent-primary, #6366f1), var(--accent-secondary, #0ea5e9));
  z-index: 99998;
  width: 0;
  transition: width 0.3s ease, opacity 0.3s ease;
  opacity: 0;
  pointer-events: none;
}

.top-progress-bar.active {
  opacity: 1;
}

.top-progress-bar.done {
  width: 100% !important;
  opacity: 0;
  transition: width 0.3s ease, opacity 0.5s ease 0.3s;
}

.global-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(11, 15, 25, 0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease, backdrop-filter 0.25s ease;
}

.global-loader.active {
  opacity: 1;
  visibility: visible;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.global-loader-text {
  font-family: var(--font-display, 'Outfit', 'Inter', sans-serif);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  margin-top: 12px;
  text-align: center;
  letter-spacing: 0.5px;
}

@media (max-width: 768px) {
  .detail-modal-profile-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .modal-footer-scrollable {
    display: flex !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    padding: 12px 16px !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .modal-footer-scrollable .btn {
    flex: 0 0 auto !important;
  }
}

@media (max-width: 480px) {
  .detail-modal-stats-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
}

/* ── CUSTOMER SELECT MODAL RESPONSIVE STYLES ── */
.modal-cust-select-mobile-list {
  display: none !important;
  flex-direction: column;
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 4px;
}

.modal-cust-select-table-wrap {
  display: block !important;
}

.cust-select-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.cust-select-card:active,
.cust-select-card:hover {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.35);
}

.csc-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.csc-name {
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
}

.csc-phone {
  font-size: 12px;
  color: var(--accent-secondary);
  font-family: var(--font-mono, monospace);
  display: flex;
  align-items: center;
  gap: 5px;
}

.csc-btn {
  padding: 6px 14px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  flex-shrink: 0;
  pointer-events: none;
}

@media (max-width: 768px) {
  .modal-cust-select-mobile-list {
    display: flex !important;
  }
  .modal-cust-select-table-wrap {
    display: none !important;
  }
}

