@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=Inter:wght@400;500;600&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #c05e14;
  --primary-light: #f4e9da;
  --primary-dark: #8a3e08;
  --secondary: #2e6b3e;
  --secondary-light: #e8f5ed;
  --bg: #fdf8f2;
  --card: #ffffff;
  --border: #e8ddd0;
  --text: #1a0f00;
  --text-muted: #8a7060;
  --destructive: #c0392b;
  --destructive-light: #fce8e6;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

h1, h2, h3, h4 { font-family: 'Playfair Display', serif; }

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

button { cursor: pointer; font-family: inherit; border: none; }

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

/* Utility */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* Navbar */
.navbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--text);
}
.navbar-links { display: flex; align-items: center; gap: 1rem; }
.navbar-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.15s;
}
.navbar-links a:hover { color: var(--text); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s, background 0.15s;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { opacity: 0.9; }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover:not(:disabled) { background: var(--primary-light); }
.btn-sm { padding: 0.375rem 0.875rem; font-size: 0.8rem; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: 8px; border: 1px solid var(--border); background: transparent; }
.btn-icon:hover { background: var(--primary-light); }

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* Tags */
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}
.badge-green { background: var(--secondary-light); color: var(--secondary); }
.badge-orange { background: var(--primary-light); color: var(--primary); }
.badge-yellow { background: #fef9c3; color: #854d0e; }
.badge-blue { background: #dbeafe; color: #1d4ed8; }
.badge-red { background: var(--destructive-light); color: var(--destructive); }
.badge-gray { background: #f3f4f6; color: #6b7280; }

/* Veg/NonVeg dot */
.veg-dot, .nonveg-dot {
  width: 16px; height: 16px;
  border-radius: 2px;
  border: 2px solid;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.veg-dot { border-color: var(--secondary); }
.veg-dot::after { content:''; width:6px; height:6px; border-radius:50%; background:var(--secondary); }
.nonveg-dot { border-color: var(--destructive); }
.nonveg-dot::after { content:''; width:6px; height:6px; border-radius:50%; background:var(--destructive); }

/* Form elements */
.form-label { display: block; font-size: 0.875rem; font-weight: 500; margin-bottom: 0.375rem; }
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.875rem;
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(192,94,20,0.12);
}
.form-textarea { resize: vertical; min-height: 80px; }

/* Modal overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.hidden { display: none !important; }
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}
.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--card);
  z-index: 1;
}
.modal-header h2 { font-size: 1.125rem; }
.modal-body { padding: 1.5rem; }
.modal-footer { padding: 0 1.5rem 1.5rem; display: flex; gap: 0.75rem; }

/* Page header */
.page-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.page-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.page-header-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.125rem;
  font-family: 'Playfair Display', serif;
  font-weight: 700;
}
.back-btn {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
  flex-shrink: 0;
  text-decoration: none;
}
.back-btn:hover { background: var(--primary-light); }

/* Container */
.container { max-width: 1100px; margin: 0 auto; padding: 2rem 1.5rem; }
.container-sm { max-width: 780px; margin: 0 auto; padding: 2rem 1.5rem; }

/* Grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card { padding: 1.25rem 1.5rem; }
.stat-label { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.25rem; }
.stat-value { font-size: 1.75rem; font-weight: 700; }

/* Toast */
.toast-container { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 999; display: flex; flex-direction: column; gap: 0.5rem; }
.toast {
  background: var(--text);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  font-size: 0.875rem;
  box-shadow: var(--shadow-md);
  animation: slideIn 0.2s ease;
  max-width: 320px;
}
.toast.error { background: var(--destructive); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Loader */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Skeleton */
.skeleton { background: linear-gradient(90deg, #eee 25%, #f5f5f5 50%, #eee 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Tabs */
.tab-bar { display: flex; gap: 0.5rem; overflow-x: auto; scrollbar-width: none; padding-bottom: 1rem; }
.tab-bar::-webkit-scrollbar { display: none; }
.tab-btn {
  flex-shrink: 0;
  padding: 0.375rem 1rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  background: #f3f0ec;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.tab-btn.active { background: var(--primary); color: #fff; }

/* Status colors */
.status-pending { background: #fef9c3; color: #854d0e; }
.status-received { background: #dbeafe; color: #1e40af; }
.status-preparing { background: #fed7aa; color: #c2410c; }
.status-ready { background: #d1fae5; color: #065f46; }
.status-delivered { background: #f3f4f6; color: #6b7280; }
.status-cancelled { background: #fee2e2; color: #991b1b; }

/* Checkbox custom */
.checkbox-label { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; font-size: 0.875rem; user-select: none; }
.checkbox-label input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }

/* Divider */
.divider { border: none; border-top: 1px solid var(--border); margin: 1rem 0; }

/* Empty state */
.empty-state { text-align: center; padding: 4rem 1rem; }
.empty-state h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }
.empty-state p { color: var(--text-muted); font-size: 0.875rem; margin-bottom: 1.5rem; }

/* Responsive */
@media (max-width: 600px) {
  .container, .container-sm { padding: 1rem; }
  .page-header-inner { padding: 0 1rem; min-height: 64px; height: auto; gap: 0.75rem; flex-wrap: wrap; padding-top: 0.75rem; padding-bottom: 0.75rem; }
  .page-header-title { font-size: 1rem; min-width: 0; }
  .stats-grid { grid-template-columns: 1fr; }
  .toast-container { right: 1rem; left: 1rem; bottom: 1rem; }
  .toast { max-width: none; }
  .modal { border-radius: 16px 16px 0 0; position: fixed; bottom: 0; left: 0; right: 0; max-width: 100%; max-height: 95vh; margin: 0; }
  .modal-overlay { align-items: flex-end; padding: 0; }
}

/* ===================== Admin Sidebar Layout ===================== */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 50;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand-icon { font-size: 1.5rem; }
.sidebar-brand-name {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 0.75rem 0.75rem;
  gap: 0.25rem;
  flex: 1;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.sidebar-link:hover { background: var(--primary-light); color: var(--text); }
.sidebar-link.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.sidebar-link-icon { width: 16px; height: 16px; flex-shrink: 0; }

.sidebar-logout {
  margin: 0.75rem;
  padding: 0.5rem 0.875rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
  display: flex;
  align-items: center;
  gap: 0.625rem;
}
.sidebar-logout:hover { background: var(--destructive-light); color: var(--destructive); }

/* Main content area */
.admin-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.admin-topbar {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card);
  position: sticky;
  top: 0;
  z-index: 40;
}
.admin-page-title {
  font-size: 1.25rem;
  font-family: 'Playfair Display', serif;
  font-weight: 700;
}

.admin-content {
  padding: 1.5rem;
  flex: 1;
}

/* Mobile nav — hidden on desktop */
.admin-mobile-nav { display: none; }

/* No data (used in multiple admin pages) */
.no-data { text-align: center; padding: 2rem; color: var(--text-muted); font-size: 0.875rem; }

/* Responsive: hide sidebar, show mobile nav */
@media (max-width: 768px) {
  .admin-layout { flex-direction: column; }
  .admin-sidebar { display: none; }
  .admin-main { min-height: 0; }
  .admin-topbar { padding: 0.875rem 1rem; }
  .admin-content { padding: 1rem; }
  .admin-page-title { font-size: 1.05rem; }

  .admin-mobile-nav {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
  }
  .admin-mobile-nav::-webkit-scrollbar { display: none; }

  .mobile-nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.125rem;
    padding: 0.625rem 0.875rem;
    font-size: 1.1rem;
    color: var(--text-muted);
    text-decoration: none;
    flex-shrink: 0;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
  }
  .mobile-nav-link small { font-size: 0.65rem; font-weight: 500; }
  .mobile-nav-link:hover, .mobile-nav-link.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
  }
}

/* ===================== Topbar notification buttons ===================== */
.notif-btn {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all 0.15s;
  flex-shrink: 0;
}
.notif-btn:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }
.notif-btn.active { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }
.notif-btn.has-notif { color: var(--primary); border-color: var(--primary); }

.notif-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--destructive);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--card);
}

.notif-panel {
  position: fixed;
  top: 65px;
  right: 1rem;
  width: 360px;
  max-height: 500px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.14);
  z-index: 300;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.notif-panel-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 0.9375rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.notif-panel-body { flex: 1; overflow-y: auto; }
.notif-backdrop { position: fixed; inset: 0; z-index: 299; }
.notif-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.notif-item:last-child { border-bottom: none; }
.notif-item-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.notif-item-info { flex: 1; min-width: 0; }
.notif-item-title { font-weight: 600; font-size: 0.875rem; }
.notif-item-sub { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.125rem; }
.notif-item-actions { display: flex; gap: 0.375rem; flex-shrink: 0; }
.notif-empty { text-align: center; padding: 2.5rem 1rem; color: var(--text-muted); font-size: 0.875rem; }

@media (max-width: 768px) {
  .notif-panel { right: 0.5rem; width: calc(100vw - 1rem); }
}

/* ===================== Menu item image ===================== */
.menu-item-img {
  width: 80px;
  height: 80px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
@media (max-width: 480px) {
  .menu-item-img { width: 64px; height: 64px; }
}
