/* ══════════════════════════════════════════════════════════════
   DASHBOARD — Sanfer Volvo v2.0
   Styles specific to the main dashboard page (index.html)
   ══════════════════════════════════════════════════════════════ */

/* ── Welcome Banner ──────────────────────────────────────────── */
.welcome-banner {
  background: linear-gradient(135deg, #003057 0%, #005287 40%, #0077b6 100%);
  border-radius: 18px; padding: 28px 32px; margin-bottom: 24px;
  display: flex; align-items: center; justify-content: space-between;
  position: relative; overflow: hidden;
  animation: fadeUp .5s var(--ease) both;
}
.welcome-banner::before {
  content: ''; position: absolute; top: -60%; right: -10%;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(255,255,255,.06) 0%, transparent 70%);
  border-radius: 50%; pointer-events: none;
}
.welcome-banner::after {
  content: ''; position: absolute; bottom: -40%; left: 20%;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(77,184,255,.08) 0%, transparent 70%);
  border-radius: 50%; pointer-events: none;
}
.wb-left { position: relative; z-index: 1; }
.wb-greeting { font-size: .78rem; font-weight: 600; color: rgba(255,255,255,.6); letter-spacing: .1em; text-transform: uppercase; margin-bottom: 6px; }
.wb-name { font-size: 1.55rem; font-weight: 800; color: #fff; line-height: 1.2; }
.wb-sub { font-size: .85rem; color: rgba(255,255,255,.65); margin-top: 6px; font-weight: 500; }
.wb-right { position: relative; z-index: 1; text-align: right; }
.wb-date { font-size: .82rem; color: rgba(255,255,255,.55); font-weight: 600; }
.wb-time { font-size: 2rem; font-weight: 800; color: #fff; line-height: 1; margin-top: 4px; font-variant-numeric: tabular-nums; }

/* ── Hero KPI Cards ──────────────────────────────────────────── */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.kpi-card {
  padding: 22px 24px; border-radius: 16px; position: relative; overflow: hidden;
  animation: fadeUp .4s var(--ease) both; cursor: default;
  transition: transform .2s, box-shadow .2s;
}
.kpi-card:hover { transform: translateY(-4px); box-shadow: 0 12px 40px rgba(0,0,0,.12); }
.kpi-card:nth-child(1) { animation-delay: .05s }
.kpi-card:nth-child(2) { animation-delay: .1s }
.kpi-card:nth-child(3) { animation-delay: .15s }
.kpi-card:nth-child(4) { animation-delay: .2s }

.kpi-card::before {
  content: ''; position: absolute; top: 0; right: 0;
  width: 120px; height: 120px; border-radius: 50%;
  transform: translate(30%, -30%); opacity: .12; pointer-events: none;
}
.kpi-card.blue   { background: linear-gradient(135deg, #003057, #005a8c); color: #fff; }
.kpi-card.blue::before   { background: #4db8ff; }
.kpi-card.green  { background: linear-gradient(135deg, #065f46, #059669); color: #fff; }
.kpi-card.green::before  { background: #6ee7b7; }
.kpi-card.amber  { background: linear-gradient(135deg, #78350f, #b45309); color: #fff; }
.kpi-card.amber::before  { background: #fcd34d; }
.kpi-card.purple { background: linear-gradient(135deg, #4c1d95, #6d28d9); color: #fff; }
.kpi-card.purple::before { background: #c4b5fd; }

.kpi-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.kpi-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.15); backdrop-filter: blur(4px); font-size: 1.15rem;
}
.kpi-trend {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 20px;
  font-size: .7rem; font-weight: 700; background: rgba(255,255,255,.18); color: rgba(255,255,255,.9);
}
.kpi-value { font-size: 1.75rem; font-weight: 900; line-height: 1; margin-bottom: 4px; }
.kpi-label { font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; opacity: .7; }
.kpi-sub { font-size: .78rem; font-weight: 600; opacity: .65; margin-top: 8px; }

/* ── Dashboard Section Grid ──────────────────────────────────── */
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.dash-card {
  background: #fff; border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow-sm); overflow: hidden;
  animation: fadeUp .4s var(--ease) both;
}
.dash-card:nth-child(1) { animation-delay: .25s }
.dash-card:nth-child(2) { animation-delay: .3s }
.dc-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--border);
}
.dc-title { display: flex; align-items: center; gap: 10px; font-size: .92rem; font-weight: 700; color: var(--text-dark); }
.dc-title i { font-size: .95rem; }
.dc-link {
  font-size: .76rem; color: var(--volvo-accent); text-decoration: none; font-weight: 700;
  transition: all .15s; display: flex; align-items: center; gap: 4px;
}
.dc-link:hover { gap: 8px; color: #003057; }
.dc-body { padding: 6px 22px 18px; }

/* Cita row */
.cita-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid #f1f5f9; transition: background .15s; }
.cita-row:last-child { border-bottom: none; }
.cita-row:hover { background: #f8fafc; margin: 0 -22px; padding-left: 22px; padding-right: 22px; border-radius: 10px; }
.cita-hora { min-width: 58px; background: linear-gradient(135deg, #eff6ff, #dbeafe); border-radius: 10px; padding: 8px 10px; text-align: center; }
.cita-hora-txt { font-size: .88rem; font-weight: 800; color: #003057; }
.cita-info { flex: 1; min-width: 0; }
.cita-cli { font-weight: 700; font-size: .84rem; color: var(--text-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cita-veh { font-size: .76rem; color: var(--text-light); font-weight: 500; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Seguimiento row */
.seg-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid #f1f5f9; transition: background .15s; }
.seg-row:last-child { border-bottom: none; }
.seg-row:hover { background: #f8fafc; margin: 0 -22px; padding-left: 22px; padding-right: 22px; border-radius: 10px; }
.seg-prio { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.seg-prio.alta  { background: #ef4444; box-shadow: 0 0 6px rgba(239,68,68,.3); }
.seg-prio.media { background: #f59e0b; box-shadow: 0 0 6px rgba(245,158,11,.3); }
.seg-prio.baja  { background: #94a3b8; }
.seg-info { flex: 1; min-width: 0; }
.seg-cli { font-weight: 700; font-size: .84rem; color: var(--text-dark); }
.seg-acc { font-size: .76rem; color: var(--text-light); font-weight: 500; margin-top: 2px; }
.seg-date { font-size: .72rem; font-weight: 700; color: #ef4444; white-space: nowrap; }

/* Ventas table card */
.ventas-card { animation: fadeUp .45s var(--ease) both; animation-delay: .35s; }
.ventas-card .dc-header { background: linear-gradient(135deg, #fafbff, #f0f4ff); border-bottom: 2px solid #e2e8f0; }
.ventas-tbl { width: 100%; border-collapse: collapse; font-size: .83rem; }
.ventas-tbl th {
  padding: 11px 14px; text-align: left; font-size: .65rem; font-weight: 700;
  letter-spacing: .08em; color: var(--text-light); text-transform: uppercase;
  background: #fafbff; border-bottom: 2px solid var(--border); white-space: nowrap;
}
.ventas-tbl td { padding: 12px 14px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; color: var(--text-mid); }
.ventas-tbl tr:last-child td { border-bottom: none; }
.ventas-tbl tbody tr { transition: all .15s; }
.ventas-tbl tbody tr:hover td { background: #f8fafc; }
.v-precio { font-weight: 800; color: var(--text-dark); font-size: .88rem; }
.v-matricula { font-family: 'Courier New', monospace; font-weight: 700; color: #003057; font-size: .8rem; background: #eff6ff; padding: 2px 8px; border-radius: 6px; display: inline-block; }
.v-badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 12px; border-radius: 20px; font-size: .71rem; font-weight: 700; white-space: nowrap; }
.v-badge.ok   { background: #d1fae5; color: #065f46; }
.v-badge.warn { background: #fef3c7; color: #92400e; }
.v-badge.neut { background: #f1f5f9; color: #64748b; }

/* Dashboard empty state */
.dash-empty { text-align: center; padding: 36px 20px; color: var(--text-light); }
.dash-empty i { font-size: 2rem; opacity: .2; display: block; margin-bottom: 10px; }
.dash-empty p { font-size: .85rem; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1024px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .dash-grid { grid-template-columns: 1fr; }
  .welcome-banner { flex-direction: column; align-items: flex-start; gap: 16px; }
  .wb-right { text-align: left; }
  .kpi-value { font-size: 1.35rem; }
}
@media (max-width: 480px) { .kpi-grid { grid-template-columns: 1fr; } .kpi-value { font-size: 1.2rem; } }
