/* ============================================================
   MENÚ: DASHBOARD (tarjetas + vista ejecutiva de lujo)
   Separado de styles.css — el orden de los archivos en index.html
   replica el orden original para conservar la cascada exacta.
   ============================================================ */
/* ===== DASHBOARD CARDS ===== */
.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

/* ===== DASHBOARD EJECUTIVO (VISTA DE LUJO) ===== */
@keyframes dashUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}
@keyframes dashDraw { to { stroke-dashoffset: 0; } }
@keyframes dashPop { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: none; } }
@keyframes dashPulse {
  50% { box-shadow: 0 0 0 8px rgba(34, 197, 94, .07); }
}

/* --- Hero --- */
.dash-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 26px 30px;
  border-radius: 20px;
  color: #fff;
  background: linear-gradient(120deg, #0f172a 0%, #1e3a8a 48%, #4c1d95 100%);
  box-shadow: 0 20px 45px -20px rgba(30, 58, 138, .75);
  animation: dashUp .45s ease both;
}
.dash-hero::before {
  content: '';
  position: absolute;
  width: 360px; height: 360px;
  right: -100px; top: -150px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59, 130, 246, .5), transparent 65%);
}
.dash-hero::after {
  content: '';
  position: absolute;
  width: 300px; height: 300px;
  left: 25%; bottom: -200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(168, 85, 247, .42), transparent 65%);
}
.dash-hero > * { position: relative; z-index: 1; }
.dash-saludo { font-size: 1.75rem; font-weight: 800; letter-spacing: -.5px; }
.dash-saludo span {
  background: linear-gradient(90deg, #93c5fd, #c4b5fd);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.dash-fecha { opacity: .78; font-size: .9rem; margin-top: 6px; }
.dash-hero-acciones { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dash-reloj {
  font-size: 1.15rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .22);
  padding: 9px 15px;
  border-radius: 12px;
  backdrop-filter: blur(6px);
}
.btn-glass {
  background: rgba(255, 255, 255, .13) !important;
  border: 1px solid rgba(255, 255, 255, .25) !important;
  color: #fff !important;
  border-radius: 12px;
  padding: 9px 15px;
  font-weight: 600;
  backdrop-filter: blur(6px);
  transition: all .2s;
}
.btn-glass:hover {
  background: rgba(255, 255, 255, .26) !important;
  transform: translateY(-2px);
}

/* --- Tarjetas KPI --- */
.dash-kpis {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin: 18px 0;
}
.dash-kpi {
  position: relative;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px 18px 16px;
  box-shadow: 0 8px 20px -12px rgba(15, 23, 42, .18);
  animation: dashUp .5s ease both;
  transition: transform .25s, box-shadow .25s;
}
.dash-kpi:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 36px -16px rgba(15, 23, 42, .3);
}
.kpi-bar { position: absolute; top: 0; left: 0; right: 0; height: 4px; }
.kpi-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.kpi-icon {
  width: 42px; height: 42px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 8px 16px -8px rgba(0, 0, 0, .5);
}
.kpi-label {
  font-size: .7rem;
  letter-spacing: .7px;
  text-transform: uppercase;
  color: var(--text-light);
  font-weight: 700;
}
.kpi-value {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -.8px;
  margin: 5px 0 6px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.kpi-sub { font-size: .75rem; color: var(--text-light); }
.dash-delta { font-size: .7rem; font-weight: 800; padding: 4px 9px; border-radius: 999px; }
.dash-delta.up { background: #dcfce7; color: #15803d; }
.dash-delta.down { background: #fee2e2; color: #b91c1c; }
.dash-delta.flat { background: #f1f5f9; color: #64748b; }

/* --- Grillas de análisis --- */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.dash-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px 22px;
  box-shadow: 0 8px 22px -14px rgba(15, 23, 42, .18);
  animation: dashUp .55s ease both;
  min-width: 0;
}
.dash-span2 { grid-column: span 2; }
.dash-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.dash-card-head h3 { font-size: .97rem; font-weight: 700; color: var(--text); }
.dash-chip {
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .4px;
  text-transform: uppercase;
  background: #eff6ff;
  color: var(--primary);
  border: 1px solid #dbeafe;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.dash-chip.ok { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.dash-body { min-height: 60px; }

/* --- Gráficos SVG --- */
.dash-svg { width: 100%; height: auto; display: block; overflow: visible; }
.dash-gridline { stroke: #eef2f7; stroke-width: 1; }
.dash-axis { fill: #94a3b8; font-size: 11px; }
.dash-dot { fill: #fff; stroke: #2563eb; stroke-width: 3; animation: dashPop .4s ease both; }
.dash-linea { stroke-dasharray: 3000; stroke-dashoffset: 3000; animation: dashDraw 1.5s ease forwards; }
.dash-barra { animation: dashUp .5s ease both; transition: opacity .2s; }
.dash-barra:hover { opacity: .75; }
.dash-chart-top { display: flex; gap: 28px; margin-bottom: 10px; }
.dash-chart-top strong { display: block; font-size: 1.05rem; font-weight: 800; margin-top: 2px; }
.dash-chart-label {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-light);
  font-weight: 800;
}
.dash-svg-dona { width: 190px; height: 190px; filter: drop-shadow(0 10px 18px rgba(15, 23, 42, .14)); }
.dash-dona-center { font-size: 27px; font-weight: 800; fill: #0f172a; }
.dash-dona-sub { font-size: 11px; letter-spacing: 3px; fill: #94a3b8; font-weight: 800; }
.dash-dona { display: flex; justify-content: center; margin-bottom: 12px; }
.dash-dona-datos { text-align: right; }
.dash-dona-datos strong { font-size: .86rem; }
.dash-dona-datos span { display: block; font-size: .72rem; color: var(--text-light); font-weight: 700; }

/* --- Listas y barras --- */
.dash-list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px dashed #eef2f7;
  animation: dashUp .45s ease both;
}
.dash-list-row:last-child { border-bottom: none; }
.dash-list-main { flex: 1; min-width: 0; }
.dash-list-main.horizontal { display: flex; align-items: center; gap: 9px; }
.dash-list-nombre {
  display: block;
  font-size: .86rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-list-sub { font-size: .72rem; color: var(--text-light); }
.dash-list-valor { font-size: .86rem; white-space: nowrap; }
.dash-bar { height: 6px; background: #eef2f7; border-radius: 99px; overflow: hidden; margin-top: 6px; }
.dash-bar i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6);
  transition: width .8s ease;
}
.dash-dot-color { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.dash-rank {
  width: 27px; height: 27px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .78rem;
  font-weight: 800;
  background: #f1f5f9;
  color: #64748b;
  border-radius: 9px;
}
.dash-rank.top { background: none; box-shadow: none; font-size: 1.15rem; width: 31px; }

/* --- Tabla de últimas ventas --- */
.dash-tabla { width: 100%; border-collapse: collapse; font-size: .85rem; }
.dash-tabla th {
  text-align: left;
  font-size: .67rem;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-light);
  padding: 8px 10px;
  border-bottom: 2px solid #eef2f7;
}
.dash-tabla td { padding: 9px 8px; border-bottom: 1px solid #f1f5f9; animation: dashUp .4s ease both; white-space: nowrap; }
.dash-tabla td:nth-child(3) { white-space: normal; }
.dash-tabla tr:last-child td { border-bottom: none; }
.dash-tabla tbody tr:hover td { background: #f8fafc; }
.dash-tabla .text-right { text-align: right; }
.dash-pago {
  font-size: .68rem;
  font-weight: 800;
  background: #eff6ff;
  color: #1d4ed8;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

/* --- Mini datos / caja / resumen --- */
.dash-mini-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.dash-mini-grid.tres { grid-template-columns: repeat(3, 1fr); }
.dash-mini {
  background: #f8fafc;
  border: 1px solid #eef2f7;
  border-radius: 14px;
  padding: 11px 13px;
  min-width: 0;
}
.dash-mini span {
  display: block;
  font-size: .66rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-light);
  font-weight: 800;
  margin-bottom: 4px;
}
.dash-mini strong { font-size: .96rem; font-weight: 800; word-break: break-word; }
.dash-mini.destacado { background: linear-gradient(135deg, #0f172a, #1e3a8a); border-color: transparent; }
.dash-mini.destacado span { color: #93c5fd; }
.dash-mini.destacado strong { color: #fff; font-size: 1.1rem; }
.dash-caja-estado {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: .9rem;
  margin-bottom: 12px;
}
.dash-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, .2);
  animation: dashPulse 1.6s infinite;
}
.ok-text { color: #16a34a; }
.bad-text { color: #dc2626; }
.dash-empty {
  text-align: center;
  color: var(--text-light);
  font-size: .84rem;
  padding: 26px 12px;
}
.dash-mini-badge {
  font-size: .66rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 8px;
  white-space: nowrap;
}
.dash-mini-badge.danger { background: #fee2e2; color: #b91c1c; }
.dash-mini-badge.warning { background: #fef3c7; color: #92400e; }

/* --- Responsive --- */
@media (max-width: 1400px) {
  .dash-kpis { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1100px) {
  .dash-kpis { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .dash-kpis, .dash-grid { grid-template-columns: 1fr; }
  .dash-span2 { grid-column: span 1; }
  .dash-mini-grid.tres { grid-template-columns: repeat(2, 1fr); }
  .dash-hero { padding: 20px; }
  .dash-saludo { font-size: 1.35rem; }
}

