/* ================================================
   KHUYEN STORE - LIGHT THEME STYLES
   ================================================ */

/* Color Variables */
:root {
  --bg-primary: #f2ffff;
  --bg-surface: rgba(255, 255, 255, 0.95);
  --bg-surface-gradient: linear-gradient(90deg, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0.2) 100%);
  --bg-surface-solid: #FFFFFF;
  --border-color: rgba(192, 204, 204);
  --primary: #0066FF;
  --primary-hover: #0052CC;
  --primary-light: rgba(0, 102, 255, 0.1);
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #445c5c;
  --success: #0066FF;
  --success-light: rgba(0, 102, 255, 0.1);
  --danger: #ed0e0e;
  --danger-light: rgba(237, 14, 14, 0.1);
  --warning: #784b00;
  --warning-light: rgba(120, 75, 0, 0.1);
  --info: #3B82F6;
  --info-light: rgba(59, 130, 246, 0.1);
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.05); }
::-webkit-scrollbar-thumb { background: #D4C4B5; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #C4B4A5; }

/* Selection */
::selection { background: rgba(0, 102, 255, 0.2); color: #1A1A2E; }

/* Glass Card */
.glass-card {
  background: var(--bg-surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.glass-card-sm {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

/* Responsive grid for forms */
.responsive-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: start;
}

@media (max-width: 640px) {
  .responsive-grid-2 {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

/* Page Background */
.page-bg {
  background-color: var(--bg-primary);
  min-height: 100vh;
}

/* Body text */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}
body { background-color: var(--bg-primary); color: var(--text-primary); }

/* ================================================
   TOAST NOTIFICATIONS
   ================================================ */
.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 50px;
  min-width: 280px;
  max-width: 380px;
  pointer-events: auto;
  animation: slideIn 0.3s ease;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.toast.success { background: rgba(255, 255, 255, 0.85); border: 1px solid #28a745; color: #155724; }
.toast.error { background: rgba(255, 255, 255, 0.85); border: 1px solid #dc3545; color: #721c24; }
.toast.info { background: rgba(255, 255, 255, 0.85); border: 1px solid #007bff; color: #004085; }
.toast.warning { background: rgba(255, 255, 255, 0.85); border: 1px solid #ffc107; color: #856404; }

.toast-close {
  margin-left: auto;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
}
.toast-close:hover { opacity: 1; }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(100%); }
}

/* ================================================
   LAYOUT
   ================================================ */
  .app-layout {
    display: flex;
    min-height: 100vh;
  }

  /* Full-width page variant (for pages without sidebar) */
  .app-layout.full-width .main-content {
    margin-left: 0 !important;
    max-width: 100%;
  }

  .sidebar {
  width: 240px;
  background: var(--bg-surface-solid);
  backdrop-filter: blur(12px);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform 0.3s ease, width 0.3s ease;
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.06);
  overflow: visible;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 99;
}

  .main-content {
    margin-left: 240px;
    flex: 1;
    min-width: 0;
    max-width: 100%;
    min-height: 100vh;
    padding: 24px 24px 24px 24px;
    transition: margin-left 0.3s ease;
  }

/* Sticky page header (desktop/tablet). Mobile uses .mobile-top-header */
@media (min-width: 641px) {
  .sticky-page-header {
    position: sticky;
    top: 0;
    z-index: 60;
    padding-top: 16px;
    margin-top: -16px;
    margin-left: -24px;
    margin-right: -24px;
    padding-left: 24px;
    padding-right: 24px;
    width: calc(100% + 48px);
    max-width: none;
    box-sizing: border-box;
    background: transparent;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
}

/* Mobile top header (fixed at top) */
.mobile-top-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background: var(--bg-surface-solid);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  height: 54px;
}

@media (max-width: 640px) {
  .mobile-top-header {
    display: flex;
  }
  .page-bg {
    padding-top: 54px;
  }
}
.mobile-top-header-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.mobile-top-header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

/* Mobile header toggle: icon only (no frame) */
.mobile-header-toggle {
  border: none;
  background: transparent;
  padding: 6px;
  margin-left: auto;
  color: var(--text-primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  flex-shrink: 0;
}
.mobile-header-toggle:hover {
  background: rgba(0, 0, 0, 0.05);
}
.mobile-header-toggle:active {
  background: rgba(0, 0, 0, 0.1);
}
.mobile-top-header-logo {
  width: 34px;
  height: 34px;
  background: var(--primary);
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Mobile sidebar - sticky when scrolling */
@media (max-width: 640px) {
  .sidebar { 
    transform: translateX(-100%); 
    position: fixed;
    top: 0;
    height: 100vh;
    z-index: 200;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.active { display: block; }
  .main-content { margin-left: 0 !important; padding: 12px; padding-top: 24px; }
  .sidebar-collapse-toggle { display: none !important; }
}

/* Sidebar collapse toggle button - positioned half inside/half outside sidebar */
.sidebar-collapse-toggle {
  position: absolute;
  right: -14px;
  top: 50%;
  margin-top: -14px;
  width: 28px;
  height: 28px;
  background: var(--bg-surface-solid);
  border: 2px solid var(--border-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: right 0.3s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  z-index: 200;
  padding: 0;
  outline: none;
}

.sidebar-collapse-toggle:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(0, 102, 255, 0.3);
}

.sidebar-collapse-toggle:active {
  transform: scale(0.95);
}

.sidebar-collapse-toggle svg {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  transition: transform 0.3s ease, color 0.2s ease;
}

.sidebar-collapse-toggle:hover svg {
  color: var(--primary);
}

/* When sidebar is collapsed, toggle button stays at same position, only icon rotates */
.sidebar.collapsed .sidebar-collapse-toggle svg {
  transform: rotate(180deg);
}

/* Sidebar collapsed state */
.sidebar.collapsed {
  width: 64px !important;
}
.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 10px;
  margin: 2px 4px;
  position: relative;
}
.sidebar.collapsed .nav-item > div:first-child {
  margin: 0;
}
.sidebar.collapsed .nav-item-text {
  display: none;
}
.sidebar.collapsed .sidebar-brand-text {
  display: none;
}
.sidebar.collapsed .sidebar-logo-wrapper {
  justify-content: center;
}

@media (min-width: 481px) and (max-width: 1024px) {
  .sidebar.collapsed ~ .main-content {
    margin-left: 64px !important;
  }
  .sidebar.collapsed .sidebar-collapse-toggle {
    right: -14px !important;
  }
}

/* ================================================
   NAVIGATION
   ================================================ */
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 10px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  cursor: pointer;
  margin: 2px 8px;
  position: relative;
}

.nav-item:hover { background: rgba(0, 102, 255, 0.06); color: var(--primary); }
.nav-item:hover > div:first-child { transform: scale(1.05); }
.nav-item.active { background: var(--primary-light); color: var(--primary); }
.nav-item.active > div:first-child { background: var(--primary) !important; box-shadow: 0 4px 10px rgba(0, 102, 255, 0.35); }
.nav-item.active > div:first-child i { color: #fff !important; }
.nav-item svg, .nav-item i { width: 18px; height: 18px; flex-shrink: 0; transition: transform 0.2s ease; }
.nav-section-title { font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-muted); padding: 16px 24px 4px; font-weight: 600; }

/* ================================================
   SIDEBAR NOTIFICATION (Dự báo nhập)
   - Thêm chấm đỏ nhấp nháy trên icon + text của menu "Kho hàng"
   - Hoạt động với cả trạng thái active và không active
   ================================================ */
.nav-item.notification-blink {
  position: relative;
  background: rgba(239, 68, 68, 0.08) !important;
  color: #EF4444 !important;
  animation: navBlinkBg 1.4s ease-in-out infinite;
}
.nav-item.notification-blink > div:first-child {
  background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%) !important;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.45) !important;
  animation: navBlinkIcon 1.4s ease-in-out infinite;
}
.nav-item.notification-blink > div:first-child i { color: #fff !important; }
.nav-item.notification-blink > div:last-child { color: #EF4444 !important; font-weight: 700; }

/* Chấm đỏ ở góc trên-phải icon */
.nav-item.notification-blink > div:first-child::after {
  content: '';
  position: absolute;
  top: 4px;
  right: 4px;
  width: 10px;
  height: 10px;
  background: #fff;
  border: 2px solid #EF4444;
  border-radius: 50%;
  animation: navBlinkDot 1.4s ease-in-out infinite;
}

@keyframes navBlinkBg {
  0%, 100% { background: rgba(239, 68, 68, 0.05) !important; }
  50%      { background: rgba(239, 68, 68, 0.18) !important; }
}
@keyframes navBlinkIcon {
  0%, 100% { transform: scale(1);   box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35); }
  50%      { transform: scale(1.12); box-shadow: 0 6px 18px rgba(239, 68, 68, 0.65); }
}
@keyframes navBlinkDot {
  0%, 100% { transform: scale(1);   opacity: 1; }
  50%      { transform: scale(0.6); opacity: 0.6; }
}

/* Khi menu đang active (đang ở trang Kho hàng) mà vẫn có notify */
.nav-item.active.notification-blink {
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.12), rgba(0, 102, 255, 0.12)) !important;
  color: #EF4444 !important;
}

/* ================================================
   BUTTONS
   ================================================ */
.btn-primary {
  background: var(--primary);
  color: white;
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'Inter', sans-serif;
  box-shadow: 0 2px 8px rgba(0, 102, 255, 0.25);
}
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0, 102, 255, 0.35); }
.btn-primary:active { transform: translateY(0); box-shadow: 0 2px 6px rgba(0, 102, 255, 0.2); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-secondary {
  background: rgba(255, 255, 255, 0.95);
  color: var(--text-primary);
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 500;
  font-size: 14px;
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'Inter', sans-serif;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.btn-secondary:hover { background: rgba(255, 255, 255, 1); border-color: var(--primary); color: var(--primary); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); }

.btn-danger {
  background: var(--danger-light);
  color: var(--danger);
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 13px;
  border: 1px solid rgba(237, 14, 14, 0.2);
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 6px rgba(237, 14, 14, 0.1);
}
.btn-danger:hover { background: rgba(237, 14, 14, 0.15); box-shadow: 0 4px 10px rgba(237, 14, 14, 0.15); }

.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05); }
.btn-icon { padding: 8px; border-radius: 9999px; background: rgba(255, 255, 255, 0.95); border: 1px solid var(--border-color); color: var(--text-secondary); cursor: pointer; transition: all 0.2s; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05); }
.btn-icon:hover { background: rgba(255, 255, 255, 1); color: var(--text-primary); border-color: var(--primary); box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08); }
.btn-icon.danger:hover { background: #FEE2E2; color: #DC2626; border-color: #DC2626; box-shadow: 0 4px 10px rgba(220, 38, 38, 0.2); }

/* ================================================
   FORMS
   ================================================ */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: var(--text-primary); margin-bottom: 6px; font-family: 'Inter', sans-serif; }
.form-label .required { color: var(--danger); margin-left: 2px; }
.form-label .optional { color: var(--text-muted); font-weight: 400; font-size: 12px; }

.form-input {
  width: 100%;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s;
  box-sizing: border-box;
}
.form-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1); }
.form-input::placeholder { color: var(--text-muted); }
.form-input:disabled { opacity: 0.5; cursor: not-allowed; }

/* Override disabled opacity for table edit inputs (role-based restriction, not actual disabled state) */
.data-table select.edit-branch-dropdown:disabled,
.data-table select.edit-time-dropdown:disabled,
.data-table input.edit-date-input:disabled {
  opacity: 1 !important;
  cursor: not-allowed !important;
}

select.form-input { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }

/* Checkbox chips */
.checkbox-chip {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}
.checkbox-chip input[type="checkbox"] {
  display: none;
}
.checkbox-chip span {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  background: white;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  transition: all 0.2s;
}
.checkbox-chip input[type="checkbox"]:checked + span {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}
.checkbox-chip:hover span {
  border-color: var(--primary);
  color: var(--primary);
}

textarea.form-input { resize: vertical; min-height: 80px; }

/* ================================================
   DATE / DATETIME INPUTS — Universal Fix
   Applied to ALL date/datetime inputs across all pages
   ================================================ */

/* Base: ensure box-sizing + consistent sizing for ALL date inputs */
input[type="date"],
input[type="datetime-local"],
input[type="time"] {
  box-sizing: border-box;
  height: 43px;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--text-primary);
  background: white;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  vertical-align: middle;
}

/* date/datetime inputs with .form-input class — override inline height/width */
input[type="date"].form-input,
input[type="datetime-local"].form-input {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  height: 43px !important;
  box-sizing: border-box !important;
  padding: 10px 14px !important;
}

/* Date input calendar icon — webkit */
input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  padding: 2px;
  border-radius: 4px;
  transition: filter 0.2s;
  filter: invert(0.3);
  vertical-align: middle;
  margin-left: 4px;
}
input[type="date"]::-webkit-calendar-picker-indicator:hover {
  filter: invert(0.5);
  background: rgba(0, 0, 0, 0.05);
}
input[type="date"]::-moz-calendar-picker-indicator {
  cursor: pointer;
  padding: 2px;
  border-radius: 4px;
  filter: invert(0.3);
  vertical-align: middle;
  margin-left: 4px;
}

.input-wrapper { position: relative; }
.input-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); width: 18px; height: 18px; pointer-events: none; }
.input-wrapper .form-input { padding-left: 40px; }
.input-toggle { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); cursor: pointer; transition: color 0.2s; }
.input-toggle:hover { color: var(--primary); }

/* ================================================
   TABLES
   ================================================ */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
}

.data-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 10;
  background: #ebf2f2;
}

.data-table td {
  padding: 6px 16px;
  border-bottom: 1px solid rgba(192, 204, 204, 0.4);
  color: var(--text-primary);
  vertical-align: middle;
}

#appointments-grid td {
  padding-top: 5px;
  padding-bottom: 5px;
}

.data-table tbody tr { transition: background 0.15s; }
.data-table tbody tr:hover { background: rgba(0, 102, 255, 0.03); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table { border-radius: 0 0 12px 12px; overflow: hidden; }
.data-table th:first-child { border-top-left-radius: 0; }
.data-table th:last-child { border-top-right-radius: 0; }

/* Time dropdown in table */
.data-table select.edit-time-dropdown {
  background: transparent !important;
  border: 1px solid transparent !important;
  color: #445c5c !important;
  box-shadow: none !important;
  cursor: pointer;
  font-size: 12px !important;
  font-weight: 600 !important;
  padding: 4px 8px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}
.data-table select.edit-time-dropdown:hover {
  border-color: var(--border-color) !important;
  background: rgba(255, 255, 255, 0.8) !important;
}
.data-table select.edit-time-dropdown option {
  color: #445c5c;
  font-size: 12px;
}

/* Branch dropdown in table */
.data-table select.edit-branch-dropdown {
  background: transparent !important;
  border: 1px solid transparent !important;
  color: #445c5c !important;
  box-shadow: none !important;
  cursor: pointer;
  font-size: 14px !important;
  font-weight: 600 !important;
  padding: 4px 8px;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  background-image: none !important;
  text-transform: uppercase !important;
}
.data-table select.edit-branch-dropdown:hover {
  border-color: var(--border-color) !important;
  background: rgba(255, 255, 255, 0.8) !important;
}
.data-table select.edit-branch-dropdown option {
  color: #445c5c;
  font-size: 12px;
}

/* Date input in table */
.data-table input.edit-date-input {
  color: #445c5c !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  box-shadow: none !important;
  padding: 4px 16px 4px 4px !important;
  width: 110px;
  position: relative;
}
.data-table input.edit-date-input::-webkit-calendar-picker-indicator {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  opacity: 0.6;
}
.data-table input.edit-date-input:disabled::-webkit-calendar-picker-indicator {
  cursor: not-allowed;
}
.data-table input.edit-date-input:hover {
  border-color: var(--border-color) !important;
  background: rgba(255, 255, 255, 0.8) !important;
}
.data-table input.edit-date-input:hover::-webkit-calendar-picker-indicator {
  opacity: 1;
}

/* Created time cell in appointment table */
.data-table td:nth-child(2) {
  color: #445c5c !important;
  font-size: 11px !important;
}

/* Stock status */
.stock-ok { color: var(--primary); }
.stock-low { color: var(--warning); }
.stock-out { color: var(--danger); }

/* ================================================
   BADGES
   ================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
}
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-info { background: var(--info-light); color: var(--info); }
.badge-muted { background: rgba(156, 163, 175, 0.1); color: var(--text-secondary); }

/* ================================================
   MODALS
   ================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
}
.modal-overlay.show { opacity: 1; visibility: visible; }

.modal {
  background: var(--bg-surface-solid);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95);
  transition: transform 0.2s;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}
.modal-overlay.show .modal { transform: scale(1); }
.modal-lg { max-width: 720px; }
.modal-large { max-width: 900px; }
.modal-sm { max-width: 400px; }
.modal-header { padding: 20px 24px; border-bottom: 1px solid var(--border-color); display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-size: 18px; font-weight: 700; font-family: 'Inter', sans-serif; color: var(--text-primary); }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border-color); display: flex; justify-content: flex-end; gap: 10px; }

/* ================================================
   CARDS
   ================================================ */
.card { background: var(--bg-surface-gradient); backdrop-filter: blur(12px); border: 1px solid var(--border-color); border-radius: 16px; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06); }
.card-header { padding: 14px 16px; border-bottom: 1px solid var(--border-color); display: flex; align-items: center; justify-content: space-between; background: linear-gradient(90deg, rgba(155, 182, 207, 0.5) 0%, rgba(255, 255, 255, 0) 100%); border-radius: 16px 16px 0 0; }
.card-title { font-size: 16px; font-weight: 700; font-family: 'Inter', sans-serif; color: var(--text-primary); }
.card-body { padding: 24px; }

/* KPI Cards */
.kpi-card {
  background: var(--bg-surface);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 99999px;
  padding: 20px;
  transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1); border-color: rgba(0, 102, 255, 0.3); }

/* ================================================
   TABS
   ================================================ */
.tab-nav { display: flex; gap: 4px; padding: 4px; background: linear-gradient(90deg,rgba(235, 242, 242, 1) 0%, rgba(255, 255, 255, 0) 100%); border-radius: 10px; border: 1px solid var(--border-color); }
.tab-btn {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.tab-btn.active { background: var(--primary); color: white; }
.tab-btn:hover:not(.active) { color: var(--primary); background: var(--primary-light); }

/* Service Account Sub-tabs */
.subtab-nav { display: flex; gap: 4px; padding: 4px; background: rgba(255, 255, 255, 0.6); border-radius: 10px; border: 1px solid var(--border-color); }
.subtab-btn {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.subtab-btn.active { background: var(--primary); color: white; }
.subtab-btn:hover:not(.active) { color: var(--primary); background: var(--primary-light); }
.sa-subtab-content { animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* ================================================
   PRODUCT CARDS
   ================================================ */
.product-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.2s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}
.product-card:hover { border-color: rgba(0, 102, 255, 0.4); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1); }
.product-card-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #F5F0EB;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.product-card-img img { width: 100%; height: 100%; object-fit: cover; }
.product-card-img .placeholder-img { color: #C4B4A5; }
.product-card-body { 
  padding: 12px; 
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.product-card-name { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; font-family: 'Inter', sans-serif; white-space: normal; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-clamp: 2; line-height: 1.4; height: 2.8em; }
.product-card-price { font-size: 14px; font-weight: 700; color: var(--primary); font-family: 'Poppins', sans-serif; }
.product-card-price .original { font-size: 11px; color: var(--text-muted); text-decoration: line-through; font-weight: 400; margin-left: 6px; }
.product-card-stock { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.add-to-cart-btn {
  width: 100%;
  height: 30px;
  padding: 0 4px;
  margin-top: 6px;
  background: linear-gradient(135deg, #0066FF 0%, #0052CC 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.add-to-cart-btn:hover {
  background: linear-gradient(135deg, #0052CC 0%, #0044AA 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 102, 255, 0.3);
}
.add-to-cart-btn:active {
  transform: translateY(0);
}
.add-to-cart-btn.added {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

/* ================================================
   CART
   ================================================ */
.cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(229, 213, 200, 0.5);
}
.cart-item:last-child { border-bottom: none; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: 13px; font-weight: 500; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-item-price { font-size: 12px; color: var(--text-secondary); }
.cart-qty-control { display: flex; align-items: center; gap: 8px; }
.qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.8);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  font-size: 16px;
}
.qty-btn:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }
.qty-value { font-size: 14px; font-weight: 600; color: var(--text-primary); min-width: 24px; text-align: center; }
.cart-total-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; font-size: 14px; }
.cart-total-row.final { font-size: 18px; font-weight: 700; color: var(--primary); border-top: 2px solid var(--border-color); margin-top: 8px; padding-top: 16px; }

/* ================================================
   INVOICE PRINT
   ================================================ */
@media print {
  body * { visibility: hidden; }
  #invoice-print, #invoice-print * { visibility: visible; }
  #invoice-print { position: absolute; left: 0; top: 0; width: 80mm; padding: 8px; font-family: monospace; font-size: 12px; }
}

/* ================================================
   MISC
   ================================================ */
.divider { border: none; border-top: 1px solid var(--border-color); margin: 16px 0; }
.text-primary { color: var(--primary); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.font-heading { font-family: 'Inter', sans-serif; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Background decoration */
.bg-blob {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(80px);
  opacity: 0.08;
}
.bg-blob-1 { width: 400px; height: 400px; background: var(--primary); top: -100px; right: -100px; }
.bg-blob-2 { width: 300px; height: 300px; background: var(--primary); bottom: -50px; left: -50px; }

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  color: var(--text-muted);
  text-align: center;
}
.empty-state svg { width: 48px; height: 48px; margin-bottom: 12px; opacity: 0.5; }
.empty-state p { font-size: 14px; }

/* Checkbox */
.checkbox-wrapper { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.checkbox-wrapper input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; border-radius: 4px; }

/* Search bar */
.search-bar { position: relative; }
.search-bar .form-input { padding-left: 40px; border-radius: 9999px; background: linear-gradient(90deg, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0.2) 100%); }
.search-bar svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); width: 18px; height: 18px; }

/* Action buttons in tables */
.action-group { display: flex; gap: 6px; }

/* Payment method selector */
.payment-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 13px;
  color: var(--text-secondary);
}
.payment-option:hover { border-color: var(--primary); background: var(--primary-light); }
.payment-option.selected { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.payment-option input { display: none; }

/* Mobile responsive helpers */
@media (max-width: 640px) {
  .hide-mobile { display: none !important; }
  .show-mobile-only { display: inline-flex !important; }
  .card-body { padding: 16px; }
  .modal-body { padding: 16px; }
}

@media (min-width: 641px) {
  .show-mobile-only { display: none !important; }
}

/* Chart container */
.chart-container { width: 100%; height: 300px; }

/* Loading spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(0, 102, 255, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Inventory row colors */
.inventory-row.warning { background: rgba(245, 158, 11, 0.05); }
.inventory-row.danger { background: rgba(239, 68, 68, 0.05); }

/* Toggle switch */
.toggle-switch { position: relative; width: 40px; height: 22px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; inset: 0; background: var(--border-color); border-radius: 22px; transition: 0.3s; }
.toggle-slider::before { content: ''; position: absolute; height: 16px; width: 16px; left: 3px; bottom: 3px; background: white; border-radius: 50%; transition: 0.3s; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.toggle-switch input:checked + .toggle-slider { background: var(--primary); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); }

/* File upload preview */
.image-preview { width: 80px; height: 80px; border-radius: 10px; object-fit: cover; border: 1px solid var(--border-color); background: #F5F0EB; }
.upload-area { border: 2px dashed var(--border-color); border-radius: 12px; padding: 24px; text-align: center; cursor: pointer; transition: all 0.2s; }
.upload-area:hover { border-color: var(--primary); background: var(--primary-light); }

/* ================================================
   LOGIN PAGE - RESPONSIVE
   ================================================ */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  padding: 36px;
}

/* Tablet */
@media (max-width: 768px) {
  .login-card {
    padding: 28px 24px;
    max-width: 100%;
  }
}

/* Mobile */
@media (max-width: 480px) {
  .login-wrapper {
    padding: 12px;
    align-items: flex-start;
    padding-top: 24px;
  }
  .login-card {
    padding: 20px 16px;
    border-radius: 12px;
  }
  .login-logo {
    width: 48px !important;
    height: 48px !important;
    border-radius: 12px !important;
  }
  .login-logo svg {
    width: 24px !important;
    height: 24px !important;
  }
  .login-title {
    font-size: 22px !important;
  }
  .login-subtitle {
    font-size: 12px !important;
  }
  .login-demo {
    font-size: 11px !important;
    padding: 10px 12px !important;
  }
  .login-demo code {
    font-size: 11px !important;
  }
  .login-footer {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}

/* Very small screens */
@media (max-width: 360px) {
  .login-wrapper {
    padding: 8px;
    padding-top: 16px;
  }
  .login-card {
    padding: 16px 12px;
  }
  .form-group {
    margin-bottom: 12px;
  }
  .form-input {
    padding: 9px 12px;
    font-size: 13px;
  }
  .input-icon, .input-wrapper .form-input {
    padding-left: 36px;
  }
  .input-icon {
    left: 10px;
  }
}

/* Responsive form groups */
@media (max-width: 768px) {
  .form-group {
    margin-bottom: 14px;
  }
}

/* Mobile - form buttons */
@media (max-width: 480px) {
  .form-buttons-row {
    flex-direction: column;
    gap: 10px;
  }
  .form-buttons-row button {
    min-width: 100% !important;
    width: 100%;
  }
}

/* ================================================
   APPOINTMENT TABLE - Table Layout
   ================================================ */
.table-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow-x: auto;
  overflow-y: auto;
  max-height: calc(100vh - 250px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* View Calendar tab: show full table without scroll limit */
#view-section .table-container {
  max-height: none !important;
  overflow-y: visible !important;
}

.data-table .apt-notes-input {
  background: transparent;
  border: 1px solid transparent;
  color: #445c5c;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  padding: 4px 8px;
  border-radius: 6px;
  width: 100%;
  min-width: 150px;
  transition: all 0.2s;
}

.data-table .apt-notes-input:hover {
  border-color: var(--border-color);
  background: rgba(255, 255, 255, 0.8);
}

.data-table .apt-notes-input:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
  color: var(--text-primary);
}

.data-table .apt-notes-input::placeholder {
  color: var(--text-muted);
}

.data-table .status-dropdown {
  padding: 5px 12px;
  border-radius: 9999px;
  border: 1px solid;
  font-size: 11px;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  text-transform: uppercase;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  padding-right: 22px;
  transition: all 0.2s;
  min-width: 70px;
  width: 100%;
  text-align: center;
  text-align-last: center;
}
.status-dropdown option {
  text-align: center;
}

.data-table .status-dropdown:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 102, 255, 0.2);
}

.data-table .action-buttons {
  display: flex;
  gap: 8px;
  align-items: center;
}

.data-table .action-buttons i {
  cursor: pointer;
  transition: all 0.2s;
  padding: 4px;
  border-radius: 4px;
}

.data-table .action-buttons i:hover {
  background: rgba(0, 0, 0, 0.05);
}

.data-table .action-buttons i[data-lucide="copy"]:hover {
  color: var(--info) !important;
}

.data-table .action-buttons i[data-lucide="trash-2"]:hover {
  color: var(--danger) !important;
}

.data-table .contact-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  font-family: 'Inter', sans-serif;
}

.table-row:hover {
  background: rgba(0, 0, 0, 0.02) !important;
}

.stt-cell {
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}

.empty-cell {
  text-align: center;
  padding: 40px 16px !important;
}

/* Responsive table */
@media (max-width: 1200px) {
  .table-container {
    max-height: none;
    overflow-y: visible;
  }
}

@media (max-width: 768px) {
  .table-container {
    max-height: none;
    overflow-y: visible;
  }
  
  .data-table th,
  .data-table td {
    padding: 10px 12px;
    font-size: 13px;
  }
}

/* ================================================
   APPOINTMENT GRID - Card Layout (Legacy)
   ================================================ */
.appointments-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.appointment-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}

.appointment-card {
  background: var(--bg-surface);
  border: 1px solid;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 260px;
  transition: all 0.2s;
}

.appointment-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.appointment-card.empty-slot {
  background: transparent;
  border: 1px dashed rgba(229, 213, 200, 0.5);
  min-height: 260px;
}

.apt-header {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-bottom: none;
}

.apt-customer {
  display: flex;
  align-items: center;
  gap: 8px;
}

.apt-contact-via {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.contact-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: 'Inter', sans-serif;
}

.apt-body {
  padding: 12px 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.apt-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.apt-row i {
  flex-shrink: 0;
  margin-top: 2px;
}

.apt-row span:first-of-type {
  min-width: 80px;
  color: var(--text-muted);
}

.apt-row strong {
  color: var(--text-primary);
  font-weight: 500;
}

.apt-notes {
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.apt-notes-input {
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.staff-row {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid rgba(229, 213, 200, 0.5);
}

.staff-row i[data-lucide="copy"]:hover {
  color: var(--info) !important;
}

.staff-icon-group {
  display: flex;
  gap: 4px;
  align-items: center;
}

.staff-icon-group i[data-lucide="trash-2"]:hover {
  color: var(--danger) !important;
}

.staff-icon-group.hidden {
  display: none !important;
}

.apt-footer {
  padding: 12px 14px;
  border-top: 1px solid rgba(229, 213, 200, 0.5);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.status-dropdown {
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid;
  font-size: 13px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
  transition: all 0.2s;
}

.status-dropdown:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 102, 255, 0.2);
}

.personal-note {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: white;
  color: var(--text-primary);
  font-size: 12px;
  font-family: 'Inter', sans-serif;
  resize: none;
  min-height: 60px;
  transition: all 0.2s;
}

.personal-note:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
}

.personal-note::placeholder {
  color: var(--text-muted);
}

/* Responsive - Tablet */
@media (max-width: 1200px) {
  .appointment-row {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Responsive - Small tablet */
@media (max-width: 900px) {
  .appointment-row {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Responsive - Mobile */
@media (max-width: 640px) {
  .appointment-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  
  .apt-header {
    padding: 10px 12px;
  }
  
  .apt-body {
    padding: 10px 12px;
  }
  
  .apt-footer {
    padding: 10px 12px;
  }
  
  .apt-row {
    font-size: 12px;
  }
  
  .apt-row span:first-of-type {
    min-width: 70px;
  }

  /* Booking form - stack fields on tablet */
  .responsive-grid-2 {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

/* Very small mobile */
@media (max-width: 480px) {
  .appointment-row {
    grid-template-columns: 1fr;
  }
  
  .appointment-card {
    min-height: auto;
  }

  /* Booking form - stack fields on mobile */
  .responsive-grid-2 {
    grid-template-columns: 1fr !important;
  }
}

/* ================================================
   MOBILE INPUT AUTO-ZOOM FIX
   ================================================ */
/* Prevent iOS/Android from auto-zooming in on input focus.
   1. Viewport meta tag must include maximum-scale=1.0 (in every HTML <head>)
   2. Font-size >= 16px prevents the browser auto-zoom trigger
   3. text-size-adjust: 100% stops iOS Safari from adjusting font-size on orientation change */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="search"],
input[type="url"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="month"],
input[type="week"],
textarea,
select,
.form-input {
  font-size: 14px !important;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
@media (max-width: 640px) {
  /* Filter container - stack filters vertically */
  .card .card-body > div[style*="flex-wrap"] {
    flex-direction: column !important;
    gap: 12px !important;
  }
  
  /* Each filter field takes full width on mobile */
  [data-mobile-full] {
    width: 100% !important;
    flex: 1 1 100% !important;
    min-width: 100% !important;
  }
  
  /* Search bar - full width */
  .search-bar {
    width: 100% !important;
  }
  .search-bar .form-input {
    width: 100%;
  }
  
  /* Date range inputs - side by side on same row */
  .filter-date-range {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    align-items: center;
    width: 100%;
  }
  .filter-date-range input[type="date"] {
    flex: 1;
    min-width: 0;
  }
  
  /* Select dropdowns - full width */
  [data-mobile-full] select.form-input {
    width: 100% !important;
    min-width: 100% !important;
  }
  
  /* KPI cards - stack 2 per row on mobile */
  #order-stats {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
}

@media (max-width: 400px) {
  /* KPI cards - 1 per row on very small screens */
  #order-stats {
    grid-template-columns: 1fr !important;
  }
}
