/* ============================================================
   ARENA PIZZA KEBAB — Admin Dashboard CSS
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Nunito:wght@400;600;700;800;900&display=swap');

:root {
  --red:    #D42B2B;
  --red-dk: #A81F1F;
  --gold:   #F5A623;
  --dark:   #0A0A0A;
  --dark2:  #111111;
  --dark3:  #1A1A1A;
  --dark4:  #222222;
  --dark5:  #2C2C2C;
  --white:  #FFFFFF;
  --gray:   #888;
  --gray2:  #555;
  --green:  #22c55e;
  --blue:   #3b82f6;
  --orange: #f97316;
  --purple: #a855f7;
  --radius: 12px;
  --sidebar-w: 240px;
  --font-h: 'Bebas Neue', sans-serif;
  --font-b: 'Nunito', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body { background: var(--dark); color: var(--white); font-family: var(--font-b); -webkit-font-smoothing: antialiased; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--dark2); }
::-webkit-scrollbar-thumb { background: var(--dark5); border-radius: 3px; }

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

/* ─── Sidebar ────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--dark2);
  border-right: 1px solid rgba(255,255,255,.06);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 100;
  transition: transform .3s;
}
.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.sidebar-logo-name {
  font-family: var(--font-h);
  font-size: 1.1rem;
  letter-spacing: 1.5px;
  line-height: 1.1;
}
.sidebar-logo-name span { color: var(--red); }
.sidebar-logo-sub { font-size: .72rem; color: var(--gray); font-weight: 700; letter-spacing: 1px; text-transform: uppercase; margin-top: 2px; }

.sidebar-nav { flex: 1; padding: 16px 10px; overflow-y: auto; }
.nav-section-title { font-size: .68rem; font-weight: 900; letter-spacing: 2px; text-transform: uppercase; color: var(--gray2); padding: 12px 10px 6px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 9px;
  font-weight: 700;
  font-size: .88rem;
  color: var(--gray);
  transition: background .15s, color .15s;
  margin-bottom: 2px;
  position: relative;
}
.nav-item:hover { background: var(--dark3); color: var(--white); }
.nav-item.active { background: rgba(212,43,43,.15); color: var(--white); }
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 3px;
  background: var(--red);
  border-radius: 0 3px 3px 0;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 2; }
.nav-badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: .68rem;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 20px;
  min-width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--red);
  display: flex; align-items: center; justify-content: center;
  font-weight: 900;
  font-size: .9rem;
  flex-shrink: 0;
}
.sidebar-user-name { font-weight: 800; font-size: .85rem; }
.sidebar-user-role { font-size: .72rem; color: var(--gray); }
.btn-logout {
  margin-left: auto;
  color: var(--gray);
  transition: color .2s;
  padding: 4px;
}
.btn-logout:hover { color: var(--red); }
.btn-logout svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }

/* ─── Main Content ────────────────────────────────────────── */
.admin-main {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ─── Top Bar ─────────────────────────────────────────────── */
.topbar {
  height: 62px;
  background: var(--dark2);
  border-bottom: 1px solid rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-title { font-family: var(--font-h); font-size: 1.4rem; letter-spacing: 1.5px; flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.topbar-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 800;
  font-size: .82rem;
  background: var(--dark3);
  color: var(--gray);
  border: 1px solid rgba(255,255,255,.07);
  transition: all .2s;
}
.topbar-btn:hover { background: var(--dark4); color: #fff; }
.topbar-btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; }
.topbar-btn.primary { background: var(--red); color: #fff; border-color: var(--red); }
.topbar-btn.primary:hover { background: var(--red-dk); }
.live-dot {
  width: 8px; height: 8px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse 2s infinite;
  flex-shrink: 0;
}
@keyframes pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50% { opacity: .5; transform: scale(.8); }
}

/* ─── Page Content ────────────────────────────────────────── */
.page-content { padding: 24px; flex: 1; }

/* ─── Stats Row ───────────────────────────────────────────── */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
.stat-card {
  background: var(--dark2);
  border-radius: var(--radius);
  padding: 18px 20px;
  border: 1px solid rgba(255,255,255,.06);
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.stat-card.red::before   { background: var(--red); }
.stat-card.gold::before  { background: var(--gold); }
.stat-card.green::before { background: var(--green); }
.stat-card.blue::before  { background: var(--blue); }
.stat-label { font-size: .75rem; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--gray); }
.stat-value { font-family: var(--font-h); font-size: 2.2rem; letter-spacing: 1px; }
.stat-sub { font-size: .78rem; color: var(--gray); font-weight: 600; }

/* ─── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--dark2);
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,.06);
  overflow: hidden;
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-title { font-weight: 900; font-size: .95rem; }
.card-body { padding: 0; }

/* ─── Grid ────────────────────────────────────────────────── */
.two-col { display: grid; grid-template-columns: 1fr 360px; gap: 20px; }

/* ─── Orders Table / List ─────────────────────────────────── */
.orders-list {}
.order-row {
  display: grid;
  grid-template-columns: 80px 1fr 110px 120px 110px 100px;
  gap: 12px;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255,255,255,.05);
  transition: background .15s;
  cursor: pointer;
}
.order-row:hover { background: rgba(255,255,255,.02); }
.order-row:last-child { border-bottom: none; }
.order-row.new { background: rgba(212,43,43,.05); }
.order-id { font-family: var(--font-h); font-size: 1rem; color: var(--gold); letter-spacing: 1px; }
.order-client { font-weight: 800; font-size: .88rem; }
.order-client-phone { font-size: .75rem; color: var(--gray); font-weight: 600; }
.order-total { font-weight: 900; color: var(--gold); }
.order-mode {
  font-size: .75rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 20px;
  text-align: center;
}
.mode-delivery { background: rgba(59,130,246,.15); color: #60a5fa; }
.mode-pickup   { background: rgba(168,85,247,.15); color: #c084fc; }
.order-time { font-size: .78rem; color: var(--gray); }

/* ─── Status Badges ───────────────────────────────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .5px;
  text-transform: uppercase;
  white-space: nowrap;
}
.status-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.s-pending    { background: rgba(245,166,35,.15); color: var(--gold); }
.s-accepted   { background: rgba(59,130,246,.15); color: #60a5fa; }
.s-preparing  { background: rgba(249,115,22,.15); color: #fb923c; }
.s-ready      { background: rgba(168,85,247,.15); color: #c084fc; }
.s-delivering { background: rgba(34,197,94,.15); color: var(--green); }
.s-done       { background: rgba(255,255,255,.07); color: var(--gray); }
.s-cancelled  { background: rgba(212,43,43,.15); color: #f87171; }

/* ─── Order Detail Panel ──────────────────────────────────── */
.detail-panel {
  background: var(--dark2);
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,.06);
  position: sticky;
  top: 80px;
}
.detail-placeholder {
  padding: 60px 20px;
  text-align: center;
  color: var(--gray);
}
.detail-placeholder svg { width: 48px; height: 48px; stroke: var(--gray2); fill: none; stroke-width: 1; margin: 0 auto 12px; display: block; }
.detail-placeholder p { font-size: .85rem; }
.detail-header { padding: 16px 20px; border-bottom: 1px solid rgba(255,255,255,.06); display: flex; align-items: center; gap: 10px; }
.detail-order-id { font-family: var(--font-h); font-size: 1.4rem; color: var(--gold); }
.detail-body { padding: 16px 20px; }
.detail-section { margin-bottom: 20px; }
.detail-section-title { font-size: .72rem; font-weight: 900; letter-spacing: 1.5px; text-transform: uppercase; color: var(--gray); margin-bottom: 10px; }
.detail-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: .85rem; border-bottom: 1px solid rgba(255,255,255,.04); }
.detail-row:last-child { border-bottom: none; }
.detail-row label { color: var(--gray); font-weight: 700; }
.detail-item { padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.04); font-size: .85rem; }
.detail-item:last-child { border-bottom: none; }
.detail-item-name { font-weight: 800; }
.detail-item-opts { font-size: .75rem; color: var(--gray); margin-top: 2px; }
.detail-item-price { float: right; font-weight: 700; color: var(--gold); }
.status-select {
  width: 100%;
  padding: 10px 14px;
  background: var(--dark3);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  color: #fff;
  font-weight: 700;
  margin-bottom: 10px;
}
.status-select:focus { outline: none; border-color: var(--red); }
.status-select option { background: var(--dark3); }
.btn-update-status {
  width: 100%;
  padding: 11px;
  background: var(--red);
  color: #fff;
  border-radius: 8px;
  font-weight: 900;
  font-size: .88rem;
  transition: background .2s;
}
.btn-update-status:hover { background: var(--red-dk); }

/* ─── Filters Bar ─────────────────────────────────────────── */
.filters-bar {
  display: flex;
  gap: 8px;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255,255,255,.05);
  overflow-x: auto;
  scrollbar-width: none;
}
.filter-btn {
  flex-shrink: 0;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 800;
  background: var(--dark3);
  color: var(--gray);
  border: 1px solid transparent;
  transition: all .2s;
}
.filter-btn:hover { color: #fff; border-color: rgba(255,255,255,.15); }
.filter-btn.active { background: var(--red); color: #fff; }

/* ─── Reservations ────────────────────────────────────────── */
.res-row {
  display: grid;
  grid-template-columns: 80px 1fr 100px 130px 90px 130px;
  gap: 12px;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255,255,255,.05);
  transition: background .15s;
}
.res-row:hover { background: rgba(255,255,255,.02); }
.res-row:last-child { border-bottom: none; }
.res-id { font-family: var(--font-h); font-size: .95rem; color: var(--gray); }
.res-name { font-weight: 800; font-size: .88rem; }
.res-phone { font-size: .75rem; color: var(--gray); }
.res-actions { display: flex; gap: 6px; }
.btn-accept {
  padding: 5px 12px;
  background: rgba(34,197,94,.15);
  color: var(--green);
  border-radius: 6px;
  font-size: .75rem;
  font-weight: 900;
  transition: background .2s;
}
.btn-accept:hover { background: rgba(34,197,94,.3); }
.btn-refuse {
  padding: 5px 12px;
  background: rgba(212,43,43,.1);
  color: #f87171;
  border-radius: 6px;
  font-size: .75rem;
  font-weight: 900;
  transition: background .2s;
}
.btn-refuse:hover { background: rgba(212,43,43,.25); }

/* ─── Menu Manager ────────────────────────────────────────── */
.menu-manager-grid { display: grid; grid-template-columns: 1fr 340px; gap: 20px; }
.menu-item-row {
  display: grid;
  grid-template-columns: 60px 1fr 80px 80px 100px;
  gap: 12px;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.menu-item-row:hover { background: rgba(255,255,255,.02); }
.menu-item-thumb { width: 50px; height: 50px; object-fit: cover; border-radius: 8px; }
.menu-item-name { font-weight: 800; font-size: .88rem; }
.menu-item-cat { font-size: .73rem; color: var(--gray); font-weight: 700; margin-top: 2px; }
.menu-item-price { font-weight: 900; color: var(--gold); }
.toggle-switch { position: relative; width: 40px; height: 22px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--dark5);
  border-radius: 22px;
  transition: .2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  left: 3px; bottom: 3px;
  background: var(--gray);
  border-radius: 50%;
  transition: .2s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--green); }
.toggle-switch input:checked + .toggle-slider::before { background: #fff; transform: translateX(18px); }
.menu-row-actions { display: flex; gap: 6px; }
.btn-edit, .btn-delete {
  width: 30px; height: 30px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.btn-edit { background: rgba(59,130,246,.1); color: #60a5fa; }
.btn-edit:hover { background: rgba(59,130,246,.25); }
.btn-delete { background: rgba(212,43,43,.1); color: #f87171; }
.btn-delete:hover { background: rgba(212,43,43,.25); }
.btn-edit svg, .btn-delete svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; }

/* ─── Add/Edit Form ───────────────────────────────────────── */
.add-form {
  background: var(--dark2);
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,.06);
  padding: 20px;
  position: sticky;
  top: 80px;
}
.add-form-title { font-weight: 900; font-size: 1rem; margin-bottom: 18px; }
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: .75rem; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; color: var(--gray); margin-bottom: 6px; }
.form-control {
  width: 100%;
  padding: 10px 13px;
  background: var(--dark3);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  color: #fff;
  font-weight: 600;
  font-size: .88rem;
  transition: border-color .2s;
}
.form-control:focus { outline: none; border-color: var(--red); }
.form-control::placeholder { color: var(--gray2); }
.form-control option { background: var(--dark3); }
.btn-save {
  width: 100%;
  padding: 11px;
  background: var(--red);
  color: #fff;
  border-radius: 8px;
  font-weight: 900;
  font-size: .9rem;
  transition: background .2s;
}
.btn-save:hover { background: var(--red-dk); }
.btn-cancel {
  width: 100%;
  padding: 11px;
  background: var(--dark3);
  color: var(--gray);
  border-radius: 8px;
  font-weight: 800;
  font-size: .88rem;
  margin-top: 8px;
  transition: background .2s;
}
.btn-cancel:hover { background: var(--dark4); color: #fff; }

/* ─── Sound Notification ──────────────────────────────────── */
.sound-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  background: var(--dark3);
  color: var(--gray);
  border: 1px solid rgba(255,255,255,.07);
  font-size: .8rem;
  font-weight: 800;
  transition: all .2s;
}
.sound-btn.active { color: var(--green); border-color: rgba(34,197,94,.3); }
.sound-btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; }

/* ─── Toast ───────────────────────────────────────────────── */
.admin-toast {
  position: fixed;
  bottom: 24px; right: 24px;
  background: var(--dark3);
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  font-weight: 700;
  font-size: .88rem;
  z-index: 9999;
  border: 1px solid rgba(255,255,255,.1);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .3s, transform .3s;
  pointer-events: none;
  max-width: 320px;
}
.admin-toast.show { opacity: 1; transform: translateY(0); }
.admin-toast.success { border-color: rgba(34,197,94,.4); }
.admin-toast.error   { border-color: rgba(212,43,43,.4); }

/* ─── Login Page ──────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--dark);
  background-image: radial-gradient(ellipse at 20% 50%, rgba(212,43,43,.08) 0%, transparent 50%);
}
.login-card {
  background: var(--dark2);
  border-radius: 20px;
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  border: 1px solid rgba(255,255,255,.06);
}
.login-logo {
  text-align: center;
  margin-bottom: 36px;
}
.login-logo-name { font-family: var(--font-h); font-size: 2rem; letter-spacing: 2px; }
.login-logo-name span { color: var(--red); }
.login-logo-sub { font-size: .75rem; color: var(--gray); font-weight: 700; letter-spacing: 2px; text-transform: uppercase; margin-top: 4px; }
.login-title { font-weight: 900; font-size: 1.1rem; margin-bottom: 24px; }
.login-error { background: rgba(212,43,43,.1); border: 1px solid rgba(212,43,43,.3); color: #f87171; padding: 10px 14px; border-radius: 8px; font-size: .85rem; font-weight: 700; margin-bottom: 16px; display: none; }

/* ─── Responsive ──────────────────────────────────────────── */
@media (max-width: 1100px) {
  .stats-row { grid-template-columns: 1fr 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .menu-manager-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-240px); }
  .sidebar.open { transform: translateX(0); --sidebar-w: 240px; }
  .admin-main { margin-left: 0; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .order-row { grid-template-columns: 1fr 1fr; }
  .res-row { grid-template-columns: 1fr 1fr; }
}
