@import url("https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700;900&family=JetBrains+Mono:wght@400;700&display=swap");

:root {
  --bg: #0d0f14;
  --surface: #161920;
  --surface2: #1e2230;
  --surface3: #252a3d;
  --border: #2a2f3d;
  --border-light: #3d4458;
  --accent: #00d4aa;
  --accent2: #ff6b35;
  --accent3: #7c5cfc;
  --text: #e8eaf0;
  --text-secondary: #94a3b8;
  --muted: #6b7280;
  --success: #22c55e;
  --warn: #f59e0b;
  --danger: #ef4444;
  --shadow: rgba(0, 0, 0, 0.4);
  --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3),
    0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --hover-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.4),
    0 10px 10px -5px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface2: #f1f5f9;
  --surface3: #e2e8f0;
  --border: #cbd5e1;
  --border-light: #e2e8f0;
  --text: #0f172a;
  --text-secondary: #475569;
  --muted: #64748b;
  --shadow: rgba(0, 0, 0, 0.1);
  --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --hover-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15),
    0 10px 10px -5px rgba(0, 0, 0, 0.05);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  transition: background-color 0.3s ease, color 0.2s ease,
    border-color 0.3s ease, box-shadow 0.3s ease;
}

body {
  font-family: "Cairo", sans-serif;
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

.app-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ========== HEADER ========== */
.main-header {
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 15, 20, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1rem 2rem;
}

[data-theme="light"] .main-header {
  background: rgba(248, 250, 252, 0.9);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.header-content {
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-direction: row-reverse;
}

/* Remove underline from back button */
.btn-outline {
  text-decoration: none !important;
}

/* Modern Select Styling */
.modern-select-wrapper {
  position: relative;
  min-width: 200px;
}

.modern-select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  padding: 0.875rem 3rem 0.875rem 1.25rem;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: var(--text);
  font-family: "Cairo", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.modern-select:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent);
}

.modern-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.1);
}

.modern-select-wrapper::after {
  content: "▼";
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  font-size: 0.8rem;
  pointer-events: none;
}

/* Light mode */
[data-theme="light"] .modern-select {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.1);
  color: var(--text);
}

[data-theme="light"] .modern-select:hover {
  background: rgba(0, 0, 0, 0.05);
}

/* Auth loading */
#authLoading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  gap: 1rem;
}

#authLoading .spinner {
  width: 50px;
  height: 50px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.access-denied {
  text-align: center;
  padding: 3rem;
}

.access-denied h2 {
  color: var(--danger);
  margin-bottom: 1rem;
}

/* Header Left - الزرارين */
.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  perspective: 1000px;
  /* مهم للـ 3D */
}

/* Reset links */
a {
  text-decoration: none;
  font: inherit;
  color: inherit;
}

/* Form improvements */
.form-group {
  margin-bottom: 1.2rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.glass-input {
  width: 100%;
  padding: 0.9rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: white;
  transition: all 0.2s ease;
}

.glass-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

textarea.glass-input {
  resize: none;
}

/* Button enhancement */
.btn-accent {
  transition: all 0.25s ease;
}

.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(34, 197, 94, 0.25);
}

/* Card hover */
.form-section {
  transition: 0.3s;
}

.form-section:hover {
  transform: translateY(-4px);
}

/* Fade animation */
.fade-in {
  animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========== GLASS TOGGLE BUTTON (للزرارين) ========== */
#themeToggle .light-icon,
#themeToggle .dark-icon {
  display: none !important;
}

[data-theme="dark"] #themeToggle .dark-icon,
[data-theme="light"] #themeToggle .light-icon {
  display: inline-flex !important;
}

/* Put these OUTSIDE the media query (global) */
#availabilityToggle .toggle-icon-inactive {
  display: inline-flex;
}

#availabilityToggle .toggle-icon-active {
  display: none;
}

#availabilityToggle.active .toggle-icon-inactive,
#availabilityToggle[data-active="true"] .toggle-icon-inactive {
  display: none !important;
}

#availabilityToggle.active .toggle-icon-active,
#availabilityToggle[data-active="true"] .toggle-icon-active {
  display: inline-flex !important;
}

.btn-glass-toggle {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text);
  padding: 0.5rem 1rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-width: 140px;
  height: 40px;
  transform-style: preserve-3d;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-glass-toggle:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--accent);
  transform: translateZ(30px);
  /* max 30px */
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 10px 20px rgba(0, 212, 170, 0.2);
}

/* Theme Toggle - اظهار/اخفاء الايقونات */
#themeToggle .light-icon,
#themeToggle .dark-icon {
  display: none;
}

[data-theme="dark"] #themeToggle .light-icon {
  display: inline;
}

[data-theme="light"] #themeToggle .dark-icon {
  display: inline;
}

/* Base: إظهار الـ text على الديسكتوب */
#availabilityToggle .toggle-text {
  display: inline;
  margin-left: 6px;
}

/* Active: إخفاء الـ text لما الزرار يكون شغال (👍) */
#availabilityToggle.active .toggle-text,
#availabilityToggle[data-active="true"] .toggle-text {
  display: none !important;
}

/* Active state - شكل الزرار لما يكون شغال (👍) */
#availabilityToggle.active,
#availabilityToggle[data-active="true"] {
  min-width: 40px !important;
  width: 40px !important;
  padding: 0 !important;
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  transform: translateZ(30px);
  box-shadow: 0 20px 40px rgba(0, 212, 170, 0.4),
    0 10px 20px rgba(0, 212, 170, 0.3);
}

#availabilityToggle.active:hover {
  box-shadow: 0 25px 50px rgba(0, 212, 170, 0.5),
    0 15px 30px rgba(0, 212, 170, 0.4);
}

/* الـ Theme Toggle يبقى مربع صغير */
#themeToggle {
  min-width: 40px;
  width: 40px;
  padding: 0;
}

/* ========== LIGHT MODE ========== */
[data-theme="light"] .btn-glass-toggle {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.1);
  color: var(--text);
}

[data-theme="light"] .btn-glass-toggle:hover {
  background: rgba(0, 0, 0, 0.08);
  border-color: var(--accent);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2),
    0 10px 20px rgba(0, 212, 170, 0.15);
}

[data-theme="light"] #availabilityToggle.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  box-shadow: 0 20px 40px rgba(0, 212, 170, 0.3),
    0 10px 20px rgba(0, 212, 170, 0.2);
}

/* Admin Quick Links */
.admin-quick-links {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.btn-purple {
  background: linear-gradient(135deg, #7c5cfc 0%, #a855f7 100%);
  color: white;
  border: none;
  box-shadow: 0 4px 15px rgba(124, 92, 252, 0.3);
}

.btn-purple:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(124, 92, 252, 0.4);
  filter: brightness(1.1);
}

.btn-requests {
  background: rgba(255, 107, 53, 0.1);
  color: #ff6b35;
  border: 1px solid rgba(255, 107, 53, 0.3);
}

.btn-requests:hover {
  background: rgba(255, 107, 53, 0.2);
  border-color: #ff6b35;
  transform: translateY(-2px);
}

[data-theme="light"] .requests-badge {
  box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
}

/* ========== BRAND & LOGIN ========== */
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-img {
  height: 70px;
  width: auto;
  flex-shrink: 0;
}

.brand h1 {
  font-size: 1.3rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
}

.btn-login {
  background: linear-gradient(135deg, var(--accent3), #5c5fff);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(124, 92, 252, 0.3);
  transition: all 0.3s ease;
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(124, 92, 252, 0.4);
}

body.is-admin .btn-login {
  display: none !important;
}

/* ========== ADMIN PANEL ========== */
.admin-panel {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface2) 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  margin: 1.5rem 0;
  box-shadow: var(--card-shadow);
}

.panel-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  position: relative;
}

/* User Section في الهيدر */
.user-section {
  position: absolute;
  top: 0;
  left: 0;
}

.panel-header h2 {
  color: var(--accent);
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}

.admin-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

/* ========== BUTTONS ========== */
.btn {
  padding: 0.625rem 1.25rem;
  border-radius: 8px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 212, 170, 0.4);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 2px solid var(--border);
}

.btn-secondary:hover {
  background: var(--surface2);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 212, 170, 0.2);
}

.btn-accent {
  background: linear-gradient(135deg, #00d4aa 0%, #00b894 100%);
  color: white;
  border: none;
}

.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 212, 170, 0.4);
  filter: brightness(1.1);
}

.btn-outline {
  background: linear-gradient(135deg, #7c5cfc 0%, #5c5fff 100%);
  color: white;
  border: none;
}

.btn-outline:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(124, 92, 252, 0.4);
  filter: brightness(1.1);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  border-color: var(--danger);
}

.btn-danger:hover {
  background: var(--danger);
  color: white;
}

/* User Dropdown */
.user-dropdown {
  position: relative;
}

.admin-badge {
  background: linear-gradient(135deg, var(--accent), var(--accent3));
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 25px;
  font-size: 0.9rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 2px 8px rgba(0, 212, 170, 0.3);
  transition: all 0.3s ease;
}

.admin-badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 212, 170, 0.4);
}

/* Dropdown Menu */
.dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  /* ← عشان يظهر على اليسار */
  right: auto;
  /* ← مش على اليمين */
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem;
  min-width: 240px;
  box-shadow: var(--hover-shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 1000;
}

.user-dropdown.active .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Dropdown Links */
.dropdown-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s ease;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
}

.dropdown-item:hover {
  background: var(--surface2);
  border-color: var(--accent);
  transform: translateX(-5px);
  color: var(--accent);
}

.dropdown-item .icon {
  font-size: 1.3rem;
  width: 28px;
  text-align: center;
}

/* Fire Badge */
.badge-fire {
  margin-right: auto;
  margin-left: 0;
  background: linear-gradient(135deg, #ff6b35, #ff4757);
  color: white;
  padding: 0.2rem 0.6rem;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 700;
  animation: pulse-fire 2s infinite;
  box-shadow: 0 2px 8px rgba(255, 107, 53, 0.4);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
  /* ← Prevent line break */
  flex-wrap: nowrap;
  /* ← Prevent flex wrap */
  flex-shrink: 0;
  /* ← Don't shrink */
  line-height: 1;
  /* ← Prevent extra height */
  vertical-align: middle;
  /* ← Align with text */
}

.status-badge {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: bold;
  white-space: nowrap;
}

.status-pending {
  background: #ffd700;
  color: #333;
}

.status-approved {
  background: #28a745;
  color: white;
}

.status-rejected {
  background: #dc3545;
  color: white;
}

.btn-warning {
  background: #ffc107;
  color: #333;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
}

@keyframes pulse-fire {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
  }
}

/* Divider */
.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 0.5rem 0;
}

/* Logout Button in Dropdown */
.dropdown-menu .btn-logout {
  width: 100%;
  margin-top: 0;
  justify-content: center;
  padding: 0.75rem;
  font-size: 0.9rem;
}

/* Admin Controls المسافة من فوق */
.admin-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  margin-top: 1rem;
  /* ← مسافة من الـ panel-header */
  padding-top: 1rem;
}

#accessDenied {
  /* Centering */
  display: flex;
  /* Note: This overrides the 'hidden' class display:none when shown */
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  /* Full viewport height */
  text-align: center;

  /* Styling */
  background: #f8f9fa;
  padding: 2rem;
  gap: 1rem;
  /* Space between elements */
}

/* Handle the hidden class properly */
#accessDenied.hidden {
  display: none !important;
}

/* When not hidden, ensure it's flex */
#accessDenied:not(.hidden) {
  display: flex;
}

/* Style the elements */
#accessDenied h2 {
  color: #dc3545;
  font-size: 2.5rem;
  margin: 0;
}

#accessDenied p {
  color: #6c757d;
  font-size: 1.2rem;
  max-width: 500px;
  margin: 0;
}

#accessDenied .btn {
  margin-top: 1rem;
  font-weight: bold;
  text-decoration: none;
  padding: 0.75rem 2rem;
}

.btn-logout:hover {
  background: var(--danger);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Filters */
.filters-section {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1.5rem 0;
  align-items: center;
  justify-content: space-between;
  background: rgba(22, 25, 32, 0.6);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 1.25rem;
}

[data-theme="light"] .filters-section {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.search-container {
  flex: 1;
  max-width: 600px;
  min-width: 250px;
}

.search-input {
  width: 100%;
  padding: 0.875rem 1.25rem;
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  transition: all 0.3s;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.1);
  background: rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .search-input {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.filter-group {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.select-input {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  min-width: 150px;
}

.view-toggle {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  height: 40px;
  min-width: 80px;
  /* ← Ensure enough width for both buttons */
  flex-shrink: 0;
  /* ← Prevent shrinking */
  position: relative;
  z-index: 1;
}

.view-btn {
  padding: 0 0.75rem;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex: 1;
  /* ← Equal width for both buttons */
  min-width: 40px;
  /* ← Minimum clickable area */
  position: relative;
  z-index: 2;
  /* ← Ensure clickable above other elements */
}

.view-btn.active {
  background: var(--surface2);
  color: var(--accent);
  font-weight: 600;
}

/* Ensure icons are visible */
.view-btn svg {
  display: block;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.view-btn:hover:not(.active) {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

/* Stats */
.stats-bar {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(22, 25, 32, 0.5);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  margin: 0 2rem 1rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

[data-theme="light"] .stats-bar {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Products Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* Product Card */
.product-card {
  background: rgba(22, 25, 32, 0.6);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  position: relative;
  display: flex;
  flex-direction: column;
}

[data-theme="light"] .product-card {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  border-color: rgba(0, 212, 170, 0.3);
}

[data-theme="light"] .product-card:hover {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  border-color: rgba(0, 212, 170, 0.5);
}

.card-actions {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  gap: 0.5rem;
  z-index: 10;
}

body:not(.is-admin) .card-actions {
  display: none;
}

.card-action-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: rgba(13, 15, 20, 0.9);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s;
}

[data-theme="light"] .card-action-btn {
  background: rgba(255, 255, 255, 0.95);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.card-action-btn.edit {
  color: var(--accent);
}

.card-action-btn.delete {
  color: var(--danger);
}

.card-action-btn:hover {
  transform: scale(1.1);
}

.card-image-container {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, var(--surface2), var(--surface3));
  position: relative;
  overflow: hidden;
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.product-card:hover .card-image {
  transform: scale(1.05);
}

.image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  background: linear-gradient(135deg, var(--surface2), var(--surface3));
  color: var(--muted);
}

.category-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(13, 15, 20, 0.8);
  backdrop-filter: blur(8px);
  color: var(--accent);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid var(--border);
}

[data-theme="light"] .category-badge {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.card-content {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
  margin: 0;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.price-tag {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.price-main {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--accent);
}

.price-secondary {
  font-size: 0.875rem;
  color: var(--muted);
  text-decoration: line-through;
}

.qty-badge {
  background: var(--surface2);
  color: var(--text-secondary);
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  border: 1px solid var(--border);
}

.qty-low {
  color: var(--danger);
  border-color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

.qty-high {
  color: var(--success);
  border-color: var(--success);
  background: rgba(34, 197, 94, 0.1);
}

/* ========== LIST VIEW FIXES ========== */
.products-grid.list-view {
  grid-template-columns: 1fr;
  gap: 12px;
}

.list-view .product-card {
  flex-direction: row;
  height: auto;
  min-height: 120px;
  border-radius: 12px;
  padding: 12px;
  gap: 12px;
  align-items: stretch;
  /* Stretch to full height */
  position: relative;
  /* For admin actions positioning */
}

/* Image container - fixed size */
.list-view .card-image-container {
  width: 100px;
  height: 100px;
  border-radius: 10px;
  flex-shrink: 0;
  align-self: center;
  /* Center vertically */
}

.list-view .card-image,
.list-view .image-placeholder {
  height: 100%;
  border-radius: 10px;
}

/* Content area - flex column with space between */
.list-view .card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0;
  gap: 8px;
  min-width: 0;
  /* Prevent overflow */
  justify-content: space-between;
  /* Push meta to bottom */
}

/* Title at top */
.list-view .card-title {
  font-size: 15px;
  line-height: 1.3;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  order: 1;
}

/* Category badge - middle */
.list-view .category-badge {
  position: static;
  display: inline-block;
  width: fit-content;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 12px;
  order: 2;
  margin-top: 4px;
}

/* Admin actions - absolute top-left of CARD (not content) */
.list-view .card-actions {
  position: absolute;
  top: 8px;
  left: 8px;
  /* RTL: left is visually top-left */
  right: auto;
  display: flex;
  gap: 6px;
  z-index: 10;
  order: unset;
  /* Remove order since it's absolute */
  margin: 0;
}

.list-view .card-action-btn {
  width: 32px;
  height: 32px;
  font-size: 14px;
  border-radius: 6px;
  background: rgba(13, 15, 20, 0.9);
  /* Dark background for visibility */
  backdrop-filter: blur(4px);
}

/* Price & Qty - Bottom row, side by side */
.list-view .card-meta {
  display: flex;
  flex-direction: row !important;
  /* Force side-by-side */
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  /* Push to bottom */
  padding-top: 8px;
  border-top: 1px solid var(--border);
  order: 3;
  gap: 12px;
  width: 100%;
}

/* Price styling */
.list-view .price-tag {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 4px;
}

.list-view .price-main {
  font-size: 16px;
  font-weight: 800;
  color: var(--accent);
}

/* Qty styling - ensure visible */
.list-view .qty-badge {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
  /* Don't shrink */
  background: var(--surface2);
  border: 1px solid var(--border);
}

/* Hide placeholder text on small screens */
.list-view .image-placeholder {
  font-size: 2rem;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.modal-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  z-index: 1001;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

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

.modal-header h3 {
  font-size: 1.25rem;
  color: var(--text);
}

.close-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.5rem;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.close-btn:hover {
  background: var(--surface2);
  color: var(--danger);
}

.modal-form {
  padding: 1.5rem;
}

.qty-edit-history {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(34, 197, 94, 0.05));
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 8px;
  display: none;
}

.qty-edit-history:not(.hidden) {
  display: block;
  animation: slideDown 0.3s ease;
}

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

.qty-edit-history.hidden {
  display: none;
}

.edit-history-info {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  color: var(--success);
  font-size: 0.875rem;
}

.edit-history-info svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--success);
}

.edit-text {
  line-height: 1.5;
  word-break: break-word;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-row {
  display: contents;
}

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

.form-group input,
.form-group select {
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.1);
}

.form-group small {
  color: var(--muted);
  font-size: 0.75rem;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.spacer {
  flex: 1;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 2;

  color: var(--muted);
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state h3 {
  color: var(--text);
  margin-bottom: 0.5rem;
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.5rem;
  box-shadow: var(--hover-shadow);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 300px;
  animation: slideIn 0.3s ease;
}

.toast.success {
  border-color: var(--success);
  background: rgba(34, 197, 94, 0.1);
  color: var(--success);
}

.toast.error {
  border-color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

.toast.warning {
  border-color: var(--warn);
  background: rgba(245, 158, 11, 0.1);
  color: var(--warn);
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem;
  margin: 1rem 0;
  flex-wrap: wrap;
}

.pagination .btn {
  min-width: 100px;
  height: 40px;
  font-size: 0.9rem;
}

.page-info {
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 1rem;
  min-width: 120px;
  text-align: center;
}

.pagination .btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

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

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Utilities */
.hidden {
  display: none !important;
}

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

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

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

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

/* Footer */

.main-footer {
  margin-top: 3rem;

  background: var(--surface);

  border-top: 1px solid var(--border);

  padding: 2rem 0 0;
}

.footer-content {
  max-width: 1400px;

  margin: 0 auto;

  padding: 0 2rem;

  display: grid;

  grid-template-columns: 1fr 1fr 1fr;

  gap: 2rem;
}

.footer-section h3 {
  color: var(--accent);

  font-size: 1.1rem;

  margin-bottom: 1rem;

  display: flex;

  align-items: center;

  gap: 0.5rem;
}

/* Map Section */

.map-link {
  display: block;

  text-decoration: none;

  color: var(--text);

  transition: all 0.3s ease;
}

.map-preview {
  position: relative;

  border-radius: 12px;

  overflow: hidden;

  margin-bottom: 0.75rem;

  border: 1px solid var(--border);
}

.map-overlay {
  position: absolute;

  top: 0;

  left: 0;

  right: 0;

  bottom: 0;

  background: rgba(0, 0, 0, 0.6);

  display: flex;

  align-items: center;

  justify-content: center;

  opacity: 0;

  transition: opacity 0.3s ease;
}

.map-overlay span {
  background: var(--accent);

  color: var(--bg);

  padding: 0.5rem 1rem;

  border-radius: 20px;

  font-size: 0.85rem;

  font-weight: 600;
}

.map-link:hover .map-overlay {
  opacity: 1;
}

.address {
  font-size: 0.9rem;

  color: var(--text-secondary);

  line-height: 1.6;
}

/* Links Section */

.footer-links ul {
  list-style: none;

  display: flex;

  flex-direction: column;

  gap: 0.75rem;
}

.footer-link {
  display: flex;

  align-items: center;

  gap: 0.5rem;

  padding: 0.75rem 1rem;

  background: var(--surface2);

  border: 1px solid var(--border);

  border-radius: 10px;

  color: var(--text);

  text-decoration: none;

  transition: all 0.3s ease;

  position: relative;
}

.footer-link:hover {
  background: var(--surface3);

  border-color: var(--accent);

  transform: translateY(-2px);

  box-shadow: 0 4px 12px rgba(0, 212, 170, 0.2);
}

.footer-link .icon {
  font-size: 1.2rem;
}

/* Hiring Badge */

.hiring-badge {
  margin-right: auto;

  display: flex;

  align-items: center;

  gap: 0.4rem;

  background: rgba(34, 197, 94, 0.15);

  color: var(--success);

  padding: 0.25rem 0.75rem;

  border-radius: 20px;

  font-size: 0.75rem;

  font-weight: 700;

  border: 1px solid var(--success);
}

.pulse-dot {
  width: 8px;

  height: 8px;

  background: var(--success);

  border-radius: 50%;

  animation: pulse 2s infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.5;
    transform: scale(1.2);
  }
}

/* Contact Section */

.phone-list {
  display: flex;

  flex-direction: column;

  gap: 0.75rem;
}

.phone-item {
  display: flex;

  align-items: center;

  gap: 0.75rem;

  padding: 0.75rem 1rem;

  background: var(--surface2);

  border: 1px solid var(--border);

  border-radius: 10px;

  transition: all 0.3s ease;
}

.phone-item:hover {
  background: var(--surface3);

  border-color: var(--accent);

  transform: translateX(-5px);
}

.phone-icon {
  font-size: 1.2rem;
}

.phone-link {
  color: var(--text);

  text-decoration: none;

  font-weight: 600;

  font-family: "JetBrains Mono", monospace;

  font-size: 0.95rem;

  direction: ltr;

  display: inline-block;
}

.phone-link:hover {
  color: var(--accent);
}

/* Footer Bottom */

.footer-bottom {
  margin-top: 2rem;

  padding: 1.5rem;

  text-align: center;

  border-top: 1px solid var(--border);

  color: var(--muted);

  font-size: 0.85rem;
}

/* ========== MOBILE RESPONSIVE (max-width: 768px) ========== */
@media (max-width: 768px) {
  /* =========================
     1. HEADER - Logo & Title
  ========================= */
  .main-header {
    padding: 12px 16px;
  }

  .header-content {
    flex-direction: row;
    flex-wrap: nowrap;
    /* CHANGED: Prevent buttons from wrapping below logo */
    gap: 8px;
    /* Reduced gap to save space */
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    /* Add some vertical padding */
  }

  /* Logo on RIGHT - allow shrinking */
  .brand {
    order: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    /* CHANGED: Take available space but can shrink */
    min-width: 0;
    /* IMPORTANT: Allows text truncation to work */
    overflow: hidden;
    /* Prevent overflow */
  }

  .logo-img {
    height: 48px;
    /* Slightly reduced for mobile */
    width: auto;
    flex-shrink: 0;
  }

  .brand h1 {
    font-size: 15px;
    /* Slightly smaller to fit */
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
    flex: 1;
    /* Take remaining space in brand */
    min-width: 0;
    /* Allow shrinking */
  }

  /* Buttons on LEFT - fixed size, never shrink */
  .header-left {
    order: 2;
    display: flex;
    align-items: center;
    gap: 6px;
    /* Tighter gap */
    flex-shrink: 0;
    /* Never shrink */
    margin-right: 0;
    /* Ensure no extra margin pushing it down */
  }

  /* All header buttons - compact square icons */
  #availabilityToggle,
  #themeToggle,
  .btn-login {
    min-width: 40px;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 10px;
    display: inline-flex;
    /* CHANGED: inline-flex for better alignment */
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  /* Mobile - Always hide text */
  #availabilityToggle .toggle-text {
    display: none !important;
  }

  /* Mobile - Always small button */
  #availabilityToggle {
    min-width: 40px !important;
    width: 40px !important;
    padding: 0 !important;
  }

  /* Mobile icons - handled by same active rules above */
  #availabilityToggle:not(.active):not([data-active="true"]) .toggle-icon-inactive {
    display: inline-flex !important;
  }

  #availabilityToggle:not(.active):not([data-active="true"]) .toggle-icon-active {
    display: none !important;
  }

  /* Theme toggle icons */
  #themeToggle .light-icon,
  #themeToggle .dark-icon {
    font-size: 20px;
    line-height: 1;
  }

  /* Hide theme icon based on current theme */
  [data-theme="dark"] #themeToggle .light-icon,
  #themeToggle .dark-icon[hidden],
  #themeToggle .light-icon[hidden] {
    display: none !important;
  }

  [data-theme="dark"] #themeToggle .dark-icon {
    display: inline-flex !important;
  }

  /* Login button - compact but visible */
  .btn-login {
    width: auto;
    min-width: 40px;
    max-width: 100px;
    /* Prevent it from taking too much space */
    padding: 0 10px;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* =========================
     3. FILTERS SECTION - Fix Overflow
  ========================= */
  .filters-section {
    margin: 12px;
    padding: 12px;
    border-radius: 12px;
    flex-direction: column;
    gap: 12px;
    width: auto;
    max-width: 100%;
    box-sizing: border-box;
  }

  .search-container {
    width: 100%;
    max-width: 100%;
    min-width: auto;
    order: -1;
    /* Search on top */
  }

  .search-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    /* Prevent iOS zoom */
    border-radius: 10px;
  }

  .filter-group {
    display: flex;
    flex-direction: row;
    width: 100%;
    gap: 8px;
    flex-wrap: nowrap;
    /* Prevent wrapping to keep on one line */
  }

  /* Category and Sort dropdowns - flexible width */
  .filter-group .select-input {
    flex: 1;
    min-width: 0;
    /* Allow shrinking below 150px */
    padding: 10px 12px;
    font-size: 14px;
    border-radius: 8px;
  }

  /* View toggle buttons - fixed width */
  .view-toggle {
    display: flex;
    height: 40px;
    min-width: 80px;
    width: 80px;
    /* Fixed width */
    flex-shrink: 0;
    border-radius: 8px;
  }

  .view-btn {
    flex: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
  }

  .view-btn svg {
    width: 18px;
    height: 18px;
  }

  /* =========================
     4. STATS BAR
  ========================= */
  .stats-bar {
    margin: 12px;
    padding: 10px 16px;
    font-size: 13px;
    flex-direction: row;
    justify-content: space-between;
    border-radius: 10px;
  }

  /* =========================
     5. PRODUCTS GRID - Wider Container
  ========================= */
  .products-grid {
    padding: 12px;
    gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }

  /* =========================
     6. LIST VIEW - Reordered Layout
  ========================= */
  .products-grid.list-view {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px;
  }

  .list-view .product-card {
    flex-direction: row;
    height: auto;
    min-height: 100px;
    border-radius: 12px;
    padding: 12px;
    gap: 12px;
    align-items: flex-start;
  }

  .list-view .card-image-container {
    width: 90px;
    height: 90px;
    border-radius: 10px;
    flex-shrink: 0;
  }

  .list-view .card-image,
  .list-view .image-placeholder {
    height: 100%;
    border-radius: 10px;
  }

  /* Content area - vertical stack */
  .list-view .card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0;
    gap: 8px;
    min-width: 0;
    /* Prevent overflow */
  }

  /* Title */
  .list-view .card-title {
    font-size: 15px;
    line-height: 1.3;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
  }

  /* Category badge - reposition */
  .list-view .category-badge {
    position: static;
    display: inline-block;
    width: fit-content;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 12px;
    order: 2;
  }

  /* Admin actions - ON TOP (as requested) */
  .list-view .card-actions {
    position: static;
    display: flex;
    gap: 6px;
    order: 1;
    /* First element */
    margin-bottom: 4px;
  }

  .list-view .card-action-btn {
    width: 32px;
    height: 32px;
    font-size: 14px;
    border-radius: 6px;
  }

  /* Price and Quantity - NEXT TO EACH OTHER, under buttons */
  .list-view .card-meta {
    display: flex;
    flex-direction: row;
    /* Side by side */
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    order: 3;
    /* After title and category */
    gap: 12px;
  }

  .list-view .price-tag {
    flex-direction: row;
    align-items: baseline;
    gap: 4px;
  }

  .list-view .price-main {
    font-size: 16px;
    font-weight: 800;
  }

  .list-view .price-secondary {
    font-size: 12px;
  }

  .list-view .qty-badge {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 6px;
    white-space: nowrap;
  }

  /* Hide image placeholder text on small screens in list view */
  .list-view .image-placeholder {
    font-size: 2rem;
  }

  /* =========================
     7. ADMIN PANEL
  ========================= */
  .admin-panel {
    margin: 12px;
    padding: 16px;
    border-radius: 12px;
  }

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

  .admin-controls {
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
  }

  .admin-controls .btn {
    width: 100%;
    justify-content: center;
    padding: 12px;
  }

  .admin-controls .hint {
    font-size: 12px;
    text-align: center;
  }

  /* =========================
     8. MODAL
  ========================= */
  .modal-content {
    max-height: 95vh;
    border-radius: 16px 16px 0 0;
    margin: 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 100%;
    width: 100%;
  }

  .modal-header {
    padding: 16px;
  }

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

  .modal-form {
    padding: 16px;
  }

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

  .form-group input,
  .form-group select {
    padding: 12px;
    font-size: 16px;
    /* Prevent iOS zoom */
    border-radius: 8px;
  }

  .modal-actions {
    flex-direction: column-reverse;
    gap: 10px;
    padding-top: 16px;
  }

  .modal-actions .btn {
    width: 100%;
    justify-content: center;
    padding: 12px;
  }

  .spacer {
    display: none;
  }

  /* =========================
     9. PAGINATION
  ========================= */
  .pagination {
    padding: 16px;
    gap: 12px;
  }

  .pagination .btn {
    min-width: 80px;
    padding: 10px 16px;
    font-size: 14px;
  }

  .page-info {
    font-size: 14px;
    min-width: auto;
  }

  /* =========================
     10. TOAST
  ========================= */
  .toast-container {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }

  .toast {
    min-width: auto;
    padding: 12px 16px;
    font-size: 14px;
  }

  /* =========================
     11. FOOTER
  ========================= */
  .footer-content {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 0 16px;
  }

  .main-footer {
    margin-top: 24px;
  }

  .footer-section h3 {
    font-size: 16px;
  }

  .map-preview iframe {
    height: 180px;
  }

  .phone-item,
  .footer-link {
    padding: 10px 12px;
  }

  /* =========================
     12. USER DROPDOWN
  ========================= */
  .user-section {
    position: static;
    margin-bottom: 12px;
  }

  .dropdown-menu {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    border-radius: 16px 16px 0 0;
    max-height: 80vh;
    overflow-y: auto;
  }

  .dropdown-item {
    padding: 14px 16px;
  }

  /* Badge fire - ensure visible */
  .badge-fire {
    font-size: 12px;
    padding: 3px 8px;
  }
}

/* ========== TOUCH DEVICE OPTIMIZATIONS ========== */
@media (hover: none) and (pointer: coarse) {

  .btn,
  .view-btn,
  .card-action-btn,
  .dropdown-item {
    min-height: 44px;
    /* Minimum touch target */
  }

  .select-input,
  .search-input {
    min-height: 44px;
  }
}