/* ============================================================
   Menu Manager — Modern Slate & Ocean Blue (Version 4.0)
   Designed for Visual Impact and Professionalism
   ============================================================ */

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

:root {
  /* Dynamic Palette */
  --bg:           #fbfcfd;
  --surface:      #ffffff;
  --sidebar:      #1a1d2e;
  --sidebar-h:    #252b45;
  --accent:       #3b82f6;
  --accent-glow:  rgba(59, 130, 246, 0.4);
  --success:      #10b981;
  --danger:       #f43f5e;
  --warn:         #f59e0b;
  --text:         #334155;
  --text-light:   #64748b;
  --border:       #f1f5f9;
  
  /* Geometry */
  --radius-sm:    10px;
  --radius-md:    16px;
  --radius-lg:    24px;
  
  /* Effects */
  --shadow:       0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --glow:         0 0 20px rgba(59, 130, 246, 0.15);
  --transition:   all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  
  --sidebar-w:    270px;
}

/* ── Reset ── */
* { box-sizing: border-box; margin: 0; padding: 0; outline: none !important; }
html { scroll-behavior: smooth; }
body { 
  font-family: 'Outfit', sans-serif; 
  background: var(--bg); 
  color: var(--text); 
  display: flex; 
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; }


/* ════════════════════════════════
   SIDEBAR
   ════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--sidebar);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  z-index: 1000;
  border-right: 1px solid rgba(255,255,255,0.05);
}

.sidebar-header {
  padding: 40px 30px;
  font-family: 'Montserrat', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 16px;
  color: #fff;
  letter-spacing: -0.02em;
}
.sidebar-header span:first-child { 
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); 
  width: 44px; height: 44px;
  border-radius: 12px;
  font-size: 1.4rem;
  box-shadow: 0 4px 12px var(--accent-glow);
}

.sidebar nav { flex: 1; padding: 10px 20px; }
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  color: #94a3b8;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  border-radius: 14px;
  margin-bottom: 6px;
  transition: var(--transition);
}
.sidebar nav a:hover { color: #fff; background: var(--sidebar-h); }
.sidebar nav a.active { color: #fff; background: var(--accent); box-shadow: 0 4px 20px var(--accent-glow); }
.sidebar nav a .nav-icon { width: 24px; text-align: center; }

.sidebar-footer { padding: 30px; font-size: 0.75rem; color: #475569; font-weight: 600; text-transform: uppercase; }

/* ════════════════════════════════
   MAIN CONTENT
   ════════════════════════════════ */
.main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; }

.topbar {
  height: 80px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky; top: 0; z-index: 900;
  border-bottom: 1px solid var(--border);
}

.topbar h1 { font-family: 'Montserrat', sans-serif; font-size: 1.25rem; font-weight: 700; color: #0f172a; }
.topbar .meta { font-size: 0.85rem; color: var(--text-light); }

.content { padding: 40px; max-width: 1400px; width: 100%; margin: 0 auto; }

/* ════════════════════════════════
   CARDS & STATS
   ════════════════════════════════ */
.card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.card-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 24px;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 12px;
}

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; margin-bottom: 30px; }
.stat-box {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--accent);
  transition: var(--transition);
}
.stat-box:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }

.stat-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  background: var(--bg);
}
.stat-val { font-size: 1.75rem; font-weight: 800; color: #0f172a; line-height: 1; }
.stat-label { font-size: 0.85rem; color: var(--text-light); font-weight: 600; margin-top: 4px; }

/* ════════════════════════════════
   FORMS & FILTER BAR
   ════════════════════════════════ */
.form-group { display: flex; flex-direction: column; gap: 6px; }
label { font-size: 0.8rem; font-weight: 700; color: var(--text-light); }

input, select, textarea {
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 0.9rem;
  color: var(--text);
  background: #fff;
  transition: var(--transition);
}
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(59, 130, 241, 0.1); }
input::-ms-reveal, input::-ms-clear { display: none !important; }
input::-webkit-contacts-auto-fill-button, input::-webkit-credentials-auto-fill-button { display: none !important; visibility: hidden; pointer-events: none; }

/* Horizontal Filter Bar */
.filter-bar {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 24px;
}
.filter-bar .form-group { min-width: 140px; flex: 1; }
.filter-bar .btn { height: 42px; width: auto; min-width: 100px; }

/* ════════════════════════════════
   TABLES (Clean & Spacious)
   ════════════════════════════════ */
.table-wrap { overflow: hidden; border-radius: var(--radius-md); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; background: #fff; }
thead th { 
  background: #f8fafc; 
  padding: 16px 20px; 
  text-align: left; 
  font-size: 0.7rem; 
  font-weight: 800; 
  color: #94a3b8; 
  text-transform: uppercase; 
  letter-spacing: 1px;
}
tbody td { padding: 20px; border-top: 1px solid var(--border); vertical-align: middle; }
tbody tr:hover { background: #fdfdfd; }

.dish-img { width: 48px; height: 48px; object-fit: cover; border-radius: 10px; }
.dish-placeholder { width: 48px; height: 48px; border-radius: 10px; background: #f1f5f9; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; }

/* ════════════════════════════════
   BUTTONS
   ════════════════════════════════ */
.btn {
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none !important;
  transition: var(--transition);
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 4px 12px var(--accent-glow); }
.btn-primary:hover { background: #2563eb; transform: scale(1.02); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #e11d48; }
.btn-warn { background: var(--warn); color: #fff; }
.btn-outline { background: transparent; border: 2px solid var(--border); color: var(--text-light); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 8px 16px; font-size: 0.75rem; }
.btn-grp { display: flex; align-items: center; gap: 8px; }
.btn-grp.vertical { flex-direction: column; }

/* ════════════════════════════════
   BADGES
   ════════════════════════════════ */
.badge { padding: 6px 12px; border-radius: 8px; font-size: 0.7rem; font-weight: 800; text-transform: uppercase; }
.badge-success { background: #dcfce7; color: #166534; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #e0f2fe; color: #075985; }

/* ════════════════════════════════
   MODALS
   ════════════════════════════════ */
.modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(15, 23, 42, 0.4); backdrop-filter: blur(4px); z-index: 2000;
}
.modal-overlay.open { display: block; animation: fadeIn 0.3s; }
.modal {
  display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); 
  width: min(500px, 95vw); background: #fff; border-radius: var(--radius-lg); box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25); z-index: 2100;
  overflow: hidden;
}
.modal.open { display: block; animation: modalIn 0.3s ease-out; }

.modal-header {
  padding: 24px 30px;
  background: #f8fafc;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-family: 'Montserrat', sans-serif; font-size: 1.15rem; font-weight: 800; color: #0f172a; }

.modal-close {
  background: none; border: none; font-size: 1.5rem; color: var(--text-light); cursor: pointer; line-height: 1; transition: var(--transition);
}
.modal-close:hover { color: var(--danger); transform: rotate(90deg); }

.modal-body { padding: 30px; }
.modal-footer {
  padding: 20px 30px;
  background: #f8fafc;
  display: flex; gap: 12px; justify-content: flex-end;
  border-top: 1px solid var(--border);
}

/* ════════════════════════════════
   QR & CATEGORY PAGE SPECIALS
   ════════════════════════════════ */
.qr-center { 
  display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 20px 0; 
}

.cat-list { list-style: none; }
.cat-list li {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px;
  background: var(--surface);
  border-radius: 12px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  transition: var(--transition);
}
.cat-list li:hover { transform: translateX(8px); border-color: var(--accent); }
.cat-name-box { display: flex; align-items: center; gap: 12px; font-weight: 700; color: #0f172a; }
.cat-actions { display: flex; align-items: center; gap: 12px; }

/* ════════════════════════════════
   LOGIN PAGE
   ════════════════════════════════ */
.login-screen {
  height: 100vh; width: 100vw;
  background: radial-gradient(circle at top right, #3b82f61a, transparent),
              radial-gradient(circle at bottom left, #3b82f61a, transparent),
              #f8fafc;
  display: flex; align-items: center; justify-content: center;
}
.login-card {
  width: min(400px, 90vw);
  background: #fff;
  padding: 40px;
  border-radius: 28px;
  box-shadow: 0 30px 60px -12px rgba(0,0,0,0.12);
  border: 1px solid var(--border);
}
.login-header { text-align: center; margin-bottom: 30px; }
.login-header .logo { font-size: 2.5rem; margin-bottom: 12px; display: inline-block; }
.login-header h2 { font-family: 'Montserrat', sans-serif; font-size: 1.5rem; font-weight: 800; color: #0f172a; }
.login-header p { font-size: 0.85rem; color: var(--text-light); }

/* ════════════════════════════════
   USER PROFILE DROPDOWN
   ════════════════════════════════ */
.user-profile { position: relative; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 6px 12px; border-radius: 40px; transition: var(--transition); border: 1px solid transparent; }
.user-profile:hover { background: #fff; border-color: var(--border); box-shadow: 0 4px 12px rgba(0,0,0,0.04); }
.user-avatar { width: 40px; height: 40px; background: var(--accent); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.1rem; box-shadow: 0 4px 10px var(--accent-glow); }
.user-info { display: flex; flex-direction: column; line-height: 1.2; }
.user-name { font-size: 0.9rem; font-weight: 700; color: #0f172a; }
.user-role { font-size: 0.75rem; color: var(--text-light); }
.user-chevron { font-size: 0.6rem; color: var(--text-light); transition: var(--transition); }
.user-profile.active .user-chevron { transform: rotate(180deg); }

.dropdown-menu {
  position: absolute; top: calc(100% + 12px); right: 0;
  width: 220px; background: #fff; border-radius: 20px;
  box-shadow: 0 20px 40px -10px rgba(0,0,0,0.12);
  border: 1px solid var(--border);
  padding: 10px; z-index: 1000;
  display: none; transform-origin: top right; transition: 0.2s;
}
.dropdown-menu.open { display: block; animation: modalIn 0.2s; }
.dropdown-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 12px;
  color: #0f172a; font-size: 0.85rem; font-weight: 600; text-decoration: none; transition: var(--transition);
}
.dropdown-item:hover { background: #f1f5f9; color: var(--accent); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-item.danger:hover { background: #fff1f2; color: var(--danger); }
.dropdown-divider { height: 1px; background: var(--border); margin: 8px 10px; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translate(-50%, -60%); } to { opacity: 1; transform: translate(-50%, -50%); } }

/* Highlight newly added row */
.row-highlight {
  animation: rowFlash 2s ease forwards;
}
@keyframes rowFlash {
  0% { background: #d1fae5; transform: scale(1.01); }
  50% { background: #ecfdf5; transform: scale(1); }
  100% { background: transparent; }
}

/* ════════════════════════════════
   RESPONSIVE DESIGN SYSTEM
   ════════════════════════════════ */

/* Mobile Menu Trigger */
.menu-toggle {
  display: none;
  width: 44px; height: 44px;
  background: #fff; border: 1px solid var(--border);
  border-radius: 12px;
  align-items: center; justify-content: center;
  font-size: 1.2rem; cursor: pointer;
  transition: var(--transition);
  color: #0f172a;
}
.menu-toggle:hover { background: #f1f5f9; border-color: var(--accent); }

/* ── RESPONSIVENESS OVERHAUL ── */
@media (max-width: 1024px) {
  .menu-toggle { display: flex; }
  .sidebar { 
    transform: translateX(-100%); 
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2000;
  }
  .sidebar.open { transform: translateX(0); box-shadow: 20px 0 60px rgba(0,0,0,0.15); }
  .sidebar-close { display: block !important; }
  
  .main { margin-left: 0; width: 100%; }
  .topbar { padding: 0 20px; }
  .topbar-left h1 { font-size: 1.1rem; }
  .topbar-left .meta { display: none; }
  .topbar-right .btn-outline { display: none; }
  
  .content { padding: 15px; }
  .grid-2 { grid-template-columns: 1fr !important; gap: 16px !important; }

  .table-wrap { 
    overflow-x: auto; 
    -webkit-overflow-scrolling: touch; 
    border-radius: 12px;
  }
  .table-wrap table { min-width: 800px; }
  
  .user-name, .user-role { display: none; }
  .user-profile { padding: 6px; }

  .modal { width: 95% !important; max-height: 90vh !important; top: 5% !important; transform: translateX(-50%) !important; overflow-y: auto; }
}

@media (max-width: 480px) {
  .topbar-right .badge { display: none; }
  .login-card { padding: 25px 15px; width: 95% !important; }
  .btn { width: 100%; justify-content: center; }
  .btn-sm { width: auto; }
  .stat-card .val { font-size: 1.5rem; }
}

/* Sidebar Close Button (Mobile Only) */
.sidebar-close {
  display: none;
  position: absolute; top: 20px; right: 20px;
  font-size: 1.5rem; color: #fff; cursor: pointer;
  opacity: 0.6; transition: 0.2s;
}
@media (max-width: 1024px) {
  .sidebar-close { display: block; }
}

/* ── Login Animations ── */
.shake { animation: shake 0.5s ease-in-out; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-10px); }
  40% { transform: translateX(10px); }
  60% { transform: translateX(-8px); }
  80% { transform: translateX(8px); }
}

.card-hold { animation: cardFlip 0.8s ease-out; transform-style: preserve-3d; }
@keyframes cardFlip {
  0% { transform: rotateY(0deg); opacity: 1; }
  50% { transform: rotateY(180deg); opacity: 0.5; }
  100% { transform: rotateY(0deg); opacity: 1; }
}
