/* ─── Variables de color ──────────────────────────────────────────────────── */
:root {
  --primary:       #f59e0b;
  --primary-hover: #d97706;
  --bg:            #020617;
  --bg-card:       #0f172a;
  --bg-input:      #1e293b;
  --border:        #1e293b;
  --border-focus:  #f59e0b;
  --text:          #f1f5f9;
  --text-muted:    #64748b;
}

/* ─── Base ────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { font-size: 16px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  min-height: 100vh;
  margin: 0;
}

/* ─── Scrollbar personalizado ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 3px; }

/* ─── Badges de estado de pedido ──────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }

.badge-pending   { background: rgba(245,158,11,.15); color: #fbbf24; border: 1px solid rgba(245,158,11,.3); }
.badge-preparing { background: rgba(59,130,246,.15); color: #60a5fa; border: 1px solid rgba(59,130,246,.3); }
.badge-ready     { background: rgba(16,185,129,.15); color: #34d399; border: 1px solid rgba(16,185,129,.3); }
.badge-delivered { background: rgba(100,116,139,.15); color: #94a3b8; border: 1px solid rgba(100,116,139,.25); }

/* ─── Badges de plataforma ────────────────────────────────────────────────── */
.plat-caja     { background: rgba(100,116,139,.2); color: #cbd5e1; }
.plat-whatsapp { background: rgba(37,211,102,.15); color: #4ade80; }
.plat-telefono { background: rgba(59,130,246,.15); color: #60a5fa; }
.plat-ubereats { background: rgba(250,250,250,.1); color: #e2e8f0; }
.plat-didiFood { background: rgba(255,107,0,.15);  color: #fb923c; }

/* ─── Card ────────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

/* ─── Botón primario ──────────────────────────────────────────────────────── */
.btn-primary {
  background: var(--primary);
  color: #000;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  transition: background .15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-primary:hover  { background: var(--primary-hover); }
.btn-primary:active { transform: scale(.97); }

/* ─── Botón secundario ────────────────────────────────────────────────────── */
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 0.875rem;
  transition: all .15s;
}
.btn-ghost:hover { background: var(--bg-input); color: var(--text); }

/* ─── Botón de peligro ────────────────────────────────────────────────────── */
.btn-danger {
  background: rgba(239,68,68,.15);
  color: #f87171;
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid rgba(239,68,68,.25);
  cursor: pointer;
  font-size: 0.875rem;
  transition: background .15s;
}
.btn-danger:hover { background: rgba(239,68,68,.25); }

/* ─── Input / Select ──────────────────────────────────────────────────────── */
.input, .select {
  width: 100%;
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color .15s;
}
.input::placeholder { color: var(--text-muted); }
.input:focus, .select:focus { border-color: var(--border-focus); }
.select option { background: #1e293b; }

/* ─── Label de formulario ─────────────────────────────────────────────────── */
.label { display: block; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 5px; font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }

/* ─── Toggle / Switch ─────────────────────────────────────────────────────── */
.toggle { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: #334155;
  border-radius: 999px;
  cursor: pointer;
  transition: background .2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  left: 3px; top: 3px;
  background: white;
  border-radius: 50%;
  transition: transform .2s;
}
.toggle input:checked + .toggle-slider { background: var(--primary); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ─── Navbar ──────────────────────────────────────────────────────────────── */
.navbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(2,6,23,.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: 56px;
  display: flex; align-items: center;
  padding: 0 20px;
  gap: 8px;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 7px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all .15s;
  white-space: nowrap;
}
.nav-link:hover  { background: var(--bg-input); color: var(--text); }
.nav-link.active { background: rgba(245,158,11,.15); color: var(--primary); }

/* ─── Toast ───────────────────────────────────────────────────────────────── */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 0.875rem;
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
  pointer-events: all;
  animation: slideIn .2s ease;
  max-width: 340px;
}
.toast.success { border-color: rgba(16,185,129,.4); }
.toast.error   { border-color: rgba(239,68,68,.4); }
.toast.info    { border-color: rgba(59,130,246,.4); }

@keyframes slideIn {
  from { transform: translateX(40px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ─── Modal / Drawer ──────────────────────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(4px);
  display: flex; align-items: flex-end;
  justify-content: center;
}
.overlay.center { align-items: center; }

.drawer {
  background: var(--bg-card);
  border-radius: 16px 16px 0 0;
  border-top: 1px solid var(--border);
  width: 100%; max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 20px;
  animation: slideUp .2s ease;
}
.drawer.modal {
  border-radius: 16px;
  width: calc(100% - 32px);
  max-height: 85vh;
}

@keyframes slideUp {
  from { transform: translateY(30px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ─── Indicador online/offline ────────────────────────────────────────────── */
.offline-banner {
  background: rgba(245,158,11,.15);
  color: #fbbf24;
  border-bottom: 1px solid rgba(245,158,11,.25);
  text-align: center;
  padding: 6px;
  font-size: 0.8rem;
  font-weight: 600;
}

/* ─── Status dot ──────────────────────────────────────────────────────────── */
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-online  { background: #34d399; box-shadow: 0 0 6px #34d399; }
.dot-offline { background: #f59e0b; }

/* ─── Spinner ─────────────────────────────────────────────────────────────── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid #334155;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Tabla admin ─────────────────────────────────────────────────────────── */
.table-admin { width: 100%; border-collapse: collapse; }
.table-admin th { color: var(--text-muted); font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); }
.table-admin td { padding: 12px 14px; border-bottom: 1px solid rgba(30,41,59,.5); font-size: .9rem; vertical-align: middle; }
.table-admin tr:last-child td { border-bottom: none; }
.table-admin tr:hover td { background: rgba(255,255,255,.02); }

/* ─── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .hide-mobile { display: none !important; }
  .navbar { padding: 0 12px; }
  .card   { padding: 12px; }
}
