:root {
  /* Modern Premium Palette */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --accent: #7c3aed;
  --bg-app: #f8fafc;
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 24px;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-soft: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-hover: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --glass: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.3);
}

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

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

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Typography */
h1,
h2,
h3 {
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* Hide scrollbar for category navbar */
#categoryNavbar ::-webkit-scrollbar {
  display: none;
}

#categoryNavbar>div {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

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

.sidebar {
  width: 280px;
  background: var(--bg-card);
  border-right: 1px solid var(--border-color);
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
}

.sidebar-header {
  margin-bottom: 40px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-main);
  text-decoration: none;
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.nav-item:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.nav-item.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.main-content {
  flex: 1;
  padding: 40px;
  overflow-y: auto;
  transition: padding 0.3s ease;
}

.main-content header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  gap: 24px;
}

.action-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

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

.table th {
  padding: 16px 24px;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: #fafafa;
  border-bottom: 1px solid var(--border-color);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.table td {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-card);
  transition: var(--transition);
}

.table tr:hover td {
  background: #fcfdfe;
}

@media (max-width: 1024px) {
  .sidebar {
    display: none;
  }

  .main-content {
    padding: 24px 16px 100px;
    /* Space for bottom nav */
  }

  .main-content header {
    display: flex;
    flex-direction: column;
    align-items: flex-start !important;
    gap: 12px;
    margin-bottom: 24px !important;
  }

  .main-content header h1 {
    font-size: 24px;
  }

  .action-group {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 10px;
  }

  .action-group .btn {
    width: 100%;
    order: -1;
    /* Move primary action to top on mobile */
  }

  .action-group select,
  .action-group input {
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
  }

  .app-layout {
    flex-direction: column;
  }
}

.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  z-index: 1000;
  justify-content: space-around;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

@media (max-width: 1024px) {
  .mobile-nav {
    display: flex;
  }
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
  transition: var(--transition);
  flex: 1;
}

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

.mobile-nav-icon {
  font-size: 20px;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 500;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
  opacity: 1;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover {
  background-color: #f5f5f7;
}

/* Forms */
.form-group {
  margin-bottom: 20px;
}

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

.form-input {
  width: 100%;
  padding: 12px 16px;
  font-size: 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  transition: var(--transition);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.05);
}

/* Login Page Styles */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.auth-card {
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  padding: 48px;
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
  width: 100%;
  max-width: 440px;
  text-align: center;
}

.auth-logo img {
  height: 80px;
  width: auto;
  margin-bottom: 32px;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.08));
  border-radius: var(--radius-md);
}

.sidebar-header .auth-logo img {
  border-radius: var(--radius-md);
  object-fit: contain;
  background: white;
}

.mesh-gradient {
  background-color: var(--bg-app);
  background-image:
    radial-gradient(at 0% 0%, rgba(37, 99, 235, 0.1) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(124, 58, 237, 0.1) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(37, 99, 235, 0.05) 0px, transparent 50%),
    radial-gradient(at 0% 100%, rgba(124, 58, 237, 0.05) 0px, transparent 50%);
}

.auth-title {
  font-size: 24px;
  margin-bottom: 8px;
}

.auth-desc {
  color: var(--text-muted);
  margin-bottom: 32px;
}

/* Public Menu Styles */
.menu-header {
  padding: 48px 0 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.menu-logo {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--shadow-hover);
  border: 4px solid #fff;
  transition: var(--transition);
}

.menu-logo:hover {
  transform: scale(1.05);
}

.menu-header h1 {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-main);
}

.social-links {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 8px;
}

.social-link {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  box-shadow: var(--shadow-soft);
  transition: var(--transition);
  text-decoration: none;
}

.social-link:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.social-link.instagram:hover {
  color: #e4405f;
}

.social-link.google-maps:hover {
  color: #4285f4;
}

.social-link.phone:hover {
  color: #34c759;
}

.category-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  padding: 16px 0;
}

@media (min-width: 768px) {
  .category-list {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }
}

@media (min-width: 1024px) {
  .category-list {
    grid-template-columns: repeat(4, 1fr);
  }
}

.category-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  animation: fadeIn 0.4s ease-out backwards;
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  padding: 16px 0;
}

@media (min-width: 768px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }
}

@media (min-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.product-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  position: relative;
  animation: fadeIn 0.4s ease-out backwards;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.product-image-wrapper {
  position: relative;
  aspect-ratio: 1;
  width: 100%;
}

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

.price-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: var(--primary);
  color: white;
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 14px;
}

.product-card-info {
  padding: 12px;
  text-align: center;
}

.product-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  margin-bottom: 4px;
  line-height: 1.2;
}

.product-card-desc {
  font-size: 11px;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
}

.product-item {
  display: flex;
  gap: 16px;
  background: var(--bg-card);
  padding: 12px;
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  box-shadow: var(--shadow-soft);
}

.product-img {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

/* Modals & Toasts */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-content {
  background: var(--bg-card);
  padding: 32px;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 500px;
  position: relative;
  animation: fadeIn 0.3s ease-out;
}

@media (max-width: 768px) {
  .modal {
    padding: 0;
    align-items: flex-end;
  }

  .modal-content {
    max-width: 100%;
    margin: 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-height: 92vh;
    overflow-y: auto;
    padding: 24px 20px 40px;
    animation: slideUp 0.3s ease-out;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }

  to {
    transform: translateY(0);
  }
}

/* Switch Toggle */
.switch-container {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #e9e9ea;
  transition: var(--transition);
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: var(--transition);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

input:checked+.slider {
  background-color: #34c759;
}

input:checked+.slider:before {
  transform: translateX(20px);
}

.switch-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
}

@media (max-width: 768px) {
  .mobile-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
  }

  .mobile-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
  }

  .mobile-card-row:last-child {
    border-bottom: none;
  }

  .mobile-card-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
  }

  .mobile-card-value {
    font-size: 14px;
    font-weight: 500;
  }

  .mobile-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
  }

  .desktop-only {
    display: none !important;
  }

  .mobile-only {
    display: block !important;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .main-content header {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 16px;
  }

  .btn {
    width: 100%;
  }
}

.mobile-only {
  display: none;
}

.alert-banner {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  animation: fadeIn 0.3s ease-out;
}

.alert-banner-text {
  color: #9a3412;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}

@media (max-width: 768px) {
  .alert-banner {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px;
  }

  .alert-banner .btn {
    width: 100%;
  }
}