/* =============================================
   DASHBOARD - Panel Gerencial
============================================= */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #090910;
  --surface: #12121e;
  --surface-alt: #181828;
  --border: #1e1e32;
  --text: #e8e8f0;
  --text-muted: #6b6b8a;
  --accent: #ff6b35;
  --accent-alt: #f7931e;
  --green: #22c55e;
  --blue: #3b82f6;
  --yellow: #f59e0b;
  --red: #ef4444;
  --purple: #8b5cf6;
  --radius: 16px;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* HEADER */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left { display: flex; align-items: center; gap: 16px; }

.header h1 {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 1px;
}

.sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.header-right { display: flex; align-items: center; gap: 16px; }

.date-input {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  cursor: pointer;
}

.date-input::-webkit-calendar-picker-indicator { filter: invert(1); cursor: pointer; }

.clock { font-size: 1.1rem; font-weight: 600; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); animation: pulse 2s infinite; }

/* MAIN */
.main {
  padding: 24px;
  max-width: 1400px;
  margin: 0 auto;
}

/* KPI GRID */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 0.2s, border-color 0.3s;
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.1);
}

.kpi-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.kpi-content { display: flex; flex-direction: column; gap: 2px; }

.kpi-value {
  font-size: 1.6rem;
  font-weight: 800;
}

.kpi-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* CONTENT GRID */
.content-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 16px;
}

/* PANELS */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.panel.wide {
  grid-column: 1 / -1;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.panel-header h2 {
  font-size: 1rem;
  font-weight: 700;
}

.panel-body { padding: 16px 20px; }

/* CHARTS */
.chart-container {
  height: 280px;
  position: relative;
}

.chart-container-sm {
  height: 220px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* TABLES */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 12px;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

.data-table tr:hover td {
  background: rgba(255,255,255,0.02);
}

/* ESTADO BADGES */
.estado-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.estado-pill.nuevo { background: rgba(59,130,246,0.15); color: var(--blue); }
.estado-pill.en_cocina { background: rgba(245,158,11,0.15); color: var(--yellow); }
.estado-pill.listo { background: rgba(34,197,94,0.15); color: var(--green); }
.estado-pill.en_reparto { background: rgba(139,92,246,0.15); color: var(--purple); }
.estado-pill.entregado { background: rgba(107,107,138,0.15); color: var(--text-muted); }

.pago-pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
}

.pago-pill.efectivo { background: rgba(34,197,94,0.1); color: var(--green); }
.pago-pill.mercadopago { background: rgba(59,130,246,0.1); color: var(--blue); }

/* RANK */
.rank {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.rank-1 { background: rgba(245,158,11,0.2); color: #fbbf24; }
.rank-2 { background: rgba(148,163,184,0.2); color: #94a3b8; }
.rank-3 { background: rgba(180,83,9,0.2); color: #d97706; }
.rank-default { background: rgba(107,107,138,0.1); color: var(--text-muted); }

/* ANIMATIONS */
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.6; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* RESPONSIVE */
@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .content-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .main { padding: 12px; }
  .header { padding: 12px 16px; flex-wrap: wrap; gap: 10px; }
  .kpi-value { font-size: 1.3rem; }

  .data-table { font-size: 0.8rem; }
  .data-table th, .data-table td { padding: 8px; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
