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

/* Sidebar (Desktop) */
.sidebar {
  width: 250px;
  background: var(--white);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 100;
}
.sidebar-header {
  padding: 32px 24px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.sidebar-logo {
  width: 36px; height: 36px;
  background: var(--gold-gradient);
  color: var(--white);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Lora', serif;
  font-weight: 700; font-size: 18px;
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3);
}
.sidebar-title {
  font-family: 'Lora', serif;
  font-weight: 700; font-size: 20px;
  color: var(--obsidian-dark);
}
.nav-links {
  padding: 12px;
  flex: 1;
  display: flex; flex-direction: column; gap: 4px;
}
.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  color: var(--text-muted);
  font-weight: 500; font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: var(--radius-sm);
}
.nav-link:hover {
  color: var(--obsidian-dark);
  background: #f4f4f5; /* Zinc 100 */
}
.nav-link.active {
  color: var(--obsidian-dark);
  background: #f4f4f5;
  font-weight: 600;
}
.nav-link i {
  width: 20px; font-size: 16px; text-align: center;
  color: var(--slate);
}
.nav-link.active i {
  color: var(--gold);
}
.sidebar-footer {
  padding: 24px 12px;
  border-top: 1px solid var(--border);
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: 250px;
  padding: 48px;
  max-width: 1400px;
}
.section-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 32px;
}
.section-header h2 { font-size: 28px; }

/* Bottom Nav (Mobile) */
.bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  padding: 8px 16px; padding-bottom: env(safe-area-inset-bottom, 8px);
  z-index: 100;
}
.bottom-nav-inner {
  display: flex; justify-content: space-around; align-items: center;
}
.bottom-nav-link {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: var(--slate); font-size: 10px; font-weight: 600;
  padding: 8px; border-radius: var(--radius-sm); cursor: pointer;
}
.bottom-nav-link.active { color: var(--gold); }
.bottom-nav-link i { font-size: 20px; }

/* Login Overlay - Deep Dark Premium */
.login-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: #09090b; /* Deep zinc */
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  padding: 24px;
  overflow: hidden;
}
.login-overlay::before,
.login-overlay::after {
  content: ''; position: absolute; border-radius: 50%;
  filter: blur(80px); opacity: 0.6; pointer-events: none;
  animation: float 15s infinite alternate ease-in-out;
}
.login-overlay::before {
  width: 400px; height: 400px; background: rgba(245, 158, 11, 0.2);
  top: -100px; right: -100px;
}
.login-overlay::after {
  width: 300px; height: 300px; background: rgba(16, 185, 129, 0.15);
  bottom: -50px; left: -50px; animation-delay: -5s;
}

.login-card {
  width: 100%; max-width: 420px;
  text-align: center;
  padding: 48px 32px;
  position: relative; z-index: 1;
  background: rgba(24, 24, 27, 0.6); /* Translucent */
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 32px;
  box-shadow: 0 32px 64px rgba(0, 0, 0, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.1);
}
.login-card .logo-mark {
  width: 72px; height: 72px;
  background: var(--gold-gradient); color: var(--white);
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Lora', serif; font-size: 36px;
  margin: 0 auto 24px;
  box-shadow: 0 12px 24px rgba(245, 158, 11, 0.3), inset 0 2px 4px rgba(255,255,255,0.2);
}
.login-card h1 { font-size: 32px; color: white; margin-bottom: 8px; }
.login-card p { color: #a1a1aa; font-size: 16px; margin-bottom: 32px; }
.login-card .input-group { text-align: left; }
.login-card .input-group label { color: #d4d4d8; margin-bottom: 8px; font-size: 14px;}
.login-card input {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white !important;
  border-radius: 16px;
  padding: 14px 16px;
  transition: all 0.3s ease;
}
.login-card input:-webkit-autofill,
.login-card input:-webkit-autofill:hover, 
.login-card input:-webkit-autofill:focus, 
.login-card input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 30px #18181b inset !important;
  -webkit-text-fill-color: white !important;
  transition: background-color 5000s ease-in-out 0s;
}
.login-card input:focus {
  background: rgba(0, 0, 0, 0.6);
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}
.login-card button { width: 100%; margin-top: 16px; padding: 14px; border-radius: 16px; font-size: 16px; }

/* Overview Section */
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px;
  margin-bottom: 40px;
}
.stat-card {
  padding: 28px 24px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.stat-value {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 40px; font-weight: 700; letter-spacing: -0.02em;
  color: var(--obsidian-dark);
  margin-bottom: 4px;
}
.stat-label { color: var(--text-muted); font-size: 13px; font-weight: 500; }

/* Menu List Section */
.search-bar { margin-bottom: 24px; position: relative; max-width: 480px; }
.search-bar input {
  width: 100%; padding: 12px 16px 12px 44px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 15px; background: var(--white);
  box-shadow: var(--shadow-sm); transition: all 0.2s;
}
.search-bar input:focus {
  border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-glow); outline: none;
}
.search-bar i {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  color: var(--slate); font-size: 16px;
}

.category-tabs-admin {
  display: flex; gap: 8px; margin-bottom: 24px;
  overflow-x: auto; scrollbar-width: none; padding-bottom: 4px;
}
.category-tabs-admin::-webkit-scrollbar { display: none; }
.tab-btn {
  background: var(--white); border: 1px solid var(--border);
  padding: 8px 16px; border-radius: var(--radius-pill);
  font-size: 14px; font-weight: 500; color: var(--text-muted);
  cursor: pointer; white-space: nowrap; transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}
.tab-btn:hover { background: #f4f4f5; color: var(--obsidian-dark); }
.tab-btn.active {
  background: var(--obsidian-dark); color: var(--white); border-color: var(--obsidian-dark);
}

.dish-list { display: flex; flex-direction: column; gap: 12px; }
.dish-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 24px;
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}
.dish-row:hover { box-shadow: var(--shadow-md); border-color: #d4d4d8; }
.dish-info { flex: 1; }
.dish-header-row { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.dish-name { font-weight: 700; font-size: 16px; color: var(--obsidian-dark); }
.dish-desc {
  color: var(--text-muted); font-size: 14px; margin-bottom: 12px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 500px;
}
.dish-allergens { display: flex; gap: 6px; flex-wrap: wrap; }
.dish-actions { display: flex; align-items: center; gap: 16px; }
.empty-state {
  text-align: center; padding: 64px 24px; color: var(--slate);
  background: var(--white); border-radius: var(--radius); border: 1px dashed var(--border);
}
.empty-state i { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }

/* Add/Edit Dish Section */
.dish-form-layout { display: grid; grid-template-columns: 1fr 400px; gap: 32px; }
.form-left, .form-right { display: flex; flex-direction: column; gap: 24px; }
.char-count { font-size: 12px; color: var(--slate); text-align: right; margin-top: 4px; }

/* Ingredients Tags */
.ingredients-input-wrapper {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px; background: #fafafa;
  min-height: 50px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  transition: all 0.2s; box-shadow: inset 0 1px 2px rgba(0,0,0,0.02);
}
.ingredients-input-wrapper:focus-within {
  border-color: var(--gold); background: var(--white); box-shadow: 0 0 0 3px var(--gold-glow);
}
.chip {
  background: var(--obsidian-dark); color: white;
  padding: 4px 12px; border-radius: var(--radius-pill);
  font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 6px;
}
.chip-remove { cursor: pointer; color: #a1a1aa; font-weight: bold; transition: color 0.2s; }
.chip-remove:hover { color: var(--red); }
.tag-input {
  border: none !important; outline: none !important; box-shadow: none !important;
  padding: 4px !important; background: transparent !important; flex: 1; min-width: 120px;
}

/* Allergen Preview Box */
.allergen-preview {
  background: #f4f4f5; padding: 20px; border-radius: var(--radius-sm); border: 1px solid var(--border);
}
.preview-title { font-weight: 600; margin-bottom: 12px; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.preview-title.has-allergens { color: var(--red); }
.preview-title.safe { color: var(--sage); }
.preview-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.preview-tags:empty { display: none; margin-bottom: 0; }
.safe-tags-title { font-size: 12px; font-weight: 600; color: var(--slate-dark); margin-bottom: 8px; }

/* QR Code Section */
.qr-container {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px; background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow-md); max-width: 480px; margin: 0 auto; border: 1px solid var(--border);
}
#qr-code { margin: 24px 0; padding: 20px; background: white; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.qr-url {
  font-family: 'DM Mono', monospace; font-size: 14px; color: var(--text-muted);
  margin-bottom: 24px; text-align: center; word-break: break-all;
  background: #f4f4f5; padding: 12px 20px; border-radius: var(--radius-sm);
}

/* Mobile Adjustments */
@media (max-width: 1023px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; padding: 24px; padding-bottom: 90px; }
  .bottom-nav { display: block; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .dish-form-layout { grid-template-columns: 1fr; gap: 24px; }
  .dish-desc { max-width: 250px; }
}

@media (max-width: 639px) {
  .dish-row { flex-direction: column; align-items: flex-start; gap: 16px; }
  .dish-actions { width: 100%; justify-content: flex-end; padding-top: 12px; border-top: 1px solid var(--border); }
  .dish-desc { max-width: 100%; white-space: normal; }
  .login-overlay { padding: 16px; }
  .login-card { padding: 40px 24px; border-radius: 28px; }
}
