/* ============================================
   Varas Grill & Bar — Admin Panel Styles
   ============================================ */
:root {
  --bg:        #0D0603;
  --bg2:       #1C0E05;
  --bg3:       #2A1508;
  --sidebar:   #110804;
  --amber:     #C8752A;
  --amber-l:   #E8A04A;
  --amber-dim: rgba(200,117,42,0.15);
  --border:    rgba(255,255,255,0.07);
  --text:      #F5EDD8;
  --text-dim:  rgba(245,237,216,0.55);
  --text-muted:rgba(245,237,216,0.3);
  --green:     #4CAF50;
  --red:       #EF5350;
  --yellow:    #FFC107;
  --radius:    10px;
  --font-serif:'Playfair Display', Georgia, serif;
  --font-sans: 'Inter', 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body { font-family: var(--font-sans); background: var(--bg); color: var(--text); min-height: 100vh; }
a { color: var(--amber-l); text-decoration: none; }
a:hover { color: var(--text); }
img { display: block; max-width: 100%; }

/* ── AUTH PAGES ─────────────────────────── */
.auth-body {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  background: radial-gradient(ellipse at 50% 100%, #3B1F0C 0%, #0D0603 60%);
}
.auth-card {
  width: 100%; max-width: 400px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.5rem 2rem;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.auth-logo { font-size: 2.5rem; margin-bottom: 0.75rem; }
.auth-title {
  font-family: var(--font-serif);
  font-size: 1.8rem; color: var(--text);
  margin-bottom: 0.3rem;
}
.auth-sub { font-size: 0.82rem; color: var(--text-dim); margin-bottom: 1.75rem; }
.auth-form { text-align: left; }
.auth-back {
  display: block; margin-top: 1.5rem;
  font-size: 0.8rem; color: var(--text-muted);
}
.auth-back:hover { color: var(--text-dim); }

/* ── LAYOUT ─────────────────────────────── */
.admin-layout {
  display: flex; min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
  width: 230px; flex-shrink: 0;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  overflow-y: auto;
}
.sidebar-brand {
  padding: 1.5rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
}
.sidebar-brand .brand-fire { font-size: 1.5rem; }
.sidebar-brand .brand-name {
  font-family: var(--font-serif);
  font-size: 1.1rem; color: var(--text);
  line-height: 1.2;
}
.sidebar-brand .brand-sub {
  font-size: 0.68rem; color: var(--amber);
  letter-spacing: 0.1em; text-transform: uppercase;
}

.sidebar-nav { padding: 1rem 0.75rem; flex: 1; }
.nav-label {
  font-size: 0.62rem; color: var(--text-muted);
  letter-spacing: 0.12em; text-transform: uppercase;
  padding: 0.4rem 0.5rem 0.25rem;
  margin-top: 0.5rem;
}
.nav-item {
  display: flex; align-items: center; gap: 0.65rem;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 0.88rem; font-weight: 500;
  transition: background 0.2s, color 0.2s;
  margin-bottom: 2px;
}
.nav-item:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.nav-item.active {
  background: var(--amber-dim);
  color: var(--amber-l);
  border: 1px solid rgba(200,117,42,0.2);
}
.nav-item .nav-icon { font-size: 1rem; flex-shrink: 0; }

.sidebar-footer {
  padding: 0.75rem;
  border-top: 1px solid var(--border);
}
.sidebar-user {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.6rem 0.5rem;
  border-radius: 8px;
  font-size: 0.82rem;
}
.user-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--amber-dim); border: 1px solid rgba(200,117,42,0.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; color: var(--amber-l); flex-shrink: 0;
}
.user-name { color: var(--text-dim); font-size: 0.82rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.btn-logout {
  background: rgba(255,255,255,0.05); border: 1px solid var(--border);
  color: var(--text-muted); border-radius: 6px; padding: 0.3rem 0.5rem;
  font-size: 0.75rem; cursor: pointer; font-family: var(--font-sans);
  transition: background 0.2s, color 0.2s;
}
.btn-logout:hover { background: rgba(239,83,80,0.15); color: #EF5350; }

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

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.75rem;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.topbar-title { font-family: var(--font-serif); font-size: 1.25rem; color: var(--text); }
.topbar-sub { font-size: 0.78rem; color: var(--text-dim); margin-top: 1px; }
.topbar-actions { display: flex; gap: 0.5rem; align-items: center; }

.page-body { padding: 1.75rem; flex: 1; }

/* ── CARDS / STATS ──────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex; flex-direction: column; gap: 0.35rem;
}
.stat-card--alert {
  border-color: var(--amber);
  box-shadow: 0 0 0 1px var(--amber);
}
.stat-icon { font-size: 1.5rem; }
.stat-value {
  font-family: var(--font-serif);
  font-size: 2rem; font-weight: 700; color: var(--amber-l);
  line-height: 1;
}
.stat-label { font-size: 0.78rem; color: var(--text-dim); }

.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.card-title { font-size: 0.95rem; font-weight: 600; color: var(--text); }
.card-body { padding: 1.25rem; }

/* ── TABLES ─────────────────────────────── */
.table-wrap { overflow-x: auto; }
table {
  width: 100%; border-collapse: collapse;
  font-size: 0.85rem;
}
th {
  text-align: left; padding: 0.6rem 0.85rem;
  font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-muted); border-bottom: 1px solid var(--border);
}
td {
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--text-dim); vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }
td strong { color: var(--text); font-weight: 500; }

/* ── BADGES ─────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 0.2rem 0.6rem; border-radius: 50px;
  font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.04em;
}
.badge-pending  { background: rgba(255,193,7,0.15);  color: #FFC107; border: 1px solid rgba(255,193,7,0.3); }
.badge-confirmed{ background: rgba(76,175,80,0.15);  color: #4CAF50; border: 1px solid rgba(76,175,80,0.3); }
.badge-cancelled{ background: rgba(239,83,80,0.15);  color: #EF5350; border: 1px solid rgba(239,83,80,0.3); }
.badge-active   { background: rgba(200,117,42,0.15); color: var(--amber-l); border: 1px solid rgba(200,117,42,0.3); }

/* ── FORMS ──────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block; font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: 0.35rem;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%; padding: 0.65rem 0.9rem;
  background: var(--bg3); border: 1.5px solid var(--border);
  border-radius: 8px; color: var(--text);
  font-family: var(--font-sans); font-size: 0.88rem;
  outline: none; transition: border-color 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(200,117,42,0.12);
}
.form-group select option { background: var(--bg2); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }

/* ── BUTTONS ────────────────────────────── */
.btn-admin-primary {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--amber); color: #fff; border: none;
  padding: 0.65rem 1.25rem; border-radius: 8px;
  font-family: var(--font-sans); font-size: 0.875rem; font-weight: 600;
  cursor: pointer; transition: background 0.2s, transform 0.15s;
}
.btn-admin-primary:hover { background: var(--amber-l); transform: translateY(-1px); }

.btn-admin-ghost {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: transparent; color: var(--text-dim);
  border: 1px solid var(--border); padding: 0.6rem 1.1rem;
  border-radius: 8px; font-family: var(--font-sans);
  font-size: 0.875rem; font-weight: 500; cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.btn-admin-ghost:hover { background: rgba(255,255,255,0.06); color: var(--text); }

.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 6px;
  background: rgba(255,255,255,0.05); border: 1px solid var(--border);
  color: var(--text-dim); cursor: pointer; font-size: 0.9rem;
  transition: background 0.2s, color 0.2s; font-family: var(--font-sans);
}
.btn-icon:hover { background: rgba(255,255,255,0.1); color: var(--text); }
.btn-icon.danger:hover { background: rgba(239,83,80,0.15); color: #EF5350; border-color: rgba(239,83,80,0.3); }

.w-full { width: 100%; justify-content: center; }

/* ── ALERTS ─────────────────────────────── */
.alert {
  padding: 0.75rem 1rem; border-radius: 8px;
  font-size: 0.85rem; margin-bottom: 1rem;
}
.alert-success { background: rgba(76,175,80,0.12);  color: #81C784; border: 1px solid rgba(76,175,80,0.25); }
.alert-error   { background: rgba(239,83,80,0.12);  color: #EF9A9A; border: 1px solid rgba(239,83,80,0.25); }
.alert-info    { background: rgba(200,117,42,0.12); color: var(--amber-l); border: 1px solid rgba(200,117,42,0.25); }

/* ── UPLOAD ZONE ─────────────────────────  */
.drop-zone {
  border: 2px dashed rgba(200,117,42,0.35);
  border-radius: var(--radius);
  padding: 2.5rem;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.drop-zone:hover, .drop-zone.drag-over {
  background: var(--amber-dim);
  border-color: var(--amber);
}
.drop-zone-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.drop-zone p { color: var(--text-dim); font-size: 0.85rem; }
.drop-zone strong { color: var(--amber-l); }

/* ── PHOTO GRID ─────────────────────────── */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.85rem;
}
.photo-item {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px; overflow: hidden;
  position: relative;
}
.photo-thumb {
  width: 100%; aspect-ratio: 1;
  object-fit: cover; display: block;
}
.photo-thumb-placeholder {
  width: 100%; aspect-ratio: 1;
  background: var(--bg3);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; color: var(--text-muted);
}
.photo-actions {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.5rem 0.6rem;
  background: var(--bg2);
}
.photo-name { font-size: 0.7rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.photo-btns { display: flex; gap: 4px; flex-shrink: 0; }

/* ── PROGRESS BAR ────────────────────────  */
.progress-bar-wrap {
  background: var(--bg3); border-radius: 50px; height: 6px;
  overflow: hidden; margin-top: 0.75rem; display: none;
}
.progress-bar-wrap.visible { display: block; }
.progress-bar {
  height: 100%; background: var(--amber);
  border-radius: 50px; width: 0%;
  transition: width 0.2s ease;
}

/* ── MENU EDITOR ─────────────────────────  */
.menu-cat-block {
  border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 1rem; overflow: hidden;
}
.menu-cat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.85rem 1.1rem;
  background: var(--bg3); cursor: pointer;
}
.menu-cat-name { font-weight: 600; font-size: 0.92rem; display: flex; align-items: center; gap: 0.5rem; }
.menu-cat-body { padding: 0.75rem; display: none; }
.menu-cat-body.open { display: block; }
.menu-item-row {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.6rem 0.75rem; border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg2); margin-bottom: 0.5rem;
}
.item-name-col { flex: 1; min-width: 0; }
.item-name-col strong { font-size: 0.88rem; color: var(--text); display: block; }
.item-name-col span  { font-size: 0.75rem; color: var(--text-dim); }
.item-price-col { font-family: var(--font-serif); color: var(--amber-l); font-size: 0.95rem; white-space: nowrap; }

/* ── MODAL ───────────────────────────────  */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 1.5rem;
}
.modal-overlay.hidden { display: none; }
.modal-box {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 14px; padding: 1.75rem;
  width: 100%; max-width: 520px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.modal-title { font-family: var(--font-serif); font-size: 1.25rem; margin-bottom: 1.25rem; }
.modal-footer { display: flex; gap: 0.5rem; justify-content: flex-end; margin-top: 1.25rem; }

/* ── QR SECTION ──────────────────────────  */
.qr-preview-box {
  background: #fff; padding: 1.5rem;
  border-radius: var(--radius);
  display: inline-flex; flex-direction: column; align-items: center;
  gap: 0.75rem; min-width: 200px;
}
.qr-preview-box .qr-label {
  font-size: 0.75rem; font-weight: 600;
  color: #1C0E05; letter-spacing: 0.06em; text-transform: uppercase;
}

/* ── MISC UTILS ──────────────────────────  */
.text-dim   { color: var(--text-dim); }
.text-muted { color: var(--text-muted); }
.text-amber { color: var(--amber-l); }
.text-green { color: var(--green); }
.text-red   { color: var(--red); }
.text-sm    { font-size: 0.8rem; }
.flex       { display: flex; }
.gap-2      { gap: 0.5rem; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.mt-1 { margin-top: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.empty-state { text-align: center; padding: 3rem; color: var(--text-muted); }
.empty-state-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.empty-state p { font-size: 0.9rem; }

/* ── RESPONSIVE ──────────────────────────  */
@media (max-width: 768px) {
  .sidebar { position: fixed; left: -230px; z-index: 200; transition: left 0.3s ease; height: 100%; }
  .sidebar.open { left: 0; }
  .topbar { padding: 0.85rem 1rem; }
  .topbar-title { font-size: 1.05rem; }
  .page-body { padding: 1rem; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .card-header { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .drop-zone { padding: 1.5rem 1rem; }
  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .lic-banner { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .lic-counter { align-self: flex-end; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  table { font-size: 0.78rem; }
  th, td { padding: 0.55rem 0.6rem; }
  .topbar-sub { display: none; }
  .photo-grid { grid-template-columns: 1fr 1fr; }
}

/* ── CONTACTOS ───────────────────────────  */
.row-unread td { background: rgba(200,117,42,0.06); }
.row-unread td:first-child { border-left: 3px solid var(--amber); }
.badge-new {
  display: inline-block;
  background: var(--amber);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 99px;
  margin-left: 0.5rem;
}

/* ── LICENSE BANNER ──────────────────────  */
.lic-banner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  border: 1px solid;
  margin-bottom: 1.75rem;
  gap: 1rem;
}
.lic-ok      { background: rgba(34,197,94,0.08);  border-color: rgba(34,197,94,0.25);  }
.lic-warning { background: rgba(234,179,8,0.08);  border-color: rgba(234,179,8,0.35);  }
.lic-danger  { background: rgba(239,68,68,0.1);   border-color: rgba(239,68,68,0.4);   }

.lic-info { display: flex; align-items: center; gap: 0.75rem; }
.lic-icon { font-size: 1.4rem; }
.lic-title { font-weight: 600; font-size: 0.95rem; color: var(--text); }
.lic-sub   { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.1rem; }

.lic-counter { text-align: center; min-width: 56px; }
.lic-days {
  display: block;
  font-family: var(--font-serif);
  font-size: 2rem; font-weight: 700; line-height: 1;
  color: var(--amber-l);
}
.lic-ok .lic-days    { color: #4ade80; }
.lic-warning .lic-days { color: #facc15; }
.lic-danger .lic-days  { color: #f87171; }
.lic-label { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
