/* ====================================================
   PORTAL DE CASOS — Diseño Legal Profesional
   ==================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  /* Paleta Legal - Azul marino + Dorado */
  --primary: #1e3a8a;
  --primary-dark: #1e2f6b;
  --primary-light: #3b5bd0;
  --primary-50: #eff3fc;
  --primary-100: #dbe4f8;

  --gold: #c9a227;
  --gold-dark: #a8851a;
  --gold-light: #e6c757;

  /* Colores secundarios */
  --accent: #c9a227;
  --success: #15803d;
  --info: #0ea5e9;
  --warning: #d97706;
  --danger: #dc2626;
  --dark: #0f1b3d;

  /* Grises (azul sutil) */
  --gray-50: #f7f9fc;
  --gray-100: #eef2f8;
  --gray-200: #dde4ef;
  --gray-300: #c3cede;
  --gray-400: #94a3bd;
  --gray-500: #647089;
  --gray-600: #475067;
  --gray-700: #333b4d;
  --gray-800: #1f2535;
  --gray-900: #0f1b3d;

  /* Gradientes legales */
  --gradient-primary: linear-gradient(135deg, #1e3a8a 0%, #2746a8 50%, #1e3a8a 100%);
  --gradient-gold: linear-gradient(135deg, #c9a227 0%, #a8851a 100%);
  --gradient-success: linear-gradient(135deg, #15803d 0%, #166534 100%);
  --gradient-warning: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  --gradient-danger: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  --gradient-info: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  --gradient-mystic: linear-gradient(135deg, #1e2f6b 0%, #1e3a8a 45%, #2746a8 100%);
  --gradient-cosmic: linear-gradient(135deg, #0f1b3d 0%, #1e2f6b 50%, #1e3a8a 100%);
  --gradient-sunset: linear-gradient(135deg, #c9a227 0%, #1e3a8a 100%);

  /* Sombras */
  --shadow-sm: 0 1px 2px rgba(15, 27, 61, 0.05);
  --shadow: 0 1px 3px rgba(15, 27, 61, 0.1), 0 1px 2px rgba(15, 27, 61, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(15, 27, 61, 0.1), 0 2px 4px -1px rgba(15, 27, 61, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(15, 27, 61, 0.15), 0 4px 6px -2px rgba(15, 27, 61, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(15, 27, 61, 0.2), 0 10px 10px -5px rgba(15, 27, 61, 0.05);
  --shadow-2xl: 0 25px 50px -12px rgba(15, 27, 61, 0.3);
  --shadow-glow: 0 0 30px rgba(30, 58, 138, 0.4);
  --shadow-gold: 0 0 30px rgba(201, 162, 39, 0.4);

  /* Border radius */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --sidebar-width: 260px;
}

* { box-sizing: border-box; }

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.011em;
  min-height: 100vh;
}

/* ====================================================
   LAYOUT GENERAL
   ==================================================== */

.app-layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, #0f1b3d 0%, #1e2f6b 100%);
  color: white;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  padding: 24px 16px;
  transition: transform 0.3s ease;
  border-right: 1px solid rgba(251, 191, 36, 0.1);
}

.sidebar::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top, rgba(124,58,237,0.2) 0%, transparent 50%);
  pointer-events: none;
}

.sidebar > * { position: relative; z-index: 1; }

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(251,191,36,0.3); border-radius: 2px; }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px 24px;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(251, 191, 36, 0.1);
}

.sidebar-brand-icon {
  width: 44px;
  height: 44px;
  background: var(--gradient-gold);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 4px 20px rgba(251, 191, 36, 0.4);
  animation: float-icon 4s ease-in-out infinite;
}

@keyframes float-icon {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.sidebar-brand-text {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-section {
  margin-top: 20px;
  margin-bottom: 8px;
  padding: 0 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(251, 191, 36, 0.6);
}

.sidebar-nav { list-style: none; padding: 0; margin: 0; }
.sidebar-nav li { margin-bottom: 2px; }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  border-radius: var(--radius);
  font-size: 14.5px;
  font-weight: 500;
  transition: all 0.2s ease;
  position: relative;
}

.sidebar-link i {
  font-size: 18px;
  width: 20px;
  text-align: center;
}

.sidebar-link:hover {
  background: rgba(251, 191, 36, 0.1);
  color: var(--gold);
  transform: translateX(2px);
}

.sidebar-link.active {
  background: rgba(124, 58, 237, 0.35);
  color: white;
  font-weight: 600;
  border: 1px solid rgba(251, 191, 36, 0.2);
}

.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: -16px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 60%;
  background: var(--gold);
  border-radius: 0 4px 4px 0;
}

.sidebar-link .badge {
  margin-left: auto;
  background: var(--gradient-gold);
  color: var(--gray-900);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  animation: pulse-gold 2s infinite;
}

@keyframes pulse-gold {
  0%, 100% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.5); }
  50% { box-shadow: 0 0 0 6px rgba(251, 191, 36, 0); }
}

.sidebar-user {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(251, 191, 36, 0.1);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(251, 191, 36, 0.1);
  border-radius: var(--radius);
  text-decoration: none;
  color: white;
  transition: all 0.2s;
}

.user-card:hover {
  background: rgba(124, 58, 237, 0.2);
  color: white;
  border-color: rgba(251, 191, 36, 0.3);
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
  box-shadow: 0 2px 12px rgba(124, 58, 237, 0.5);
}

.user-info { flex: 1; min-width: 0; }
.user-name {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-role {
  font-size: 11px;
  color: var(--gold);
  text-transform: capitalize;
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  background: var(--gray-50);
}

.topbar {
  background: white;
  padding: 16px 32px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(8px);
  background: rgba(255,255,255,0.95);
}

.topbar-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--gray-900);
  margin: 0;
  letter-spacing: -0.02em;
}

.topbar-subtitle {
  font-size: 13px;
  color: var(--gray-500);
  margin: 0;
}

.page-container {
  padding: 28px 32px;
  max-width: 1600px;
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--gray-700);
  cursor: pointer;
}

@media (max-width: 991px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: translateX(0); box-shadow: var(--shadow-2xl); }
  .main-content { margin-left: 0; }
  .mobile-toggle { display: block; }
  .page-container { padding: 16px; }
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26, 16, 51, 0.7);
  z-index: 99;
}

.sidebar-overlay.show { display: block; }

/* ====================================================
   CARDS PREMIUM
   ==================================================== */

.card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  border-color: var(--primary-100);
}

.card-header {
  background: white;
  border-bottom: 1px solid var(--gray-100);
  padding: 18px 22px;
  font-weight: 600;
}

.card-body { padding: 22px; }

.stat-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 22px;
  border: 1px solid var(--gray-200);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity 0.3s;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-100);
}

.stat-card:hover::before { opacity: 1; }

.stat-card-primary::before { background: var(--gradient-primary); }
.stat-card-success::before { background: var(--gradient-success); }
.stat-card-warning::before { background: var(--gradient-gold); }
.stat-card-info::before { background: var(--gradient-info); }

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 16px;
  background: var(--primary-50);
  color: var(--primary);
}

.stat-icon-success { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.stat-icon-warning { background: rgba(251, 191, 36, 0.15); color: var(--gold-dark); }
.stat-icon-info { background: rgba(6, 182, 212, 0.1); color: var(--info); }
.stat-icon-danger { background: rgba(239, 68, 68, 0.1); color: var(--danger); }

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 4px;
  line-height: 1;
  letter-spacing: -0.03em;
}

.stat-label {
  font-size: 13px;
  color: var(--gray-500);
  font-weight: 500;
}

.stat-change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  margin-top: 8px;
}

.stat-change-up { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.stat-change-down { background: rgba(239, 68, 68, 0.1); color: var(--danger); }

/* ====================================================
   BOTONES MÍSTICOS
   ==================================================== */

.btn {
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  padding: 9px 18px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  letter-spacing: -0.01em;
}

.btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  border-color: var(--primary);
}

.btn-primary:hover {
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.4);
}

.btn-gold {
  background: var(--gradient-gold);
  color: var(--gray-900);
  border-color: var(--gold);
}

.btn-gold:hover {
  color: var(--gray-900);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(251, 191, 36, 0.4);
}

.btn-success {
  background: var(--gradient-success);
  color: white;
  border-color: var(--success);
}

.btn-success:hover {
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.35);
}

.btn-info {
  background: var(--gradient-info);
  color: white;
  border-color: var(--info);
}

.btn-info:hover {
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(6, 182, 212, 0.35);
}

.btn-warning {
  background: var(--gradient-gold);
  color: var(--gray-900);
  border-color: var(--gold);
}

.btn-warning:hover {
  color: var(--gray-900);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(251, 191, 36, 0.35);
}

.btn-danger {
  background: var(--gradient-danger);
  color: white;
  border-color: var(--danger);
}

.btn-danger:hover {
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.35);
}

.btn-outline-secondary {
  background: white;
  color: var(--gray-700);
  border-color: var(--gray-300);
}

.btn-outline-secondary:hover {
  background: var(--gray-50);
  color: var(--gray-900);
  border-color: var(--gray-400);
}

.btn-outline-primary {
  background: white;
  color: var(--primary);
  border-color: var(--primary-100);
}

.btn-outline-primary:hover {
  background: var(--primary-50);
  border-color: var(--primary);
  color: var(--primary-dark);
}

.btn-lg { padding: 12px 22px; font-size: 15px; }
.btn-sm { padding: 5px 12px; font-size: 12.5px; }
.btn-group .btn { border-radius: var(--radius-sm); }

/* ====================================================
   FORMULARIOS
   ==================================================== */

.form-label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}

.form-control, .form-select {
  font-family: inherit;
  font-size: 14.5px;
  padding: 10px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  background: white;
  color: var(--gray-900);
  transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.1);
  outline: none;
}

.form-control:hover:not(:focus), .form-select:hover:not(:focus) {
  border-color: var(--gray-300);
}

.form-control::placeholder { color: var(--gray-400); }
.form-control-lg, .form-select-lg { font-size: 15px; padding: 13px 16px; }
textarea.form-control { resize: vertical; min-height: 80px; }

/* ====================================================
   TABLAS
   ==================================================== */

.table {
  margin: 0;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.table thead th {
  background: var(--gray-50);
  color: var(--gray-600);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}

.table tbody td {
  padding: 14px 16px;
  vertical-align: middle;
  border-bottom: 1px solid var(--gray-100);
  font-size: 14px;
  color: var(--gray-800);
}

.table tbody tr { transition: background 0.15s ease; }
.table tbody tr:hover { background: var(--primary-50); cursor: pointer; }
.table tbody tr:last-child td { border-bottom: none; }

/* ====================================================
   BADGES
   ==================================================== */

.badge {
  font-family: inherit;
  font-weight: 600;
  font-size: 11.5px;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid transparent;
}

.bg-secondary { background: #f3eefa !important; color: #6b5b8e !important; border-color: #e9dff5; }
.bg-info { background: rgba(6, 182, 212, 0.1) !important; color: #0e7490 !important; border-color: rgba(6, 182, 212, 0.2); }
.bg-primary { background: rgba(124, 58, 237, 0.1) !important; color: #6d28d9 !important; border-color: rgba(124, 58, 237, 0.2); }
.bg-warning { background: rgba(251, 191, 36, 0.15) !important; color: #92400e !important; border-color: rgba(251, 191, 36, 0.3); }
.bg-success { background: rgba(16, 185, 129, 0.1) !important; color: #065f46 !important; border-color: rgba(16, 185, 129, 0.2); }
.bg-danger { background: rgba(239, 68, 68, 0.1) !important; color: #991b1b !important; border-color: rgba(239, 68, 68, 0.2); }
.bg-dark { background: rgba(26, 16, 51, 0.1) !important; color: #1a1033 !important; border-color: rgba(26, 16, 51, 0.2); }

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

.status-dot-success { background: #10b981; box-shadow: 0 0 0 3px rgba(16,185,129,0.2); }
.status-dot-warning { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,0.2); animation: pulse-glow 2s infinite; }
.status-dot-danger { background: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,0.2); }
.status-dot-entrada { background: #10b981; }
.status-dot-salida { background: #ef4444; }

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 3px rgba(16,185,129,0.3); }
  50% { box-shadow: 0 0 0 8px rgba(16,185,129,0.1); }
}

/* ====================================================
   AVATARES MÍSTICOS
   ==================================================== */

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
  text-transform: uppercase;
}

.avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.avatar-lg { width: 56px; height: 56px; font-size: 18px; }
.avatar-xl { width: 80px; height: 80px; font-size: 28px; }

.avatar-1 { background: linear-gradient(135deg, #7c3aed, #ec4899); }
.avatar-2 { background: linear-gradient(135deg, #fbbf24, #ec4899); }
.avatar-3 { background: linear-gradient(135deg, #06b6d4, #7c3aed); }
.avatar-4 { background: linear-gradient(135deg, #10b981, #06b6d4); }
.avatar-5 { background: linear-gradient(135deg, #f59e0b, #7c3aed); }
.avatar-6 { background: linear-gradient(135deg, #a855f7, #1a1033); }
.avatar-7 { background: linear-gradient(135deg, #ec4899, #fbbf24); }
.avatar-8 { background: linear-gradient(135deg, #7c3aed, #06b6d4); }
.avatar-9 { background: linear-gradient(135deg, #fbbf24, #ef4444); }
.avatar-10 { background: linear-gradient(135deg, #1a1033, #7c3aed); }

/* ====================================================
   PROGRESS
   ==================================================== */

.progress {
  background: var(--gray-100);
  border-radius: 20px;
  height: 8px;
  overflow: hidden;
}

.progress-bar {
  background: var(--gradient-primary);
  border-radius: 20px;
  transition: width 0.6s ease;
}

/* ====================================================
   TIMELINE
   ==================================================== */

.timeline-item {
  position: relative;
  padding: 16px 20px;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  transition: all 0.2s;
}

.timeline-item:hover {
  border-color: var(--primary-100);
  box-shadow: var(--shadow-md);
  transform: translateX(2px);
}

.timeline-item-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.timeline-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.timeline-icon-nota { background: rgba(124,58,237,0.1); color: var(--primary); }
.timeline-icon-llamada { background: rgba(16,185,129,0.1); color: var(--success); }
.timeline-icon-whatsapp { background: rgba(34,197,94,0.1); color: #16a34a; }
.timeline-icon-email { background: rgba(6,182,212,0.1); color: var(--info); }
.timeline-icon-consulta_presencial { background: rgba(251,191,36,0.15); color: var(--gold-dark); }
.timeline-icon-consulta_online { background: rgba(236,72,153,0.1); color: var(--accent); }
.timeline-icon-cambio_estado { background: rgba(168,85,247,0.1); color: var(--primary-light); }

/* ====================================================
   ALERTAS
   ==================================================== */

.alert {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-size: 14px;
  display: flex;
  align-items: start;
  gap: 12px;
}

.alert-success { background: rgba(16, 185, 129, 0.08); color: #065f46; border-color: rgba(16, 185, 129, 0.2); }
.alert-danger { background: rgba(239, 68, 68, 0.08); color: #991b1b; border-color: rgba(239, 68, 68, 0.2); }
.alert-warning { background: rgba(251, 191, 36, 0.1); color: #92400e; border-color: rgba(251, 191, 36, 0.25); }
.alert-info { background: rgba(124, 58, 237, 0.08); color: #6d28d9; border-color: rgba(124, 58, 237, 0.2); }

/* ====================================================
   TABS
   ==================================================== */

.nav-tabs {
  border-bottom: 2px solid var(--gray-200);
  gap: 4px;
}

.nav-tabs .nav-link {
  color: var(--gray-500);
  font-weight: 600;
  font-size: 14px;
  border: none;
  padding: 12px 18px;
  border-radius: var(--radius) var(--radius) 0 0;
  transition: all 0.2s;
}

.nav-tabs .nav-link:hover:not(.active) {
  color: var(--gray-700);
  background: var(--gray-50);
}

.nav-tabs .nav-link.active {
  color: var(--primary);
  background: transparent;
  border-bottom: 2px solid var(--primary);
  margin-bottom: -2px;
}

.tab-content {
  background: white;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  padding: 24px;
  border: 1px solid var(--gray-200);
  border-top: none;
}

/* ====================================================
   MODALES
   ==================================================== */

.modal-content {
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2xl);
}

.modal-header {
  border-bottom: 1px solid var(--gray-100);
  padding: 20px 24px;
}

.modal-body { padding: 24px; }
.modal-footer { border-top: 1px solid var(--gray-100); padding: 16px 24px; }

/* ====================================================
   BREADCRUMB Y PAGINATION
   ==================================================== */

.breadcrumb {
  background: transparent;
  padding: 0;
  margin-bottom: 18px;
  font-size: 13px;
}

.breadcrumb-item a {
  color: var(--gray-500);
  text-decoration: none;
  font-weight: 500;
}

.breadcrumb-item a:hover { color: var(--primary); }
.breadcrumb-item.active { color: var(--gray-700); font-weight: 600; }

.pagination { gap: 4px; }

.page-link {
  border: 1px solid var(--gray-200);
  color: var(--gray-700);
  font-weight: 600;
  font-size: 13px;
  border-radius: var(--radius) !important;
  padding: 6px 12px;
  background: white;
}

.page-link:hover {
  background: var(--primary-50);
  border-color: var(--primary-100);
  color: var(--primary);
}

.page-item.active .page-link {
  background: var(--gradient-primary);
  border-color: var(--primary);
  color: white;
}

/* ====================================================
   ANIMACIONES
   ==================================================== */

.fade-in { animation: fadeIn 0.5s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.slide-up { animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.card { animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
.card:nth-child(2) { animation-delay: 0.05s; }
.card:nth-child(3) { animation-delay: 0.1s; }
.card:nth-child(4) { animation-delay: 0.15s; }

/* ====================================================
   UTILIDADES
   ==================================================== */

.text-muted { color: var(--gray-500) !important; }
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--gold-dark) !important; }
.text-danger { color: var(--danger) !important; }
.text-info { color: var(--info) !important; }
.text-gold { color: var(--gold-dark) !important; }

.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-gradient-gold {
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.divider { height: 1px; background: var(--gray-200); margin: 24px 0; }

.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-state-icon {
  font-size: 64px;
  color: var(--gray-300);
  margin-bottom: 16px;
}

.empty-state-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}

.empty-state-text {
  color: var(--gray-500);
  font-size: 14px;
}

.quick-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 14.5px;
  width: 100%;
  border: none;
  color: white;
  text-decoration: none;
  transition: all 0.2s;
  margin-bottom: 8px;
}

.quick-action-btn:hover { transform: translateY(-2px); color: white; }

.quick-action-call {
  background: var(--gradient-success);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.quick-action-whatsapp {
  background: linear-gradient(135deg, #25d366, #128c7e);
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.quick-action-email {
  background: var(--gradient-info);
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

/* Lead profile header con tema místico */
.lead-profile-header {
  background: var(--gradient-mystic);
  color: white;
  padding: 32px;
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
  margin-bottom: 20px;
}

.lead-profile-header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(251,191,36,0.2), transparent 70%);
  border-radius: 50%;
}

.lead-profile-header::after {
  content: '✨';
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 40px;
  opacity: 0.3;
  animation: float-icon 4s ease-in-out infinite;
}

.lead-profile-header .avatar {
  border: 4px solid rgba(251,191,36,0.4);
  box-shadow: 0 0 30px rgba(251,191,36,0.3);
}

.search-box { position: relative; }
.search-box i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  pointer-events: none;
}
.search-box input { padding-left: 40px; }

.status-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  margin-bottom: 6px;
  border: 1.5px solid var(--gray-200);
  background: white;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-700);
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
}

.status-btn:hover {
  border-color: var(--primary);
  background: var(--primary-50);
  color: var(--primary-dark);
  transform: translateX(2px);
}

.status-btn-icon { font-size: 16px; }

@media print {
  .sidebar, .topbar, .btn { display: none !important; }
  .main-content { margin-left: 0; }
}

/* ====================================================
   TIMELINE PÚBLICO (estilo historial de caso)
   ==================================================== */

.public-body {
  background: var(--gray-50);
  min-height: 100vh;
}

.public-header {
  background: var(--gradient-cosmic);
  color: white;
  padding: 20px 0;
  box-shadow: var(--shadow-lg);
}

.public-brand {
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.public-brand-icon {
  width: 42px; height: 42px;
  background: var(--gradient-gold);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  box-shadow: 0 4px 14px rgba(201,162,39,0.4);
}

/* Tarjeta de búsqueda */
.search-hero {
  background: var(--gradient-cosmic);
  color: white;
  padding: 60px 20px 90px;
  position: relative;
  overflow: hidden;
}
.search-hero::before {
  content: '⚖️';
  position: absolute;
  font-size: 280px;
  opacity: 0.04;
  right: -40px; top: 50%;
  transform: translateY(-50%);
}
.search-card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2xl);
  padding: 36px;
  max-width: 520px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

/* Línea de tiempo vertical */
.case-timeline {
  position: relative;
  padding-left: 8px;
}
.tl-item {
  position: relative;
  padding-left: 50px;
  padding-bottom: 28px;
}
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: '';
  position: absolute;
  left: 15px; top: 28px;
  bottom: -4px;
  width: 2px;
  background: var(--gray-200);
}
.tl-item:last-child::before { display: none; }
.tl-dot {
  position: absolute;
  left: 0; top: 2px;
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  background: white;
  border: 3px solid var(--gray-300);
  z-index: 1;
}
.tl-dot.done { border-color: var(--success); background: var(--success); color: white; }
.tl-dot.current {
  border-color: var(--gold);
  background: var(--gold);
  color: white;
  box-shadow: 0 0 0 5px rgba(201,162,39,0.2);
  animation: pulse-current 2s infinite;
}
@keyframes pulse-current {
  0%, 100% { box-shadow: 0 0 0 5px rgba(201,162,39,0.2); }
  50% { box-shadow: 0 0 0 10px rgba(201,162,39,0.05); }
}
.tl-content {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}
.tl-content:hover { box-shadow: var(--shadow-md); }
.tl-date {
  font-size: 12px;
  font-weight: 700;
  color: var(--gold-dark);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.tl-title { font-weight: 700; font-size: 15px; color: var(--gray-900); margin: 2px 0 4px; }
.tl-desc { font-size: 14px; color: var(--gray-600); line-height: 1.55; }

/* Barra de progreso de etapas (stepper horizontal) */
.stepper {
  display: flex;
  justify-content: space-between;
  position: relative;
  margin: 30px 0;
}
.stepper::before {
  content: '';
  position: absolute;
  top: 18px; left: 5%; right: 5%;
  height: 3px;
  background: var(--gray-200);
  z-index: 0;
}
.stepper-fill {
  position: absolute;
  top: 18px; left: 5%;
  height: 3px;
  background: var(--gradient-gold);
  z-index: 1;
  transition: width 0.6s ease;
}
.step {
  position: relative;
  z-index: 2;
  text-align: center;
  flex: 1;
}
.step-circle {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: white;
  border: 3px solid var(--gray-300);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 6px;
  font-size: 16px;
  color: var(--gray-400);
}
.step.done .step-circle { border-color: var(--success); background: var(--success); color: white; }
.step.current .step-circle { border-color: var(--gold); background: var(--gold); color: white; box-shadow: 0 0 0 5px rgba(201,162,39,0.2); }
.step-label { font-size: 11px; font-weight: 600; color: var(--gray-500); line-height: 1.3; }
.step.done .step-label, .step.current .step-label { color: var(--gray-800); }

@media (max-width: 640px) {
  .step-label { display: none; }
  .search-card { padding: 24px; }
}
