/* ==========================================
   NTT DATA – Soporte Extendido SRE
   Design System v6 — Premium Edition
   Inspirado en el sistema de diseño de
   Guardia CCoE: bento grid, gradientes
   vibrantes, glassmorphism, Plus Jakarta Sans,
   animaciones fluidas con stagger.
   ========================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
  /* ── Gradientes premium ── */
  --gradient-primary:  linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --gradient-success:  linear-gradient(135deg, #10b981 0%, #34d399 100%);
  --gradient-info:     linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
  --gradient-warning:  linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
  --gradient-danger:   linear-gradient(135deg, #ef4444 0%, #f87171 100%);
  --gradient-pink:     linear-gradient(135deg, #ec4899 0%, #f472b6 100%);
  --gradient-cyan:     linear-gradient(135deg, #06b6d4 0%, #22d3ee 100%);
  --gradient-sidebar:  linear-gradient(180deg, #0f172a 0%, #1e293b 100%);

  /* ── Marca ── */
  --primary:       #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: #eef2ff;
  --primary-ghost: rgba(99,102,241,0.07);
  --accent:        #8b5cf6;
  --success:       #10b981;
  --warning:       #f59e0b;
  --danger:        #ef4444;

  /* ── Superficies ── */
  --bg-body:   #f1f5f9;
  --bg-card:   #ffffff;
  --bg-subtle: #f8fafc;
  --bg-input:  #f1f5f9;

  /* ── Sidebar premium ── */
  --sidebar-bg:  #0f172a;
  --sidebar-mid: #1e293b;

  /* ── Texto ── */
  --text-primary:   #0f172a;
  --text-secondary: #475569;
  --text-muted:     #94a3b8;
  --text-on-dark:   #e2e8f0;

  /* ── Bordes ── */
  --border:        #e2e8f0;
  --border-strong: #cbd5e1;
  --border-focus:  var(--primary);

  /* ── Sombras con tinte de color (igual que guardia) ── */
  --shadow-xs: 0 1px 2px rgba(15,23,42,0.04);
  --shadow-sm: 0 1px 3px rgba(15,23,42,0.05), 0 1px 6px rgba(15,23,42,0.04);
  --shadow-md: 0 4px 12px rgba(15,23,42,0.07), 0 2px 6px rgba(15,23,42,0.04);
  --shadow-lg: 0 12px 32px rgba(15,23,42,0.10), 0 4px 12px rgba(15,23,42,0.05);
  --shadow-xl: 0 20px 48px rgba(15,23,42,0.12), 0 8px 20px rgba(15,23,42,0.06);
  --shadow-kpi:    0 4px 16px rgba(99,102,241,0.12), 0 2px 6px rgba(15,23,42,0.05);
  --shadow-colored: 0 8px 24px rgba(99,102,241,0.25);

  /* ── Formas ── */
  --radius-sm: 0.625rem;
  --radius:    1rem;
  --radius-lg: 1.25rem;
  --radius-xl: 1.5rem;

  /* ── Tipografía ── */
  --font-sans:    'Plus Jakarta Sans', -apple-system, 'Segoe UI', system-ui, sans-serif;
  --font-display: 'Space Grotesk', 'Plus Jakarta Sans', system-ui, sans-serif;

  /* ── Easing premium ── */
  --ease-expo:  cubic-bezier(0.16, 1, 0.3, 1);
  --ease-quart: cubic-bezier(0.25, 1, 0.5, 1);
}

/* ── Dark mode tokens ── */
[data-theme="dark"] {
  --bg-body:        #0f172a;
  --bg-card:        #1e293b;
  --bg-subtle:      #263348;
  --bg-input:       #2d3f5c;
  --text-primary:   #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted:     #64748b;
  --border:         #2d3f5c;
  --border-strong:  #3d526e;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.5);
  --shadow-kpi: 0 4px 16px rgba(99,102,241,0.2), 0 2px 6px rgba(0,0,0,0.3);
}

/* ════════════════════════════════════════
   BASE
   ════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: var(--font-sans);
  background-color: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ════════════════════════════════════════
   TIPOGRAFÍA
   ════════════════════════════════════════ */
#page-title {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
}
#page-subtitle { color: var(--text-muted); font-size: 0.8125rem; }

#kpi-horas, #kpi-monto, #kpi-registros, #kpi-especialistas {
  font-family: var(--font-display);
  font-feature-settings: 'tnum' 1, 'zero' 1;
  letter-spacing: -0.03em;
}

h1,h2,h3,h4,h5,h6 {
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
h3 { font-weight: 700; letter-spacing: -0.02em; }
h4 { font-weight: 600; letter-spacing: -0.015em; }

/* ════════════════════════════════════════
   DARK MODE overrides (Tailwind compat)
   ════════════════════════════════════════ */
[data-theme="dark"] .bg-white         { background-color: var(--bg-card) !important; }
[data-theme="dark"] .bg-gray-50       { background-color: var(--bg-subtle) !important; }
[data-theme="dark"] .text-gray-800,
[data-theme="dark"] .text-gray-900    { color: var(--text-primary) !important; }
[data-theme="dark"] .text-gray-700    { color: var(--text-secondary) !important; }
[data-theme="dark"] .text-gray-600,
[data-theme="dark"] .text-gray-500    { color: var(--text-muted) !important; }
[data-theme="dark"] .text-gray-400    { color: var(--text-muted) !important; }
[data-theme="dark"] .border-gray-100,
[data-theme="dark"] .border-gray-200  { border-color: var(--border) !important; }
[data-theme="dark"] .divide-gray-100 > :not(:last-child),
[data-theme="dark"] .divide-gray-50  > :not(:last-child) { border-color: var(--border) !important; }
[data-theme="dark"] select,
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="number"],
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="time"]  {
  background-color: var(--bg-input) !important;
  color: var(--text-primary) !important;
  border-color: var(--border) !important;
}
[data-theme="dark"] .bg-blue-50   { background-color: rgba(99,102,241,0.12) !important; }
[data-theme="dark"] .bg-green-50  { background-color: rgba(16,185,129,0.12) !important; }
[data-theme="dark"] .bg-purple-50 { background-color: rgba(139,92,246,0.12) !important; }
[data-theme="dark"] .bg-orange-50 { background-color: rgba(245,158,11,0.12) !important; }
[data-theme="dark"] .bg-amber-50  { background-color: rgba(245,158,11,0.10) !important; }
[data-theme="dark"] .bg-gradient-to-r,
[data-theme="dark"] .bg-gradient-to-br { background: var(--bg-card) !important; }

/* ════════════════════════════════════════
   SIDEBAR — premium dark, igual que guardia
   ════════════════════════════════════════ */
#sidebar {
  background: var(--gradient-sidebar) !important;
  border-right: 1px solid rgba(255,255,255,0.05) !important;
  box-shadow: 4px 0 24px rgba(0,0,0,0.2);
}

/* Logo section */
#sidebar .p-6 {
  border-bottom: 1px solid rgba(255,255,255,0.06) !important;
  background: rgba(0,0,0,0.15);
}

/* Nav group titles */
.nav-group-title {
  font-size: 0.5625rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(148,163,184,0.35);
  padding: 0 0.875rem;
  margin: 1.5rem 0 0.5rem;
  font-family: var(--font-sans);
}

/* Nav links — estilo guardia con indicador lateral */
.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  border-radius: 0.75rem;
  color: rgba(148,163,184,0.7);
  font-size: 0.8125rem;
  font-weight: 500;
  transition: background 0.2s var(--ease-expo), color 0.2s ease, transform 0.2s var(--ease-expo);
  margin-bottom: 2px;
  text-decoration: none;
  letter-spacing: 0.005em;
  min-height: 40px;
  position: relative;
}
.nav-link i {
  width: 16px;
  text-align: center;
  font-size: 0.875rem;
  flex-shrink: 0;
  transition: color 0.2s ease;
}
.nav-link:hover {
  background: rgba(255,255,255,0.06);
  color: #f1f5f9;
  transform: translateX(2px);
}
.nav-link.active {
  background: linear-gradient(135deg, rgba(99,102,241,0.18) 0%, rgba(139,92,246,0.18) 100%);
  color: #fff;
  font-weight: 600;
}
/* Indicador lateral gradiente — signature de guardia */
.nav-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  border-radius: 0 4px 4px 0;
  background: var(--gradient-primary);
}
.nav-link.active i { color: #a5b4fc; }

/* Sidebar footer */
#sidebar .absolute.bottom-0 {
  background: rgba(0,0,0,0.2) !important;
  border-top: 1px solid rgba(255,255,255,0.06) !important;
}

/* ════════════════════════════════════════
   HEADER — glassmorphism
   ════════════════════════════════════════ */
header {
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(226,232,240,0.8);
  border-radius: var(--radius-lg);
  padding: 0.875rem 1.25rem !important;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}
[data-theme="dark"] header {
  background: rgba(30,41,59,0.85);
  border-color: rgba(255,255,255,0.06);
}

/* ════════════════════════════════════════
   KPI CARDS — bento premium con gradiente
   ════════════════════════════════════════ */
#section-dashboard .grid > div {
  border-radius: var(--radius-xl) !important;
  border: 1px solid var(--border) !important;
  box-shadow: var(--shadow-kpi) !important;
  background: var(--bg-card) !important;
  transition: all 0.4s var(--ease-expo) !important;
  position: relative;
  overflow: hidden;
}
#section-dashboard .grid > div:hover {
  transform: translateY(-5px) !important;
  box-shadow: var(--shadow-xl) !important;
}

/* Línea de acento superior con gradiente al hover */
#section-dashboard .grid > div::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}
#section-dashboard .grid > div:hover::before { opacity: 1; }

/* Círculo decorativo de fondo — ícono fantasma */
#section-dashboard .grid > div::after {
  content: '';
  position: absolute;
  right: -16px;
  bottom: -16px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.04;
  pointer-events: none;
}

/* Iconos KPI con gradiente */
#section-dashboard .w-11.h-11 {
  border-radius: 14px !important;
  transition: transform 0.3s var(--ease-expo) !important;
}
#section-dashboard .group:hover .w-11.h-11 {
  transform: scale(1.12) rotate(-4deg) !important;
}

/* KPI icon backgrounds — reemplazar colores planos por gradientes */
#section-dashboard .bg-blue-50.rounded-xl   { background: linear-gradient(135deg, rgba(99,102,241,0.12) 0%, rgba(139,92,246,0.12) 100%) !important; }
#section-dashboard .bg-green-50.rounded-xl  { background: linear-gradient(135deg, rgba(16,185,129,0.12) 0%, rgba(52,211,153,0.12) 100%) !important; }
#section-dashboard .bg-purple-50.rounded-xl { background: linear-gradient(135deg, rgba(139,92,246,0.12) 0%, rgba(196,181,253,0.12) 100%) !important; }
#section-dashboard .bg-orange-50.rounded-xl { background: linear-gradient(135deg, rgba(245,158,11,0.12) 0%, rgba(251,191,36,0.12) 100%) !important; }

/* KPI icon colors */
#section-dashboard .text-blue-600   { color: #6366f1 !important; }
#section-dashboard .text-green-600  { color: #10b981 !important; }
#section-dashboard .text-purple-600 { color: #8b5cf6 !important; }
#section-dashboard .text-orange-600 { color: #f59e0b !important; }

/* ════════════════════════════════════════
   CARDS — todas las demás
   ════════════════════════════════════════ */
.bg-white {
  background-color: var(--bg-card);
}

.bg-white.rounded-xl {
  border: 1px solid var(--border) !important;
  box-shadow: var(--shadow-sm) !important;
  border-radius: var(--radius-lg) !important;
  transition: box-shadow 0.25s ease, transform 0.2s var(--ease-expo);
}
.bg-white.rounded-xl:hover {
  box-shadow: var(--shadow-md) !important;
  transform: translateY(-2px);
}

/* ════════════════════════════════════════
   ANIMACIONES — stagger fadeInUp como guardia
   ════════════════════════════════════════ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.94); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes countUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.6; transform: scale(0.85); }
}
@keyframes toastIn  { from { transform: translateX(110%) scale(0.95); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateX(40px); } }
@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.fade-in        { animation: fadeIn    0.35s var(--ease-expo); }
.section-content { animation: fadeInUp 0.4s  var(--ease-expo); }
.kpi-value       { animation: countUp  0.55s var(--ease-expo); }

/* Stagger para KPI cards */
#section-dashboard .grid > div:nth-child(1) { animation: fadeInUp 0.5s var(--ease-expo) 0.05s both; }
#section-dashboard .grid > div:nth-child(2) { animation: fadeInUp 0.5s var(--ease-expo) 0.12s both; }
#section-dashboard .grid > div:nth-child(3) { animation: fadeInUp 0.5s var(--ease-expo) 0.19s both; }
#section-dashboard .grid > div:nth-child(4) { animation: fadeInUp 0.5s var(--ease-expo) 0.26s both; }

/* Stagger charts */
#section-dashboard .grid > div:nth-child(n+5) { animation: fadeInUp 0.5s var(--ease-expo) 0.33s both; }

/* ════════════════════════════════════════
   SKELETON
   ════════════════════════════════════════ */
.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, rgba(255,255,255,0.6) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 8px;
}
[data-theme="dark"] .skeleton {
  background: linear-gradient(90deg, var(--bg-subtle) 25%, rgba(255,255,255,0.04) 50%, var(--bg-subtle) 75%);
  background-size: 200% 100%;
}

/* ════════════════════════════════════════
   BADGES — glassmorphism style
   ════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  backdrop-filter: blur(4px);
}
.badge-blue   { background: rgba(99,102,241,0.12);  color: #6366f1; border: 1px solid rgba(99,102,241,0.2); }
.badge-green  { background: rgba(16,185,129,0.12);  color: #059669; border: 1px solid rgba(16,185,129,0.2); }
.badge-orange { background: rgba(245,158,11,0.12);  color: #d97706; border: 1px solid rgba(245,158,11,0.2); }
.badge-purple { background: rgba(139,92,246,0.12);  color: #7c3aed; border: 1px solid rgba(139,92,246,0.2); }
.badge-red    { background: rgba(239,68,68,0.12);   color: #dc2626; border: 1px solid rgba(239,68,68,0.2); }
.badge-cyan   { background: rgba(6,182,212,0.12);   color: #0891b2; border: 1px solid rgba(6,182,212,0.2); }
.badge-gray   { background: rgba(148,163,184,0.12); color: #475569; border: 1px solid rgba(148,163,184,0.2); }

/* ════════════════════════════════════════
   PROGRESS & GAUGE
   ════════════════════════════════════════ */
.progress-bar      { height: 6px; border-radius: 99px; background: var(--border); overflow: hidden; }
.progress-bar-fill { height: 100%; border-radius: 99px; transition: width 0.9s var(--ease-expo); }
.gauge             { height: 6px; border-radius: 99px; background: var(--border); overflow: hidden; }
.gauge-fill        { height: 100%; border-radius: 99px; transition: width 0.9s var(--ease-expo); }
.gauge-ok     { background: var(--gradient-success); }
.gauge-warn   { background: var(--gradient-warning); }
.gauge-danger { background: var(--gradient-danger); }

/* ════════════════════════════════════════
   TABLAS
   ════════════════════════════════════════ */
table { border-collapse: separate; border-spacing: 0; width: 100%; }

table thead th {
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  padding: 0.625rem 1rem;
  position: sticky;
  top: 0;
  z-index: 1;
}
table tbody tr {
  transition: background-color 0.12s ease;
  height: 48px;
}
table tbody tr:nth-child(even) { background: rgba(241,245,249,0.5); }
table tbody tr:hover            { background: var(--primary-ghost) !important; }
table tbody td {
  padding: 0.625rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.8125rem;
  vertical-align: middle;
}
table tbody td:first-child { font-weight: 600; color: var(--text-primary); }

[data-theme="dark"] table thead th         { background: var(--bg-subtle); border-bottom-color: var(--border); }
[data-theme="dark"] table tbody td         { border-bottom-color: var(--border); }
[data-theme="dark"] table tbody tr:nth-child(even) { background: rgba(255,255,255,0.02); }
[data-theme="dark"] table tbody tr:hover   { background: rgba(99,102,241,0.08) !important; }

/* ════════════════════════════════════════
   INPUTS & SELECTS
   ════════════════════════════════════════ */
input[type="text"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="password"],
input[type="email"],
select,
textarea {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
  background: #fff;
}
[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus {
  background: var(--bg-input);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.25);
}

/* ════════════════════════════════════════
   BOTONES
   ════════════════════════════════════════ */
button { transition: all 0.18s var(--ease-expo); cursor: pointer; }
button:active:not(:disabled) { transform: scale(0.96); }

button.bg-blue-600:hover:not(:disabled),
button.bg-indigo-600:hover:not(:disabled) {
  background: var(--primary-hover) !important;
  box-shadow: 0 6px 20px rgba(99,102,241,0.35);
  transform: translateY(-1px);
}
button.bg-green-600:hover:not(:disabled),
button.bg-emerald-600:hover:not(:disabled) {
  box-shadow: 0 6px 20px rgba(16,185,129,0.30);
  transform: translateY(-1px);
}
button.bg-purple-600:hover:not(:disabled) {
  box-shadow: 0 6px 20px rgba(139,92,246,0.30);
  transform: translateY(-1px);
}
button.bg-amber-500:hover:not(:disabled) {
  box-shadow: 0 6px 20px rgba(245,158,11,0.30);
  transform: translateY(-1px);
}

/* ════════════════════════════════════════
   TOAST
   ════════════════════════════════════════ */
.toast-container {
  position: fixed; top: 1.25rem; right: 1.25rem;
  z-index: 9999; display: flex; flex-direction: column; gap: 0.5rem;
}
.toast {
  padding: 0.875rem 1.25rem;
  border-radius: var(--radius);
  color: white;
  font-size: 0.8125rem; font-weight: 500;
  box-shadow: var(--shadow-xl);
  animation: toastIn 0.4s var(--ease-expo);
  display: flex; align-items: center; gap: 0.625rem;
  max-width: 380px;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.15);
}
.toast-success { background: var(--gradient-success); }
.toast-error   { background: var(--gradient-danger); }
.toast-info    { background: var(--gradient-info); }
.toast-warning { background: var(--gradient-warning); }

/* ════════════════════════════════════════
   SEARCH
   ════════════════════════════════════════ */
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-height: 380px; overflow-y: auto; z-index: 100;
  backdrop-filter: blur(20px);
}
.search-results .result-item {
  padding: 0.625rem 1rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.12s;
  font-size: 0.8125rem;
}
.search-results .result-item:hover  { background: var(--primary-ghost); }
.search-results .result-item:last-child { border-bottom: none; }

/* ════════════════════════════════════════
   CALENDARIO
   ════════════════════════════════════════ */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.calendar-header {
  padding: 0.5rem 0.25rem;
  text-align: center;
  font-weight: 800;
  font-size: 0.5625rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.calendar-day {
  min-height: 88px;
  padding: 6px 5px 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.625rem;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s var(--ease-expo);
  position: relative;
  overflow: hidden;
  background: var(--bg-card);
}
.calendar-day:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(99,102,241,0.15);
  transform: scale(1.02);
  z-index: 1;
}
.calendar-day.today {
  background: var(--gradient-primary);
  border-color: transparent;
}
.calendar-day.today .day-number { color: #fff !important; }
.calendar-day.weekend { background: rgba(226,232,240,0.3); }
[data-theme="dark"] .calendar-day         { background: var(--bg-card); border-color: var(--border); }
[data-theme="dark"] .calendar-day.weekend { background: rgba(255,255,255,0.02); }
[data-theme="dark"] .calendar-day.today   { background: var(--gradient-primary); border-color: transparent; }
.calendar-day.outside { opacity: 0.2; pointer-events: none; }
.calendar-day .day-number {
  font-weight: 700; font-size: 0.8125rem;
  margin-bottom: 3px; color: var(--text-primary); line-height: 1;
}
.calendar-day.weekend .day-number { color: var(--text-muted); }
.calendar-event {
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 0.5625rem;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: white;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.5;
}

/* ════════════════════════════════════════
   NOTIFICACIONES
   ════════════════════════════════════════ */
.notif-badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--danger); color: white;
  font-size: 0.5rem; font-weight: 800;
  width: 16px; height: 16px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg-body);
}
.notif-panel {
  position: absolute; right: 0; top: calc(100% + 8px);
  width: 360px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: 200; max-height: 420px; overflow-y: auto;
  backdrop-filter: blur(20px);
}

/* ════════════════════════════════════════
   AVATAR
   ════════════════════════════════════════ */
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; font-weight: 700; color: white; flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.2);
}
.avatar-sm { width: 28px; height: 28px; font-size: 0.5625rem; }
.avatar-md { width: 36px; height: 36px; font-size: 0.6875rem; }
.avatar-lg { width: 44px; height: 44px; font-size: 0.8125rem; }

/* ════════════════════════════════════════
   BREADCRUMB
   ════════════════════════════════════════ */
.breadcrumb { display: flex; align-items: center; gap: 0.5rem; font-size: 0.75rem; color: var(--text-muted); }
.breadcrumb a { color: var(--primary); text-decoration: none; font-weight: 500; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .separator { opacity: 0.4; }

/* ════════════════════════════════════════
   SCROLLBAR — premium thin
   ════════════════════════════════════════ */
::-webkit-scrollbar       { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(99,102,241,0.3) 0%, rgba(139,92,246,0.3) 100%);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(99,102,241,0.55) 0%, rgba(139,92,246,0.55) 100%);
}

/* Selection */
::selection { background: rgba(99,102,241,0.18); color: inherit; }

/* ════════════════════════════════════════
   REPORT TABS
   ════════════════════════════════════════ */
.report-tab { transition: color 0.15s, border-color 0.15s; cursor: pointer; }
.report-tab:hover { color: var(--primary); }

/* ════════════════════════════════════════
   MOBILE
   ════════════════════════════════════════ */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(15,23,42,0.75); z-index: 40;
  backdrop-filter: blur(4px);
}
.mobile-menu-btn { display: none; }

@media (max-width: 1024px) {
  .mobile-menu-btn { display: flex !important; }
  #sidebar { transform: translateX(-100%); transition: transform 0.35s var(--ease-expo); }
  #sidebar.open { transform: translateX(0); }
  .sidebar-overlay.active { display: block; }
  main { margin-left: 0 !important; padding: 1rem !important; }
  header { flex-direction: column; gap: 0.75rem; align-items: flex-start !important; }
  header > div:last-child { flex-wrap: wrap; width: 100%; }
}

/* ════════════════════════════════════════
   PRINT
   ════════════════════════════════════════ */
@media print {
  #sidebar, .toast-container, #search-container, .mobile-menu-btn,
  .notif-panel, #breadcrumb, header, #report-tabs,
  #section-reportes > div:first-child { display: none !important; }
  main  { margin-left: 0 !important; padding: 0 !important; }
  body  { background: white !important; color: #000 !important; }
  .bg-white { box-shadow: none !important; border: 1px solid #e2e8f0 !important; }
  table { font-size: 10px !important; }
  table th, table td { padding: 3px 6px !important; }
  @page { margin: 0.75cm; size: A4; }
}

/* ════════════════════════════════════════
   MISC
   ════════════════════════════════════════ */
#sidebar-toggle { display: none; }

/* Loading overlay */
#loading-overlay {
  position: fixed; inset: 0;
  background: rgba(255,255,255,0.72);
  z-index: 9998; display: none;
  align-items: center; justify-content: center;
  backdrop-filter: blur(6px);
}
#loading-overlay.active { display: flex; }
[data-theme="dark"] #loading-overlay { background: rgba(15,23,42,0.80); }
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}

/* Tooltips */
[data-tooltip] { position: relative; }
[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute; bottom: calc(100% + 6px); left: 50%;
  transform: translateX(-50%);
  background: #1e293b; color: white;
  font-size: 0.6875rem; padding: 5px 10px;
  border-radius: 7px; white-space: nowrap;
  z-index: 100; pointer-events: none;
  animation: fadeIn 0.15s;
  box-shadow: 0 4px 16px rgba(15,23,42,0.25);
  border: 1px solid rgba(255,255,255,0.08);
}

/* Welcome card */
.welcome-card {
  background: var(--gradient-primary);
  background-size: 200% 200%;
  animation: gradientShift 6s ease infinite;
  border-radius: var(--radius-xl);
  padding: 2rem; color: white;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow-colored);
}
.welcome-card::before {
  content: ''; position: absolute;
  top: -60%; right: -20%;
  width: 320px; height: 320px;
  background: rgba(255,255,255,0.07);
  border-radius: 50%;
  pointer-events: none;
}
.welcome-card::after {
  content: ''; position: absolute;
  bottom: -40%; left: -10%;
  width: 200px; height: 200px;
  background: rgba(255,255,255,0.04);
  border-radius: 50%;
  pointer-events: none;
}

/* Pagination */
.pagination-btn {
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem; font-weight: 500;
  border: 1px solid var(--border);
  transition: all 0.18s var(--ease-expo);
  background: var(--bg-card);
  color: var(--text-secondary);
}
.pagination-btn:hover    { background: var(--primary); color: white; border-color: var(--primary); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(99,102,241,0.25); }
.pagination-btn.active   { background: var(--gradient-primary); color: white; border-color: transparent; box-shadow: 0 4px 12px rgba(99,102,241,0.25); }
.pagination-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* Spark Chart */
.spark { display: inline-block; vertical-align: middle; }
.spark svg { display: block; }

/* Modal change-password */
#modal-change-password input:focus {
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245,158,11,0.15);
}

/* Live dot — sidebar footer */
.live-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16,185,129,0.5);
  animation: pulse-dot 2s ease-in-out infinite;
  flex-shrink: 0;
}

/* Gradient text utility */
.gradient-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
