/* ═══════════════════════════════════════════════════════════
   CHICKS & CHIPS — ADMIN STYLESHEET
   ═══════════════════════════════════════════════════════════ */

/* ═══ 1. TOKENS ═══ */
:root {
  --y: #ffb800;
  --y-2: #ffcf40;
  --r: #e63946;
  --g: #2a9d4a;
  --b: #3b82f6;
  --ink: #17172a;
  --ink-2: #2a2a44;
  --bg: #f5f5f7;
  --panel: #ffffff;
  --panel-2: #fafafa;
  --panel-3: #f0f0f4;
  --mut: #6a6a7a;
  --line: #e4e4e8;
  --line-2: #d0d0d8;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06);
  --shadow: 0 8px 24px -12px rgba(0,0,0,.15);
  --shadow-lg: 0 20px 50px -20px rgba(0,0,0,.25);
  --shadow-xl: 0 30px 70px -25px rgba(0,0,0,.35);
  --radius: 14px;
  --radius-lg: 20px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0f18;
    --panel: #1a1a26;
    --panel-2: #232333;
    --panel-3: #2d2d40;
    --ink: #f0ede2;
    --mut: #a0a0b0;
    --line: #2d2d40;
    --line-2: #3a3a52;
  }
}

/* ═══ 2. RESET ═══ */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Bricolage Grotesque", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
button { cursor: pointer; background: none; border: none; font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; }

/* ═══ 3. LOGIN ═══ */
.admin-login {
  max-width: 400px;
  margin: 100px auto;
  background: var(--panel);
  padding: 40px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.admin-login h1 {
  font-family: "Bebas Neue", sans-serif;
  font-size: 2rem;
  letter-spacing: 1px;
  margin-bottom: 6px;
}
.admin-login p { color: var(--mut); margin-bottom: 24px; font-size: .9rem; }
.admin-login .field { margin-bottom: 16px; }
.admin-login .field label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: 6px; }
.admin-login .field input {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 2px solid var(--line);
  background: var(--panel-2);
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.admin-login .field input:focus {
  outline: none;
  border-color: var(--y);
  box-shadow: 0 0 0 4px rgba(255,184,0,.15);
}

/* ═══ 4. SHELL ═══ */
.admin-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
  min-height: 100dvh;
}
.admin-side {
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.admin-logo {
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.5rem;
  letter-spacing: 1px;
  padding: 0 8px 20px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.admin-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.admin-nav a,
.admin-nav button {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  font-weight: 600;
  font-size: .92rem;
  color: var(--mut);
  transition: all .15s;
  text-align: left;
  width: 100%;
}
.admin-nav a:hover,
.admin-nav button:hover { background: var(--panel-2); color: var(--ink); }
.admin-nav a.on,
.admin-nav button.on { background: var(--ink); color: var(--bg); }
.admin-nav .ico { font-size: 1.1rem; width: 20px; text-align: center; }
.admin-side-foot { padding-top: 12px; border-top: 1px solid var(--line); }
.admin-main {
  padding: 32px 40px 80px;
  overflow-x: hidden;
  min-width: 0;
}
.admin-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  gap: 16px;
  flex-wrap: wrap;
}
.admin-head h1 { font-size: 1.9rem; }
.admin-head .who { color: var(--mut); font-size: .85rem; }

/* ═══ 5. STATS GRID ═══ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.stat-box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: transform .15s, box-shadow .15s;
}
.stat-box:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.stat-box .lbl {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--mut);
  font-weight: 700;
}
.stat-box .val {
  font-family: "Bebas Neue", sans-serif;
  font-size: 2rem;
  letter-spacing: 1px;
  margin-top: 4px;
  line-height: 1;
}
.stat-box .sub { font-size: .78rem; color: var(--mut); margin-top: 4px; }
.stat-box .sub.positive { color: var(--g); font-weight: 700; }
.stat-box .sub.negative { color: var(--r); font-weight: 700; }

.stat-box.urgent {
  border-color: var(--y);
  background: linear-gradient(135deg, rgba(255,184,0,.08) 0%, transparent 100%);
  box-shadow: 0 0 0 3px rgba(255,184,0,.15);
  animation: urgent-pulse 2s infinite;
}
.stat-box.urgent .val { color: var(--r); }
@keyframes urgent-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(255,184,0,.15); }
  50%      { box-shadow: 0 0 0 8px rgba(255,184,0,0); }
}

/* ═══ 6. ORDERS ═══ */
.orders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}
.order-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color .15s, box-shadow .15s;
}
.order-card:hover { box-shadow: var(--shadow); }
.order-card.new { border-color: var(--y); box-shadow: 0 0 0 3px rgba(255,184,0,.15); }
.order-card.delivering { border-color: var(--b); }
.order-card.done { opacity: .65; }
.order-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.order-id {
  font-family: "Bebas Neue", sans-serif;
  letter-spacing: 1px;
  font-size: 1.1rem;
}
.order-total { font-weight: 800; font-size: 1.1rem; }
.order-customer { font-size: .9rem; color: var(--mut); }
.order-foot { display: flex; gap: 8px; flex-wrap: wrap; }

.order-items-list {
  background: var(--panel-2);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: .85rem;
}
.order-item-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.order-item-line span:first-child { color: var(--ink); }
.order-item-line span:last-child { color: var(--mut); font-weight: 600; }

.order-notes {
  background: #fff9e6;
  border-left: 3px solid var(--y);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: .82rem;
  color: #665400;
  font-style: italic;
}
@media (prefers-color-scheme: dark) {
  .order-notes { background: #3a3320; color: #ffcf40; }
}

.call-btn {
  display: inline-block;
  background: var(--y);
  color: var(--ink);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 700;
  text-decoration: none;
  margin-left: 6px;
  transition: background .15s;
}
.call-btn:hover { background: var(--y-2); }

.status-tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .5px;
  white-space: nowrap;
}
.status-tag.pending    { background: var(--y); color: var(--ink); }
.status-tag.accepted   { background: var(--b); color: #fff; }
.status-tag.paid       { background: #10b981; color: #fff; }
.status-tag.delivering { background: #8b5cf6; color: #fff; }
.status-tag.delivered  { background: var(--g); color: #fff; }
.status-tag.cancelled  { background: var(--r); color: #fff; }

.order-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 2px solid var(--line);
  background: var(--panel);
  font-weight: 600;
  font-size: .85rem;
  color: var(--ink);
  transition: all .15s;
}
.filter-pill:hover { border-color: var(--ink); }
.filter-pill.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.filter-pill .count {
  background: rgba(0,0,0,.1);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 800;
  min-width: 22px;
  text-align: center;
}
.filter-pill.on .count { background: rgba(255,255,255,.2); }

/* ═══ 7. BUTTONS ═══ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 700;
  font-size: .85rem;
  transition: all .15s;
  border: 2px solid transparent;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-dark    { background: var(--ink); color: var(--bg); }
.btn-red     { background: var(--r); color: #fff; }
.btn-green   { background: var(--g); color: #fff; }
.btn-yellow  { background: var(--y); color: var(--ink); }
.btn-blue    { background: var(--b); color: #fff; }
.btn-outline { border-color: var(--line); color: var(--ink); background: transparent; }
.btn-outline:hover { border-color: var(--ink); background: var(--panel-2); }
.btn-sm { padding: 7px 14px; font-size: .78rem; }
.btn-full { width: 100%; }

/* ═══ 8. MAP ═══ */
.map-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 24px;
}
.map-panel h3 { margin-bottom: 12px; }
#adminMap {
  width: 100%;
  height: 420px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--panel-2);
}
.map-legend {
  display: flex;
  gap: 20px;
  margin-top: 12px;
  font-size: .85rem;
  flex-wrap: wrap;
}
.map-legend span { display: flex; align-items: center; gap: 6px; }
.map-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.map-dot.hub { background: var(--y); }
.map-dot.customer { background: var(--r); }
.map-dot.rider { background: var(--g); }

.route-panel {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.route-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: .9rem;
}
.route-row .muted {
  color: var(--mut);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  font-weight: 700;
}

/* ═══ 9. MENU ═══ */
.menu-admin-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.menu-admin-head h3 { font-size: 1.3rem; }

.menu-cat-group { margin-bottom: 32px; }
.menu-cat-title {
  font-family: "Bebas Neue", sans-serif;
  letter-spacing: 1px;
  font-size: 1.2rem;
  padding: 8px 0;
  border-bottom: 2px solid var(--line);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.menu-cat-title .count {
  background: var(--ink);
  color: var(--bg);
  padding: 2px 10px;
  border-radius: 999px;
  font-size: .75rem;
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
}

.menu-item-list { display: flex; flex-direction: column; gap: 8px; }
.menu-item-row {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 14px 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: all .15s;
}
.menu-item-row:hover {
  border-color: var(--y);
  box-shadow: var(--shadow-sm);
}

.menu-item-thumb {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--panel-2), var(--panel-3));
  display: grid;
  place-items: center;
  font-size: 2rem;
  flex-shrink: 0;
}
.menu-item-thumb img { width: 100%; height: 100%; object-fit: cover; }

.menu-item-body { min-width: 0; }
.menu-item-name {
  font-weight: 700;
  font-size: 1.02rem;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.menu-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: .84rem;
}
.price-tag { font-weight: 800; color: var(--ink); }
.old-price { color: var(--mut); text-decoration: line-through; }
.save-badge {
  background: rgba(230,57,70,.12);
  color: var(--r);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
}
.badge-chip {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.badge-chip.sale { background: var(--r); color: #fff; }
.badge-chip.new  { background: var(--ink); color: var(--bg); }
.badge-chip.hot  { background: #ff6b00; color: #fff; }
.stock-chip {
  background: rgba(42,157,74,.12);
  color: var(--g);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
}
.stock-chip.low { background: rgba(230,57,70,.12); color: var(--r); }
.inactive-chip {
  background: rgba(0,0,0,.08);
  color: var(--mut);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
}
@media (prefers-color-scheme: dark) {
  .inactive-chip { background: rgba(255,255,255,.1); }
}
.menu-item-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ═══ 10. OFFERS ═══ */
.admin-table {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  border-collapse: collapse;
}
.admin-table th,
.admin-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: .9rem;
}
.admin-table th {
  background: var(--panel-2);
  font-weight: 700;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--mut);
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; }
.admin-table input {
  width: 100%;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--ink);
  font-size: .88rem;
}

/* ═══ 11. ANALYTICS ═══ */
.insights-card {
  background: linear-gradient(135deg, rgba(255,184,0,.1) 0%, rgba(255,184,0,.02) 100%);
  border: 1px solid rgba(255,184,0,.3);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
}
.insights-card h3 { font-size: 1.05rem; margin-bottom: 12px; }
.insights-card ul {
  display: flex;
  flex-direction: column;
  gap: 8px;
  list-style: none;
}
.insights-card li {
  font-size: .92rem;
  color: var(--ink);
  line-height: 1.5;
  padding-left: 4px;
}
.insights-card li b { color: var(--ink); }

.analytics-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.analytics-card h3 {
  font-size: 1rem;
  margin-bottom: 14px;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.card-head h3 { margin: 0; font-size: 1.05rem; }

.range-tabs {
  display: inline-flex;
  background: var(--panel-2);
  border-radius: 999px;
  padding: 3px;
  border: 1px solid var(--line);
}
.range-tab {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--mut);
  transition: all .15s;
}
.range-tab:hover { color: var(--ink); }
.range-tab.on {
  background: var(--ink);
  color: var(--bg);
}

.chart-wrap {
  position: relative;
  width: 100%;
}

.analytics-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}

.items-list { display: flex; flex-direction: column; gap: 10px; }
.item-row {
  display: grid;
  grid-template-columns: 24px 1fr 80px 44px 90px;
  gap: 10px;
  align-items: center;
  font-size: .88rem;
}
.item-rank { font-weight: 800; color: var(--mut); font-size: .8rem; }
.item-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
}
.item-bar-wrap {
  height: 6px;
  border-radius: 3px;
  background: var(--panel-2);
  overflow: hidden;
}
.item-bar {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--y) 0%, #e6a600 100%);
  transition: width .4s ease;
}
.item-count { font-weight: 800; color: var(--ink); text-align: right; }
.item-rev {
  font-size: .78rem;
  color: var(--mut);
  font-weight: 600;
  text-align: right;
}

.areas-list { display: flex; flex-direction: column; gap: 12px; }
.area-row {
  display: grid;
  grid-template-columns: 26px 1fr 80px 34px;
  gap: 10px;
  align-items: center;
  font-size: .9rem;
}
.area-rank { font-weight: 800; color: var(--mut); font-size: .82rem; }
.area-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.area-bar-wrap {
  height: 8px;
  border-radius: 4px;
  background: var(--panel-2);
  overflow: hidden;
}
.area-bar {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--r) 0%, #b91c1c 100%);
  transition: width .4s ease;
}
.area-count { font-weight: 800; color: var(--ink); text-align: right; font-size: .85rem; }

.analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
.analytics-list { display: flex; flex-direction: column; gap: 10px; }
.analytics-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--panel-2);
  font-size: .88rem;
}
.analytics-list li b { color: var(--ink); text-align: right; }

/* ═══ 12. SETTINGS ═══ */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.settings-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.settings-card h3 { font-size: 1rem; margin-bottom: 16px; }
.settings-card .field { margin-bottom: 12px; }
.settings-card label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--mut);
}
.settings-card input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--ink);
}
.settings-card input:focus {
  outline: none;
  border-color: var(--y);
  box-shadow: 0 0 0 3px rgba(255,184,0,.15);
}

/* ═══ 13. MODALS ═══ */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  place-items: center;
  padding: 20px;
  z-index: 500;
  opacity: 0;
  transition: opacity .25s;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal.on { display: grid; opacity: 1; }
.modal-card {
  background: var(--panel);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 28px;
  box-shadow: var(--shadow-xl);
  transform: translateY(20px) scale(0.98);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
}
.modal.on .modal-card { transform: translateY(0) scale(1); }
.modal-card h2 { font-size: 1.4rem; margin-bottom: 6px; }
.modal-card .sub { color: var(--mut); margin-bottom: 22px; font-size: .9rem; }

.modal .field { margin-bottom: 14px; }
.modal .field label {
  display: block;
  font-weight: 600;
  font-size: .85rem;
  margin-bottom: 6px;
  color: var(--ink);
}
.modal .field input,
.modal .field select,
.modal .field textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 2px solid var(--line);
  background: var(--panel-2);
  color: var(--ink);
  font-size: .95rem;
  transition: border-color .15s, box-shadow .15s;
}
.modal .field input:focus,
.modal .field select:focus,
.modal .field textarea:focus {
  outline: none;
  border-color: var(--y);
  box-shadow: 0 0 0 4px rgba(255,184,0,.15);
}
.modal .field textarea {
  resize: vertical;
  min-height: 80px;
}
.modal .field input[type="checkbox"] {
  width: auto;
  min-height: 0;
  margin-right: 6px;
  vertical-align: middle;
}
.modal .field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.image-picker {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(135deg, #f9f3e2, #efe4c8);
  display: grid;
  place-items: center;
  cursor: pointer;
  border: 2px dashed var(--line);
  transition: border-color .15s, background .15s;
  margin-bottom: 8px;
}
.image-picker:hover {
  border-color: var(--y);
  background: linear-gradient(135deg, #fff7e0, #f5e6c0);
}
.image-picker img { width: 100%; height: 100%; object-fit: cover; }
.image-placeholder {
  text-align: center;
  color: var(--mut);
  font-size: 2.4rem;
  font-weight: 600;
  line-height: 1.3;
  user-select: none;
}
.image-placeholder span {
  display: block;
  font-size: .85rem;
  margin-top: 10px;
  color: var(--mut);
  font-weight: 600;
}

.auth-error {
  padding: 10px 14px;
  background: rgba(230, 57, 70, 0.1);
  border-left: 4px solid var(--r);
  border-radius: 8px;
  color: var(--r);
  font-size: .88rem;
  line-height: 1.4;
  white-space: pre-line;
}

/* ═══ 14. LOADING + TOAST ═══ */
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(42, 157, 74, .12);
  color: var(--g);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.live-pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--g);
  animation: live-pulse 2s infinite;
}
@keyframes live-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(42, 157, 74, .7); }
  70%  { box-shadow: 0 0 0 8px rgba(42, 157, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(42, 157, 74, 0); }
}

.live-toast {
  position: fixed;
  bottom: 24px;
  left: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 18px 12px 14px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: .9rem;
  max-width: 340px;
  z-index: 900;
  transform: translateY(140%);
  transition: transform .4s cubic-bezier(.4, 0, .2, 1);
}
.live-toast.on { transform: translateY(0); }
.live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--g);
  animation: live-pulse 2s infinite;
  flex-shrink: 0;
}

#globalLoading {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  place-items: center;
  z-index: 800;
  backdrop-filter: blur(4px);
}
#globalLoading.on { display: grid; }
#globalLoading > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  color: #fff;
  background: var(--ink);
  padding: 28px 40px;
  border-radius: 20px;
  box-shadow: var(--shadow-xl);
  text-align: center;
  min-width: 200px;
}
#globalLoading p { font-weight: 600; font-size: .95rem; margin: 0; }
.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255, 255, 255, .15);
  border-top-color: var(--y);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 20px;
  gap: 14px;
  color: var(--mut);
}
.loading-block .spinner {
  border-color: rgba(0, 0, 0, .08);
  border-top-color: var(--y);
}

.muted { color: var(--mut); }
.small { font-size: .78rem !important; }

/* ═══ 15. RESPONSIVE ═══ */
@media (max-width: 900px) {
  .admin-shell { grid-template-columns: 1fr; }

  .admin-side {
    position: static;
    height: auto;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 12px;
    gap: 6px;
    border-right: none;
    border-bottom: 1px solid var(--line);
    scrollbar-width: none;
  }
  .admin-side::-webkit-scrollbar { display: none; }

  .admin-logo { display: none; }
  .admin-nav { flex-direction: row; gap: 6px; flex: unset; }
  .admin-nav a,
  .admin-nav button {
    padding: 10px 16px;
    white-space: nowrap;
    width: auto;
    border-radius: 999px;
  }
  .admin-nav .ico { display: none; }
  .admin-side-foot {
    display: flex;
    align-items: center;
    padding: 0;
    border-top: none;
    margin-left: auto;
  }
  .admin-side-foot > div:first-child { display: none; }
  .admin-side-foot .btn { white-space: nowrap; padding: 8px 14px; font-size: .78rem; }

  .admin-main { padding: 20px; }

  .analytics-grid,
  .analytics-grid-2col,
  .settings-grid { grid-template-columns: 1fr; }

  .menu-admin-head { flex-direction: column; align-items: stretch; }
  .menu-admin-head .btn { width: 100%; }

  .orders-grid { grid-template-columns: 1fr; }

  #adminMap { height: 320px; }
}

@media (max-width: 640px) {
  .admin-login { margin: 40px 16px; padding: 28px 22px; }

  .admin-main { padding: 16px 14px 60px; }
  .admin-head h1 { font-size: 1.5rem; }
  .admin-head .who { font-size: .78rem; }

  .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat-box { padding: 16px; }
  .stat-box .val { font-size: 1.5rem; }
  .stat-box .lbl { font-size: .7rem; }

  .order-card { padding: 16px; }

  .menu-item-row {
    grid-template-columns: 60px 1fr;
    gap: 12px;
    padding: 12px;
  }
  .menu-item-thumb { width: 60px; height: 60px; font-size: 1.6rem; }
  .menu-item-actions {
    grid-column: 1 / -1;
    margin-top: 10px;
    width: 100%;
  }
  .menu-item-actions .btn { flex: 1; }

  .modal-card { padding: 22px 18px; border-radius: 16px; }
  .modal .field-row { grid-template-columns: 1fr; }

  .analytics-list li { font-size: .82rem; }

  .live-toast {
    left: 12px;
    right: 12px;
    bottom: 12px;
    max-width: none;
  }

  .filter-pill { padding: 8px 14px; font-size: .78rem; }

  .card-head { flex-direction: column; align-items: stretch; }
  .range-tabs { width: 100%; overflow-x: auto; }
  .range-tab { flex: 1; text-align: center; }

  .item-row { grid-template-columns: 20px 1fr 60px 40px; gap: 8px; font-size: .8rem; }
  .item-rev { display: none; }
  .area-row { grid-template-columns: 22px 1fr 60px 30px; font-size: .82rem; }
  .insights-card li { font-size: .85rem; }
}

@media (max-width: 400px) {
  .stats-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

@media (hover: none) and (pointer: coarse) {
  .btn { min-height: 42px; }
  .btn-sm { min-height: 36px; }
  .filter-pill { min-height: 42px; }
  .admin-nav button { min-height: 42px; }
  .menu-item-actions .btn { min-height: 40px; }
}