/* ==========================================================================
   Kitchen Royale — admin.css
   Same brand identity as the customer site, restructured as an operational
   back office. Mobile-first: bottom nav on small screens, sidebar on desktop.
   ========================================================================== */

.admin-body { background: var(--cream); min-height: 100vh; padding-bottom: 76px; }

.admin-topbar {
  background: var(--warm-white); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
}
.admin-topbar .brand { display: flex; align-items: center; gap: 10px; }
.admin-topbar .brand-name { font-size: 1.05rem; }
.admin-topbar .admin-tag { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--orange); font-weight: 700; }
.admin-user { display: flex; align-items: center; gap: 12px; font-size: 0.82rem; }
.admin-user button { background: none; border: 1px solid var(--border); border-radius: var(--radius-s); padding: 7px 12px; font-size: 0.78rem; font-weight: 700; }

.admin-shell { display: flex; }

.admin-sidebar { display: none; }

.admin-more-sheet {
  position: fixed; inset: 0; z-index: 200; display: none;
}
.admin-more-sheet.open { display: block; }
.admin-more-backdrop { position: absolute; inset: 0; background: rgba(25,25,22,0.45); }
.admin-more-panel {
  position: absolute; bottom: 0; left: 0; right: 0; background: var(--white);
  border-radius: 16px 16px 0 0; padding: 20px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px;
}
.admin-more-panel a { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 6px; font-size: 0.78rem; font-weight: 700; border-radius: var(--radius-s); }
.admin-more-panel a svg { width: 22px; height: 22px; color: var(--deep-green); }
.admin-more-panel a.active { background: var(--cream); }

.admin-bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 60; background: var(--white);
  border-top: 1px solid var(--border); display: flex; justify-content: space-around;
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
}
.admin-bottom-nav a, .admin-bottom-nav button {
  display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 0.66rem; font-weight: 700;
  color: var(--muted); background: none; border: none; padding: 4px 8px;
}
.admin-bottom-nav a svg, .admin-bottom-nav button svg { width: 20px; height: 20px; }
.admin-bottom-nav a.active { color: var(--orange); }

.admin-main { flex: 1; padding: 20px 16px 24px; max-width: 1180px; margin: 0 auto; width: 100%; }

.admin-page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.admin-page-head h1 { font-size: 1.5rem; }
.admin-page-head p { font-size: 0.84rem; color: var(--muted); margin-top: 2px; }

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 24px; }
.stat-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-m); padding: 16px; }
.stat-card .label { font-size: 0.72rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
.stat-card .value { font-family: var(--font-display); font-size: 1.5rem; margin-top: 6px; }
.stat-card.warn .value { color: var(--orange); }

.admin-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-m); padding: 18px; margin-bottom: 20px; }
.admin-card h3 { font-size: 1rem; margin-bottom: 14px; }

.admin-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.admin-table th { text-align: left; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--border); }
.admin-table td { padding: 12px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }

.order-card-list { display: flex; flex-direction: column; gap: 12px; }
.order-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-m); padding: 14px 16px; }
.order-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.order-card-top strong { font-family: var(--font-display); }
.order-card .meta { font-size: 0.8rem; color: var(--muted); margin-bottom: 4px; }
.order-card .footer-row { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.order-card .footer-row strong { color: var(--orange); }

.admin-filter-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 18px; }
.admin-filter-chip { flex-shrink: 0; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--white); font-size: 0.78rem; font-weight: 700; }
.admin-filter-chip.active { background: var(--charcoal); color: var(--white); border-color: var(--charcoal); }

.select-inline { border: 1px solid var(--border); border-radius: var(--radius-s); padding: 7px 10px; background: var(--cream); font-size: 0.8rem; font-weight: 600; }

.admin-empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.admin-empty svg { width: 40px; height: 40px; margin-bottom: 10px; color: var(--border); }

.icon-btn { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border); background: var(--white); display: inline-flex; align-items: center; justify-content: center; }
.icon-btn svg { width: 15px; height: 15px; }

.menu-manage-row { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); }
.menu-manage-row:last-child { border-bottom: none; }
.menu-manage-thumb { width: 52px; height: 52px; border-radius: var(--radius-s); overflow: hidden; flex-shrink: 0; }
.menu-manage-info { flex: 1; min-width: 0; }
.menu-manage-info .name { font-weight: 700; font-size: 0.92rem; }
.menu-manage-info .cat { font-size: 0.74rem; color: var(--muted); }
.menu-manage-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.toggle-switch { position: relative; width: 40px; height: 22px; border-radius: 999px; background: var(--border); flex-shrink: 0; border: none; }
.toggle-switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--white); transition: transform .15s ease; }
.toggle-switch.on { background: var(--deep-green); }
.toggle-switch.on::after { transform: translateX(18px); }

.admin-modal-overlay {
  position: fixed; inset: 0; background: rgba(25,25,22,0.5); z-index: 300;
  display: none; align-items: center; justify-content: center; padding: 16px;
}
.admin-modal-overlay.open { display: flex; }
.admin-modal-panel { background: var(--white); border-radius: var(--radius-l); padding: 24px; width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; position: relative; }

.inv-status-Good { color: var(--deep-green); font-weight: 700; }
.inv-status-Low { color: var(--orange); font-weight: 700; }
.inv-status-Out { color: #B3261E; font-weight: 700; }

@media (min-width: 900px) {
  .admin-bottom-nav { display: none; }
  .admin-body { padding-bottom: 0; }
  .admin-shell { min-height: calc(100vh - 65px); }
  .admin-sidebar {
    display: flex; flex-direction: column; width: 220px; flex-shrink: 0; background: var(--warm-white);
    border-right: 1px solid var(--border); padding: 20px 12px;
  }
  .admin-sidebar a {
    display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: var(--radius-s);
    font-size: 0.86rem; font-weight: 600; color: var(--charcoal); margin-bottom: 2px;
  }
  .admin-sidebar a svg { width: 18px; height: 18px; color: var(--olive); }
  .admin-sidebar a:hover { background: var(--cream); }
  .admin-sidebar a.active { background: var(--deep-green); color: var(--white); }
  .admin-sidebar a.active svg { color: var(--white); }
  .admin-main { padding: 28px 32px; }
  .stat-grid { grid-template-columns: repeat(5, 1fr); }
}
@media (max-width: 899px) {
  .hide-mobile { display: none; }
}
@media (min-width: 640px) {
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
}
