/* ══════════════════════════════════════════════════════
   Restaurant Hub — Admin Panel
   Dark professional theme
   ══════════════════════════════════════════════════════ */

body.admin-page {
  background: #0d0d0d;
  color: #e0e0e0;
  min-height: 100vh;
}

/* ── Login ── */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-box {
  background: var(--dark-surface);
  border: 1px solid var(--dark-border);
  border-radius: var(--r-lg);
  padding: 48px 40px;
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.login-box h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  color: var(--accent);
  margin-bottom: 8px;
}

.login-box p {
  font-size: 0.82rem;
  color: var(--dark-text-muted);
  margin-bottom: 28px;
}

.login-box input {
  width: 100%;
  padding: 14px 18px;
  border-radius: var(--r);
  border: 1px solid var(--dark-border);
  background: rgba(255,255,255,0.04);
  color: #fff;
  font-size: 0.9rem;
  font-family: 'Montserrat', sans-serif;
  outline: none;
  margin-bottom: 16px;
  transition: border-color 0.2s;
}

.login-box input:focus { border-color: var(--accent); }

.login-box .btn-login {
  width: 100%;
  padding: 14px;
  border-radius: var(--r);
  border: none;
  background: var(--accent);
  color: #000;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.login-box .btn-login:hover { background: var(--accent-hover); }

.login-error {
  color: var(--danger);
  font-size: 0.8rem;
  margin-top: 12px;
}

/* ── Dashboard Layout ── */
.dashboard {
  display: none;
  min-height: 100vh;
}

.dashboard.active { display: flex; }

/* ── Sidebar ── */
.sidebar {
  width: 260px;
  background: var(--dark-surface);
  border-right: 1px solid var(--dark-border);
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 50;
  overflow-y: auto;
}

.sidebar-brand {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  color: var(--accent);
  padding: 0 24px;
  margin-bottom: 32px;
}

.sidebar-brand span {
  font-size: 0.65rem;
  color: var(--dark-text-muted);
  display: block;
  margin-top: 2px;
  font-family: 'Montserrat', sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  font-size: 0.85rem;
  color: var(--dark-text-muted);
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: 'Montserrat', sans-serif;
}

.nav-item:hover { color: var(--dark-text); background: rgba(255,255,255,0.03); }
.nav-item.active { color: var(--accent); background: rgba(197,160,89,0.06); border-right: 2px solid var(--accent); }

.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--dark-border);
}

.btn-logout {
  width: 100%;
  padding: 10px;
  border-radius: var(--r);
  border: 1px solid var(--dark-border);
  background: transparent;
  color: var(--dark-text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Montserrat', sans-serif;
}

.btn-logout:hover { border-color: var(--danger); color: var(--danger); }

/* ── Main Content ── */
.main-content {
  flex: 1;
  margin-left: 260px;
  padding: 32px;
  min-height: 100vh;
}

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

.content-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  font-weight: 600;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--r);
  border: 1px solid var(--dark-border);
  background: transparent;
  color: var(--dark-text);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Montserrat', sans-serif;
}

.btn:hover { border-color: rgba(255,255,255,0.2); }

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

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

.btn-danger { border-color: rgba(231,76,60,0.3); color: var(--danger); }
.btn-danger:hover { background: rgba(231,76,60,0.1); }

.btn-sm { padding: 6px 14px; font-size: 0.75rem; }

.btn-icon {
  width: 34px; height: 34px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
}

/* ── Restaurant List ── */
.rest-list {
  display: grid;
  gap: 16px;
}

.rest-list-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--dark-surface);
  border: 1px solid var(--dark-border);
  border-radius: var(--r);
  transition: border-color 0.2s;
}

.rest-list-item:hover { border-color: rgba(255,255,255,0.1); }

.rest-list-logo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--dark-surface-2);
  overflow: hidden;
  flex-shrink: 0;
}

.rest-list-logo img { width: 100%; height: 100%; object-fit: cover; }

.rest-list-info { flex: 1; }

.rest-list-name {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 2px;
}

.rest-list-meta {
  font-size: 0.75rem;
  color: var(--dark-text-muted);
}

.rest-list-actions {
  display: flex;
  gap: 8px;
}

.status-badge {
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.68rem;
  font-weight: 500;
}

.status-badge.active { background: rgba(39,174,96,0.1); color: var(--success); }
.status-badge.hidden { background: rgba(255,255,255,0.05); color: var(--dark-text-muted); }

/* ── Form Panels ── */
.panel { display: none; }
.panel.active { display: block; }

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

.form-group label {
  display: block;
  font-size: 0.78rem;
  color: var(--dark-text-muted);
  margin-bottom: 6px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--r);
  border: 1px solid var(--dark-border);
  background: rgba(255,255,255,0.04);
  color: #fff;
  font-size: 0.85rem;
  font-family: 'Montserrat', sans-serif;
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus { border-color: var(--accent); }

textarea.form-input {
  min-height: 80px;
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

/* ── Menu Editor ── */
.category-block {
  background: var(--dark-surface);
  border: 1px solid var(--dark-border);
  border-radius: var(--r);
  margin-bottom: 20px;
  overflow: hidden;
}

.category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--dark-border);
  cursor: pointer;
}

.category-header h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  color: var(--accent);
}

.category-items {
  padding: 12px;
}

.item-editor {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--dark-border);
  align-items: flex-start;
  transition: background 0.2s;
}

.item-editor:last-child { border-bottom: none; }
.item-editor:hover { background: rgba(255,255,255,0.02); }

.item-editor-main {
  flex: 1;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.item-editor-name {
  font-weight: 500;
  font-size: 0.9rem;
}

.item-editor-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.item-price-input {
  width: 80px;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  border: 1px solid var(--dark-border);
  background: rgba(255,255,255,0.04);
  color: #fff;
  font-size: 0.85rem;
  font-family: 'Montserrat', sans-serif;
  outline: none;
  text-align: center;
}

.item-price-input:focus { border-color: var(--accent); }

.toggle-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  color: var(--dark-text-muted);
  cursor: pointer;
  user-select: none;
}

.toggle-label input[type=checkbox] {
  accent-color: var(--accent);
}

.item-editor-img {
  width: 60px;
  height: 60px;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--dark-surface-2);
  flex-shrink: 0;
  position: relative;
}

.item-editor-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.item-img-upload {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: 0.7rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
}

.item-editor-img:hover .item-img-upload { opacity: 1; }

.lang-expand {
  width: 100%;
  display: none;
  padding-top: 12px;
  flex-direction: column;
  gap: 8px;
}

.lang-expand.open { display: flex; }

.lang-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lang-flag {
  font-size: 0.85rem;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.lang-input {
  flex: 1;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--dark-border);
  background: rgba(255,255,255,0.04);
  color: #fff;
  font-size: 0.82rem;
  font-family: 'Montserrat', sans-serif;
  outline: none;
}

.lang-input:focus { border-color: var(--accent); }

/* ── Success / Error Messages ── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 14px 24px;
  border-radius: var(--r);
  background: var(--success);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 500;
  z-index: 1000;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  pointer-events: none;
}

.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: var(--danger); }

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay.show { display: flex; }

.modal {
  background: var(--dark-surface);
  border: 1px solid var(--dark-border);
  border-radius: var(--r-lg);
  width: 100%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  padding: 32px;
}

.modal h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  color: var(--accent);
  margin-bottom: 24px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    position: fixed;
    bottom: 0; top: auto;
    height: auto;
    flex-direction: row;
    padding: 0;
    border-right: none;
    border-top: 1px solid var(--dark-border);
    overflow-x: auto;
    z-index: 100;
  }
  .sidebar-brand { display: none; }
  .sidebar-nav { display: flex; }
  .nav-item { padding: 12px 16px; white-space: nowrap; border-right: none !important; }
  .nav-item.active { border-bottom: 2px solid var(--accent); border-right: none; }
  .sidebar-footer { display: none; }
  .main-content { margin-left: 0; padding: 16px 16px 80px; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
}
