/* ===== VARIABLES CSS PARA COLORES AZULES ===== */
:root {
  /* Paleta de azules principal */
  --primary-blue: #3b82f6;
  --primary-blue-dark: #2563eb;
  --primary-blue-darker: #1d4ed8;
  --primary-blue-light: #60a5fa;
  --primary-blue-lighter: #93c5fd;
  
  /* Azules de soporte */
  --secondary-blue: #1e40af;
  --accent-blue: #06b6d4;
  --light-blue: #e0f2fe;
  --very-light-blue: #f0f9ff;
  
  /* Grises y neutros */
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  
  /* Estados */
  --success-green: #10b981;
  --warning-yellow: #f59e0b;
  --error-red: #ef4444;
  --info-cyan: #06b6d4;
  
  /* Fondos y superficies */
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-hover: #f1f5f9;
  
  /* Texto */
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  
  /* Bordes y sombras */
  --border-color: #e2e8f0;
  --border-hover: #cbd5e1;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  
  /* Transiciones */
  --transition-fast: 0.15s ease-in-out;
  --transition-normal: 0.3s ease-in-out;
  --transition-slow: 0.5s ease-in-out;
}

/* Reset básico */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Fuente y fondo principal */
body {
  font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, var(--very-light-blue) 0%, var(--light-blue) 100%);
  color: var(--text-primary);
  line-height: 1.6;
  padding-bottom: 50px;
  min-height: 100vh;
}

/* Encabezado */
header {
  position: relative;
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
  color: white;
  padding: 24px 40px;
  box-shadow: var(--shadow-lg);
  border-bottom: 3px solid var(--primary-blue-darker);
}

header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, 
    rgba(255,255,255,0.1) 25%, 
    transparent 25%, 
    transparent 50%, 
    rgba(255,255,255,0.1) 50%, 
    rgba(255,255,255,0.1) 75%, 
    transparent 75%);
  background-size: 20px 20px;
  pointer-events: none;
}

.user-info {
  position: absolute;
  top: 24px;
  right: 40px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  color: var(--text-primary);
  padding: 12px 20px;
  border-radius: 25px;
  box-shadow: var(--shadow-md);
  font-size: 1rem;
  font-weight: 600;
  z-index: 10;
  transition: all var(--transition-normal);
  border: 2px solid rgba(255,255,255,0.3);
}

.user-info:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  background: rgba(255, 255, 255, 1);
}

header h1 {
  font-size: 32px;
  font-weight: 700;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
  letter-spacing: -0.025em;
  z-index: 1;
  position: relative;
}

/* Menú de navegación */
nav ul.menu {
  display: flex;
  gap: 8px;
  margin-top: 20px;
  list-style: none;
  flex-wrap: wrap;
  z-index: 1;
  position: relative;
}

nav ul.menu li {
  cursor: pointer;
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  transition: all var(--transition-normal);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-weight: 500;
  font-size: 14px;
}

nav ul.menu li:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

nav ul.menu li.active {
  background: rgba(255, 255, 255, 0.9);
  color: var(--primary-blue);
  font-weight: 600;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Secciones */
.section {
  display: none;
  padding: 32px 40px;
  max-width: 1400px;
  margin: 0 auto;
}

/* Grupo de búsqueda - EXCEPTO para resúmenes */
.search-group:not(.resumenes-preserve) {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  transition: all var(--transition-normal);
}

.search-group:not(.resumenes-preserve):hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-blue-light);
}

.search-group:not(.resumenes-preserve) h3 {
  margin-bottom: 16px;
  color: var(--primary-blue);
  font-weight: 600;
  font-size: 1.25rem;
}

/* ===== PRESERVAR ESTILOS ORIGINALES DE RESÚMENES DE PLIEGOS ===== */

/* Sección: Resúmenes de pliegos - MANTENER ESTILOS ORIGINALES */
#resumenesSection .search-group,
#resumenesSection .resumenes-preserve,
#analisisPDFSection {
  background: white;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 25px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

#resumenesSection h3 {
  margin-bottom: 15px;
  color: #ff6600; /* MANTENER NARANJA ORIGINAL */
}

/* ===== RESÚMENES DE PLIEGOS - DISEÑO ORIGINAL ===== */

.resumen-card-modern {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
  overflow: hidden;
  transition: all 0.3s ease;
  border: 1px solid #e5e7eb;
}

.resumen-card-modern:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.resumen-card-header {
  padding: 20px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.resumen-card-info {
  flex: 1;
  min-width: 0;
}

.resumen-titulo-principal {
  margin-bottom: 12px;
}

.resumen-titulo {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 8px 0;
  line-height: 1.4;
}

.resumen-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge-primary {
  background-color: #dbeafe;
  color: #1d4ed8;
}

.badge-secondary {
  background-color: #f3f4f6;
  color: #6b7280;
}

.resumen-organo {
  margin-bottom: 12px;
  padding: 10px;
  background: rgba(255, 102, 0, 0.05); /* MANTENER BASE NARANJA */
  border-left: 3px solid #ff6600; /* MANTENER NARANJA ORIGINAL */
  border-radius: 0 6px 6px 0;
}

.organo-label {
  font-size: 0.875rem;
  color: #6b7280;
  font-weight: 500;
}

.organo-nombre {
  font-size: 0.875rem;
  color: #1f2937;
  font-weight: 600;
  margin-left: 8px;
}

.resumen-metadata {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.metadata-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: #6b7280;
}

.metadata-icon {
  width: 14px;
  height: 14px;
}

.resumen-card-actions {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.action-btn {
  padding: 8px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.action-btn:hover {
  transform: translateY(-1px);
}

.action-btn-primary {
  background: #ff6600; /* MANTENER NARANJA ORIGINAL */
  color: white;
}

.action-btn-primary:hover {
  background: #e55a00; /* MANTENER NARANJA OSCURO ORIGINAL */
}

.action-btn-primary.active {
  background: #cc4d00; /* MANTENER NARANJA MUY OSCURO ORIGINAL */
}

.action-btn-secondary {
  background: #f3f4f6;
  color: #6b7280;
}

.action-btn-secondary:hover {
  background: #e5e7eb;
  color: #374151;
}

.action-btn-danger {
  background: #fef2f2;
  color: #dc2626;
}

.action-btn-danger:hover {
  background: #fee2e2;
  color: #b91c1c;
}

.action-icon {
  width: 16px;
  height: 16px;
}

.toggle-icon {
  transition: transform 0.2s ease;
}

.resumen-detalle-modern {
  padding: 0;
  background: white;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    max-height: 0;
  }
  to {
    opacity: 1;
    max-height: 1000px;
  }
}

.resumen-content-section,
.resumen-actions-section,
.thoria-section {
  padding: 20px;
  border-bottom: 1px solid #f3f4f6;
}

.thoria-section {
  border-bottom: none;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 16px;
}

.section-icon {
  width: 18px;
  height: 18px;
  color: #ff6600; /* MANTENER NARANJA ORIGINAL */
}

.resumen-pliego-content {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #374151;
}

.actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.modern-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border: none;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.modern-btn:hover {
  transform: translateY(-1px);
}

.modern-btn-primary {
  background: #ff6600; /* MANTENER NARANJA ORIGINAL */
  color: white;
}

.modern-btn-primary:hover {
  background: #e55a00; /* MANTENER NARANJA OSCURO ORIGINAL */
}

.modern-btn-secondary {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
}

.modern-btn-secondary:hover {
  background: #e5e7eb;
}

.btn-icon {
  width: 16px;
  height: 16px;
}

/* Thoria Chat Styles para resúmenes */
#resumenesSection .thoria-float-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #ff6600 0%, #ff9900 100%); /* MANTENER GRADIENTE NARANJA */
  color: white;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
}

#resumenesSection .thoria-float-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 102, 0, 0.3); /* SOMBRA NARANJA */
}

/* ===== FIN DE PRESERVACIÓN DE RESÚMENES ===== */

/* Botones generales (EXCEPTO en resúmenes) */
button:not(.resumen-card-modern button):not(.action-btn):not(.modern-btn):not(#resumenesSection .thoria-float-btn) {
  padding: 12px 24px;
  margin: 6px 6px 6px 0;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
  font-size: 14px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

button:not(.resumen-card-modern button):not(.action-btn):not(.modern-btn):not(#resumenesSection .thoria-float-btn):hover {
  background: linear-gradient(135deg, var(--primary-blue-dark) 0%, var(--primary-blue-darker) 100%);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

button:not(.resumen-card-modern button):not(.action-btn):not(.modern-btn):not(#resumenesSection .thoria-float-btn):active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

button:not(.resumen-card-modern button):not(.action-btn):not(.modern-btn):not(#resumenesSection .thoria-float-btn):disabled {
  background: var(--gray-300);
  color: var(--gray-500);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Efecto ripple para botones generales */
button:not(.resumen-card-modern button):not(.action-btn):not(.modern-btn):not(#resumenesSection .thoria-float-btn)::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transition: width 0.3s, height 0.3s, top 0.3s, left 0.3s;
  transform: translate(-50%, -50%);
}

button:not(.resumen-card-modern button):not(.action-btn):not(.modern-btn):not(#resumenesSection .thoria-float-btn):active::before {
  width: 300px;
  height: 300px;
}

/* 1. Botones de acciones del resumen: 📥 PDF y ✉️ Email */
.resumen-acciones button {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  background: linear-gradient(120deg, #ff6600 0%, #ff9900 100%); /* MANTENER NARANJA */
  color: #fff;
  border: none;
  border-radius: 0.5rem;
  padding: 0.5em 1em;
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all var(--transition-normal);
}
.resumen-acciones button:hover {
  background: linear-gradient(120deg, #e55a00 0%, #ff6600 100%); /* MANTENER NARANJA */
  transform: translateY(-2px);
}

/* 2. Botón "Exportar chat" en la cabecera de Thoria */
.thoria-header .thoria-export {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  background: #fff;
  color: var(--primary-blue);
  border: 2px solid var(--primary-blue);
  border-radius: 0.5rem;
  padding: 0.4em 0.8em;
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all var(--transition-normal);
}
.thoria-header .thoria-export:hover {
  background: var(--primary-blue);
  color: #fff;
  transform: translateY(-2px);
}

/* 3. Botón "Enviar" en el área de entrada de Thoria */
.thoria-input-area .thoria-send {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  background: var(--primary-blue);
  color: #fff;
  border: none;
  border-radius: 0.5rem;
  padding: 0.5em 1em;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all var(--transition-normal);
}
.thoria-input-area .thoria-send:hover {
  background: var(--primary-blue-dark);
  transform: translateY(-2px);
}

/* Pseudo-iconos para mayor consistencia */
.resumen-acciones button.descargarResumenHistorico::before {
  content: "📥";
}
.resumen-acciones button.emailResumenHistorico::before {
  content: "✉️";
}
.thoria-header .thoria-export::before {
  content: "💾";
}
.thoria-input-area .thoria-send::before {
  content: "➡️";
}
  
/* Inputs y select */
input, select, textarea {
  padding: 12px 16px;
  margin: 6px 12px 12px 0;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  font-size: 14px;
  transition: all var(--transition-normal);
  background: var(--bg-secondary);
  color: var(--text-primary);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  background: var(--very-light-blue);
}

input[type="date"], input[type="time"], input[type="number"], input[type="email"] {
  width: 200px;
}

/* Resultados */
.results {
  margin-top: 20px;
}

.results table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-secondary);
  box-shadow: var(--shadow-md);
  border-radius: 12px;
  overflow: hidden;
}

.results th, .results td {
  padding: 16px 20px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.results th {
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
  color: white;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 12px;
}

.results tr:nth-child(even) {
  background: var(--gray-50);
}

.results tr:hover {
  background: var(--light-blue);
  transition: background-color var(--transition-fast);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.3s ease-out;
}

.modal-content {
  background: var(--bg-secondary);
  margin: 80px auto;
  padding: 32px;
  border-radius: 20px;
  width: 90%;
  max-width: 500px;
  box-shadow: var(--shadow-lg);
  position: relative;
  animation: slideUp 0.3s ease-out;
  border: 1px solid var(--border-color);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { 
    opacity: 0;
    transform: translateY(50px) scale(0.9);
  }
  to { 
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-content h3 {
  margin-bottom: 20px;
  color: var(--primary-blue);
  font-weight: 600;
  font-size: 1.5rem;
}

.modal-content input[type="email"] {
  width: 100%;
  margin-bottom: 10px;
}

.modal .close {
  position: absolute;
  right: 24px;
  top: 20px;
  font-size: 28px;
  cursor: pointer;
  color: var(--gray-400);
  transition: color var(--transition-fast);
}

.modal .close:hover {
  color: var(--error-red);
}

/* Listado de búsquedas programadas */
#scheduledList ul {
  list-style: none;
  padding: 0;
}

#scheduledList li {
  margin: 10px 0;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

#scheduledList li:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-blue-light);
}

/* Dashboard de estadísticas */
.dashboard-section {
  padding: 32px 40px;
  background: var(--bg-secondary);
  margin-bottom: 32px;
  border-radius: 20px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
}

.dashboard-section h2 {
  margin-bottom: 24px;
  color: var(--text-primary);
  font-weight: 600;
}

.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.dashboard-cards .card {
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
  color: white;
  padding: 24px;
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  text-align: center;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.dashboard-cards .card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
  transform: rotate(45deg);
  transition: all var(--transition-slow);
}

.dashboard-cards .card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--shadow-lg);
}

.dashboard-cards .card:hover::before {
  animation: shimmer 1.5s ease-in-out;
}

@keyframes shimmer {
  0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
  100% { transform: translateX(200%) translateY(200%) rotate(45deg); }
}

.dashboard-cards .card h3 {
  margin-bottom: 12px;
  font-size: 18px;
  font-weight: 600;
}

.dashboard-cards .card p {
  font-size: 28px;
  font-weight: 700;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.badge.active {
  background: linear-gradient(135deg, var(--success-green) 0%, #059669 100%);
  color: white;
}

.badge.inactive {
  background: linear-gradient(135deg, var(--error-red) 0%, #dc2626 100%);
  color: white;
}

.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
}

.toast {
  opacity: 0;
  transform: translateX(100px);
  transition: all var(--transition-normal);
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 16px 24px;
  margin-bottom: 12px;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  min-width: 250px;
  max-width: 400px;
  font-size: 0.9em;
  border-left: 4px solid var(--primary-blue);
}

.toast.show {
  opacity: 1;
  transform: translateX(0);
}

.toast-success {
  border-left-color: var(--success-green);
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.toast-error {
  border-left-color: var(--error-red);
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
}

.toast-info {
  border-left-color: var(--info-cyan);
  background: linear-gradient(135deg, var(--very-light-blue) 0%, var(--light-blue) 100%);
}

#loginSection {
  max-width: 450px;
  margin: 80px auto;
  padding: 32px;
  background: var(--bg-card);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
}

#loginSection h2 {
  text-align: center;
  color: var(--primary-blue);
  margin-bottom: 24px;
  font-weight: 600;
}

#loginForm {
  display: flex;
  flex-direction: column;
}

#loginForm input {
  margin-bottom: 15px;
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  transition: all var(--transition-normal);
}

#loginForm input:focus {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#loginForm button {
  padding: 12px;
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
  color: white;
  border: none;
  cursor: pointer;
  border-radius: 12px;
  font-weight: 600;
  transition: all var(--transition-normal);
}

#loginForm button:hover {
  background: linear-gradient(135deg, var(--primary-blue-dark) 0%, var(--primary-blue-darker) 100%);
  transform: translateY(-2px);
}

.error-message {
  color: var(--error-red);
  text-align: center;
  margin-top: 10px;
  padding: 8px;
  background: #fef2f2;
  border-radius: 8px;
  border: 1px solid #fecaca;
}

.admin-only {
  display: none;
}

#tablaUsuarios {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  background: var(--bg-card);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

#tablaUsuarios th, #tablaUsuarios td {
  border-bottom: 1px solid var(--border-color);
  padding: 12px 16px;
  text-align: left;
}

#tablaUsuarios th {
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
  color: white;
  font-weight: 600;
}

#tablaUsuarios tr:nth-child(even) {
  background: var(--gray-50);
}

#tablaUsuarios tr:hover {
  background: var(--light-blue);
}

.dashboard-charts {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 40px;
  padding: 0 20px;
}

.chart-container {
  flex: 1 1 300px;
  max-width: 400px;
  background: var(--bg-card);
  padding: 20px;
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  text-align: center;
  border: 1px solid var(--border-color);
}

.chart-container h3 {
  margin-bottom: 15px;
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 600;
}

/* 🎯 Modal: Resumen del pliego */
#resumenPliegoModal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

#resumenPliegoModal .modal-content {
  background-color: var(--bg-card);
  margin: 5% auto;
  padding: 30px;
  border-radius: 20px;
  width: 90%;
  max-width: 800px;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s ease-in-out;
  position: relative;
  border: 1px solid var(--border-color);
}

#contenidoResumenPliego {
  white-space: pre-wrap;
  line-height: 1.6;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
}

#resumenPliegoModal .modal-buttons {
  margin-top: 20px;
  text-align: right;
}

#resumenPliegoModal button {
  margin-left: 10px;
  padding: 8px 16px;
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: all var(--transition-normal);
}

#resumenPliegoModal button:hover {
  background: linear-gradient(135deg, var(--primary-blue-dark) 0%, var(--primary-blue-darker) 100%);
  transform: translateY(-2px);
}

#contenidoResumenPliego table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  box-shadow: var(--shadow-sm);
  border-radius: 8px;
  overflow: hidden;
}

#contenidoResumenPliego th,
#contenidoResumenPliego td {
  border: 1px solid var(--border-color);
  padding: 10px;
  text-align: left;
}

#contenidoResumenPliego th {
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
  color: white;
  font-weight: 600;
}

#contenidoResumenPliego tr:nth-child(even) {
  background-color: var(--gray-50);
}

#tablaResumenesBody {
  font-family: 'Inter', Arial, sans-serif;
  font-size: 14px;
}

#tablaResumenesBody table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 10px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

#tablaResumenesBody th,
#tablaResumenesBody td {
  border: 1px solid var(--border-color);
  padding: 8px;
}

#tablaResumenesBody th {
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
  color: #fff;
  text-align: left;
  font-weight: 600;
}

#tablaResumenesBody tr:nth-child(even) {
  background-color: var(--gray-50);
}

#tablaResumenesBody tr:hover {
  background-color: var(--light-blue);
}

.resumen-contenido {
  font-family: 'Inter', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  text-align: left;
  padding: 10px;
  background-color: var(--bg-card);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  max-height: 350px;
  overflow: auto;
}

.resumen-contenido p {
  margin-bottom: 10px;
  text-align: justify;
}

.resumen-contenido table {
  width: 100%;
  border-collapse: collapse;
  margin: 15px 0;
  border-radius: 8px;
  overflow: hidden;
}

.resumen-contenido th,
.resumen-contenido td {
  border: 1px solid var(--border-color);
  padding: 8px;
  vertical-align: middle;
}

.resumen-contenido th {
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
  color: #fff;
  text-align: left;
  font-weight: 600;
}

.resumen-contenido tr:nth-child(even) {
  background-color: var(--gray-50);
}

.resumen-contenido tr:hover {
  background-color: var(--light-blue);
}

.resumen-contenido h1,
.resumen-contenido h2,
.resumen-contenido h3,
.resumen-contenido h4,
.resumen-contenido h5,
.resumen-contenido h6 {
  margin-top: 15px;
  margin-bottom: 10px;
  color: var(--primary-blue);
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.9) 0%, rgba(29, 78, 216, 0.95) 100%);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 9999;
  color: white;
}

.overlay-content {
  text-align: center;
  font-size: 1.8rem;
  color: white;
  font-family: 'Inter', sans-serif;
  animation: slideUp 0.4s ease-in-out;
}

.spinner {
  font-size: 6rem;
  animation: bounce 1.5s infinite alternate ease-in-out;
  margin-bottom: 20px;
  filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.3));
}

@keyframes bounce {
  from { transform: translateY(0) scale(1); }
  to { transform: translateY(-20px) scale(1.1); }
}

.funny-text {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.9);
  margin-top: 16px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

.result-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 20px;
  margin: 16px auto;
  box-shadow: var(--shadow-md);
  max-width: 800px;
  transition: all var(--transition-normal);
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
}

.result-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(to bottom, var(--primary-blue), var(--secondary-blue));
}

.result-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-blue-light);
}

.result-card h3 {
  margin-top: 0;
  font-size: 1.2em;
  color: var(--text-primary);
  font-weight: 600;
}

.result-card p {
  margin: 6px 0;
  font-size: 0.95em;
  color: var(--text-secondary);
}

.result-card p span.emoji {
  margin-right: 6px;
  font-size: 1.1em;
}

.result-card a {
  display: inline-block;
  margin-top: 8px;
  color: var(--primary-blue);
  text-decoration: none;
  font-weight: bold;
  transition: color var(--transition-fast);
}

.result-card a:hover {
  color: var(--primary-blue-dark);
  text-decoration: underline;
}

.result-card button {
  margin-top: 12px;
  padding: 8px 16px;
  background: linear-gradient(135deg, var(--error-red) 0%, #dc2626 100%);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all var(--transition-normal);
}

.result-card button:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  transform: translateY(-2px);
}

.resumen-header span::before {
  content: "📄 ";
}

.resumen-bloque {
  margin-bottom: 12px;
  background: var(--bg-card);
  padding: 10px 12px;
  border-left: 5px solid var(--primary-blue);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.resumen-bloque strong {
  display: block;
  font-weight: bold;
  margin-bottom: 6px;
  color: var(--primary-blue);
  font-size: 15px;
}

button[disabled] {
  background-color: var(--gray-300) !important;
  color: var(--gray-500) !important;
  pointer-events: auto !important;
  transform: none !important;
  box-shadow: none !important;
}

#gptTokenSection {
  margin: 20px;
  padding: 20px;
  background: var(--very-light-blue);
  border-radius: 16px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.slide-toggle {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease-out;
}

.slide-toggle.open {
  max-height: 800px;
}

/* 📱 Ajustes responsive para móviles */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }

  header, .section, .search-group, .dashboard-section {
    padding: 15px;
  }

  .user-info {
    position: static;
    margin-top: 10px;
    margin-bottom: -10px;
    text-align: center;
    font-size: 1rem;
  }

  nav ul.menu {
    flex-direction: column;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
  }

  nav ul.menu li {
    font-size: 14px;
    padding: 8px 10px;
  }

  header h1 {
    font-size: 22px;
    text-align: center;
  }

  #logoutBtn {
    margin-top: 10px;
    width: 100%;
  }

  .dashboard-cards,
  .dashboard-charts {
    flex-direction: column;
    align-items: center;
    padding: 0;
  }

  .dashboard-cards .card {
    width: 90%;
    max-width: 300px;
  }

  .chart-container {
    width: 100%;
    max-width: 100%;
  }

  .modal-content {
    width: 95%;
    padding: 15px;
  }

  .result-card,
  .resumen-card {
    width: 100%;
    margin: 10px 5px;
    padding: 12px;
  }

  input, select, button,
  input[type="date"],
  input[type="time"],
  input[type="number"],
  input[type="email"] {
    width: 100%;
    margin-bottom: 10px;
  }

  .filters,
  form {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .filters input,
  .filters select,
  .filters button,
  form input,
  form select,
  form button {
    width: 100%;
    margin: 8px 0;
  }

  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .resumen-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

.btn-verde {
  background: linear-gradient(135deg, var(--success-green) 0%, #059669 100%);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.btn-verde:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-2px);
}

.btn-rojo {
  background: linear-gradient(135deg, var(--error-red) 0%, #dc2626 100%);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.btn-rojo:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  transform: translateY(-2px);
}

@keyframes aparecerSuave {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* — Dropdown genérico (oculto por defecto, en fila al activarse) — */
.search-group {
  position: relative;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  background: var(--bg-card);
  padding: 10px;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  z-index: 100;
  flex-wrap: wrap;
  gap: 8px;
  border: 1px solid var(--border-color);
}

/* Sólo cuando el toggle lleva .active mostramos flex */
.dropdown-toggle.active + .dropdown-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* — Botón "en obras" gris — */
.under-construction {
  background-color: var(--gray-400) !important;
  color: #fff !important;
  cursor: not-allowed !important;
}

/* — Alinear Estado, Andalucía y Euskadi en una fila — */
#buscarAhora > .search-group {
  display: inline-block;
  vertical-align: top;
  margin-right: 20px;
  margin-bottom: 0;
}

.search-row {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.search-row .search-group {
  margin-bottom: 0 !important;
}

/* Layout en fila para programar búsqueda */
.search-row.schedule-row {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.search-row.schedule-row .search-group {
  margin-bottom: 0 !important;
}

.dropdown-menu {
  min-width: 200px;
  max-height: 300px;
  overflow-y: auto;
}

/* — Secciones del formulario — */
.form-section {
  background: var(--bg-card);
  padding: 15px 20px;
  border-radius: 12px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

/* Títulos */
.form-section h3 {
  margin-bottom: 12px;
  font-size: 1.1em;
  color: var(--text-primary);
  font-weight: 600;
}

/* Días de la semana */
.days-controls {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

.btn-pill {
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
  color: #fff;
  border: none;
  border-radius: 30px;
  padding: 8px 16px;
  cursor: pointer;
  transition: all var(--transition-normal);
  font-size: 0.95em;
}

.btn-pill:hover {
  background: linear-gradient(135deg, var(--primary-blue-dark) 0%, var(--primary-blue-darker) 100%);
  transform: translateY(-2px);
}

.day-checkboxes {
  display: flex;
  gap: 10px;
}

.day-checkboxes label {
  background: var(--gray-100);
  padding: 6px 10px;
  border-radius: 20px;
  cursor: pointer;
  transition: all var(--transition-normal);
  font-size: 0.9em;
  border: 1px solid var(--border-color);
}

.day-checkboxes input {
  display: none;
}

.day-checkboxes input:checked + * {
  background: linear-gradient(135deg, var(--success-green) 0%, #059669 100%);
  color: #fff;
  border-color: var(--success-green);
}

/* Horario */
.time-controls {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.time-group label,
.freq-group label {
  display: flex;
  flex-direction: column;
  font-size: 0.95em;
  color: var(--text-primary);
  font-weight: 500;
}

.time-group input,
.freq-group input {
  margin-top: 4px;
  padding: 6px 8px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.95em;
  width: 120px;
}

.freq-group input {
  width: 80px;
}

.email-section {
  grid-template-columns: auto auto; 
  column-gap: 10px;
}

.email-section input {
  max-width: 200px;
}

.btn-primary.full-width {
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
  color: #fff;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  font-size: 1em;
  cursor: pointer;
  width: auto;
  transition: all var(--transition-normal);
}

.btn-primary.full-width:hover {
  background: linear-gradient(135deg, var(--primary-blue-dark) 0%, var(--primary-blue-darker) 100%);
  transform: translateY(-2px);
}

.day-checkboxes label.selected {
  background: linear-gradient(135deg, var(--success-green) 0%, #059669 100%);
  color: #fff;
}

/* Envuelve tu tabla para scrolling horizontal en móvil */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

/* Estilos base */
.estado-table {
  width: 100%;
  border-collapse: collapse;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

/* Header */
.estado-table thead {
  background: linear-gradient(90deg, var(--primary-blue), var(--primary-blue-dark));
  color: #fff;
}

.estado-table th {
  position: sticky;
  top: 0;
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

/* Filas alternas */
.estado-table tbody tr:nth-child(even) {
  background-color: var(--gray-50);
}

/* Hover sobre fila */
.estado-table tbody tr:hover {
  background-color: var(--light-blue);
  transition: background-color var(--transition-fast);
}

/* Celdas */
.estado-table td {
  padding: 12px 16px;
  vertical-align: middle;
  font-size: 0.9rem;
  color: var(--text-primary);
}

/* Botones dentro de la tabla */
.estado-table .abrir-btn,
.estado-table .eliminar-btn {
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
  border: none;
  color: white;
  padding: 6px 10px;
  margin-right: 4px;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.estado-table .eliminar-btn {
  background: linear-gradient(135deg, var(--error-red) 0%, #dc2626 100%);
}

.estado-table .abrir-btn:hover,
.estado-table .eliminar-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* Base del botón */
.toggle-btn {
  cursor: pointer;
  border: none;
  background: transparent;
  font-size: 1.2rem;
  transition: transform var(--transition-fast);
  outline: none;
}

/* Efecto hover: agranda un poco */
.toggle-btn:hover {
  transform: scale(1.3);
}

/* Pulso cuando está activo */
.toggle-btn.active {
  animation: pulse 1.5s infinite ease-in-out;
}

details[open] > summary {
  font-weight: bold;
  color: var(--text-primary);
}
summary::-webkit-details-marker {
  display: none;
}
summary::before {
  content: '▶';
  display: inline-block;
  margin-right: 0.5rem;
  transition: transform .2s ease;
  color: var(--primary-blue);
}
details[open] summary::before {
  transform: rotate(90deg);
}

.username-badge {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary-blue);
  background-color: var(--light-blue);
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
}

/* Ajuste de ancho del menú de notificaciones */
#notifMenu {
  width: auto !important;
  min-width: 200px;
  max-width: 320px;
  background-color: var(--bg-card) !important;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
}

/* El <ul> ajusta también su ancho al contenido */
#notifMenu ul {
  width: auto;
}

/* Hacer que el <li> cambie de fondo al pasar el ratón */
#notifMenu li:hover {
  background-color: var(--bg-hover);
}

/* Estados de elementos mejorados */
.estado-activo {
  background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
  color: var(--success-green);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid #86efac;
}

.estado-cerrado {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: var(--error-red);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid #fca5a5;
}

.estado-adjudicado {
  background: linear-gradient(135deg, var(--light-blue) 0%, #bfdbfe 100%);
  color: var(--primary-blue);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid #93c5fd;
}

/* Scrollbars personalizados */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--gray-100);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, var(--primary-blue-dark) 0%, var(--primary-blue-darker) 100%);
}

/* Selección de texto */
::selection {
  background: var(--primary-blue-light);
  color: white;
}

::-moz-selection {
  background: var(--primary-blue-light);
  color: white;
}

/* Estilos adicionales para mejor compatibilidad */
.loading {
  opacity: 0.6;
  pointer-events: none;
  position: relative;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid var(--primary-blue);
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Mejoras para elementos interactivos */
.interactive-element {
  transition: all var(--transition-normal);
}

.interactive-element:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Estados focus mejorados */
button:focus,
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--primary-blue);
  outline-offset: 2px;
}

/* Animaciones de entrada */
.fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

.slide-in-up {
  animation: slideInUp 0.5s ease-out;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mejoras para accesibilidad */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Estados de carga específicos */
.btn-loading {
  position: relative;
  color: transparent !important;
}

.btn-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Mejoras para elementos de formulario */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: var(--text-primary);
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  transition: all var(--transition-normal);
  background: var(--bg-secondary);
}

.form-control:focus {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Utilidades de espaciado */
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-5 { margin-top: 1.25rem; }
.mt-6 { margin-top: 1.5rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 1.25rem; }
.mb-6 { margin-bottom: 1.5rem; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }

/* Utilidades de texto */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: var(--primary-blue); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success-green); }
.text-warning { color: var(--warning-yellow); }
.text-error { color: var(--error-red); }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.font-normal { font-weight: 400; }

/* Utilidades de display */
.d-none { display: none; }
.d-block { display: block; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

/* Utilidades de flexbox */
.flex-row { flex-direction: row; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-nowrap { flex-wrap: nowrap; }

.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }

.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.items-stretch { align-items: stretch; }

/* Utilidades de grid */
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-5 { gap: 1.25rem; }
.gap-6 { gap: 1.5rem; }

/* Variantes de botones adicionales */
.btn-outline-primary {
  background: transparent;
  color: var(--primary-blue);
  border: 2px solid var(--primary-blue);
}

.btn-outline-primary:hover {
  background: var(--primary-blue);
  color: white;
}

.btn-outline-secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 2px solid var(--border-color);
}

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

/* Alertas y mensajes */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  border-left: 4px solid;
}

.alert-primary {
  background: var(--very-light-blue);
  border-left-color: var(--primary-blue);
  color: var(--primary-blue-darker);
}

.alert-success {
  background: #f0fdf4;
  border-left-color: var(--success-green);
  color: #166534;
}

.alert-warning {
  background: #fefce8;
  border-left-color: var(--warning-yellow);
  color: #92400e;
}

.alert-error {
  background: #fef2f2;
  border-left-color: var(--error-red);
  color: #991b1b;
}

/* Mejoras finales para la consistencia */
.card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: all var(--transition-normal);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-header {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.card-title {
  margin: 0;
  color: var(--text-primary);
  font-weight: 600;
}

.card-body {
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Mejoras para impresión */
@media print {
  .no-print {
    display: none !important;
  }
  
  .print-break {
    page-break-after: always;
  }
  
  * {
    box-shadow: none !important;
    text-shadow: none !important;
  }
  
  body {
    background: white !important;
    color: black !important;
  }
}

/* Estilos para elementos específicos de la aplicación */
.notification-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--error-red);
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: bold;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

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

.status-indicator.online {
  background: var(--success-green);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.status-indicator.offline {
  background: var(--gray-400);
}

.status-indicator.busy {
  background: var(--warning-yellow);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

/* Mejoras finales para la experiencia del usuario */
.smooth-transition {
  transition: all var(--transition-normal);
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.clickable {
  cursor: pointer;
  user-select: none;
}

.text-gradient {
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== NUEVO DISEÑO KANBAN MODERNO - TEMA OSCURO ELEGANTE ===== */

/* ===== TABLERO PRINCIPAL ===== */
/* ===== KANBAN LIMPIO Y FUNCIONAL - SIN APILAMIENTO ===== */

/* 1. TABLERO PRINCIPAL */
.kanban-board-stacked {
  display: flex;
  gap: 1.5rem;
  padding: 2rem;
  overflow-x: auto;
  min-height: 700px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
  border-radius: 1.5rem;
  position: relative;
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* 2. COLUMNAS */
.kanban-column-stacked {
  min-width: 380px;
  max-width: 420px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 1.25rem;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: all 0.3s ease;
}

.kanban-column-stacked:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 12px 40px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* 3. HEADER DE COLUMNA */
.kanban-column-header-stacked {
  padding: 1.5rem 1.25rem 1rem;
  position: relative;
  z-index: 10;
}

.kanban-column-title-stacked {
  font-weight: 700;
  font-size: 0.95rem;
  color: white;
  text-align: center;
  padding: 1rem 1.25rem;
  border-radius: 1rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
}

.kanban-column-count-stacked {
  background: rgba(255, 255, 255, 0.95);
  color: #1e293b;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.5rem 1rem;
  border-radius: 1.5rem;
  text-align: center;
  margin-top: 0.75rem;
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 4. CONTENEDOR DE TARJETAS - SCROLL LIMPIO */
.kanban-cards-stack-container {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  max-height: 600px;
  position: relative;
}

/* Scroll personalizado */
.kanban-cards-stack-container::-webkit-scrollbar {
  width: 6px;
}

.kanban-cards-stack-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.kanban-cards-stack-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

.kanban-cards-stack-container::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* 5. LISTA DE TARJETAS - SIMPLE Y FUNCIONAL */
.card-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

/* 6. TARJETAS INDIVIDUALES - DISEÑO LIMPIO */
.kanban-card-stacked {
  position: relative;
  width: 100%;
  background: linear-gradient(145deg, 
    rgba(255, 255, 255, 0.96) 0%, 
    rgba(255, 255, 255, 0.92) 100%);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 0.75rem;
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.1),
    0 1px 3px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  min-height: 120px;
}

/* Hover suave y elegante */
.kanban-card-stacked:hover {
  transform: translateY(-4px);
  box-shadow: 
    0 12px 30px rgba(0, 0, 0, 0.15),
    0 0 0 2px rgba(59, 130, 246, 0.3);
  background: linear-gradient(145deg, 
    rgba(255, 255, 255, 0.98) 0%, 
    rgba(255, 255, 255, 0.95) 100%);
}

/* 7. CONTENIDO DE LA TARJETA */
.kanban-card-content-stacked {
  position: relative;
  width: 100%;
  height: 100%;
}

/* 8. VISTA PRINCIPAL - SIEMPRE VISIBLE */
.card-preview {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 120px;
}

.card-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.card-preview-expediente {
  font-weight: 700;
  color: white;
  font-size: 0.8rem;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  padding: 0.4rem 0.8rem;
  border-radius: 0.6rem;
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  box-shadow: 0 3px 8px rgba(59, 130, 246, 0.3);
  white-space: nowrap;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-preview-status {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  box-shadow: 
    0 0 0 2px white,
    0 0 0 4px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

.card-preview-title {
  color: #1f2937;
  font-size: 0.95rem;
  line-height: 1.4;
  font-weight: 600;
  margin: 0 0 0.75rem 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-wrap: break-word;
  hyphens: auto;
}

.card-preview-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.card-preview-organismo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: #4b5563;
  background: rgba(0, 0, 0, 0.03);
  padding: 0.4rem 0.6rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.card-preview-deadline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: #4b5563;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  padding: 0.6rem;
  border-radius: 0.6rem;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.card-preview-days {
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 0.4rem;
  background: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

/* 9. BOTONES DE ACCIÓN - SIEMPRE VISIBLES EN HOVER */
.card-preview-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: auto;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
}

.kanban-card-stacked:hover .card-preview-actions {
  opacity: 1;
  transform: translateY(0);
}

.btnAvanzarFase,
.btnRetrocederFase {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0.5rem 0.75rem !important;
  border-radius: 0.5rem !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  border: none !important;
  cursor: pointer !important;
  min-width: 80px !important;
  min-height: 32px !important;
  transition: all 0.2s ease !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}

.btnAvanzarFase {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%) !important;
  color: white !important;
  box-shadow: 0 3px 8px rgba(22, 163, 74, 0.3) !important;
}

.btnAvanzarFase:hover {
  transform: translateY(-1px) scale(1.05) !important;
  box-shadow: 0 5px 15px rgba(22, 163, 74, 0.4) !important;
}

.btnRetrocederFase {
  background: linear-gradient(135deg, #ea580c 0%, #dc2626 100%) !important;
  color: white !important;
  box-shadow: 0 3px 8px rgba(234, 88, 12, 0.3) !important;
}

.btnRetrocederFase:hover {
  transform: translateY(-1px) scale(1.05) !important;
  box-shadow: 0 5px 15px rgba(234, 88, 12, 0.4) !important;
}

/* Estados deshabilitados */
.btnAvanzarFase:disabled,
.btnRetrocederFase:disabled {
  background: #9ca3af !important;
  color: #6b7280 !important;
  cursor: not-allowed !important;
  opacity: 0.5 !important;
  transform: none !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

/* 10. MODAL EXPANDIDO AL HACER CLIC (OPCIONAL) */
.card-expanded {
  /* Esta sección la mantienes como está o la eliminas si prefieres solo el modal */
  display: none; /* Ocultar por completo si prefieres solo usar el modal */
}

/* 11. ESTADO VACÍO */
.empty-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: 1rem;
  min-height: 150px;
  color: rgba(255, 255, 255, 0.6);
  transition: all 0.3s ease;
}

.empty-stack:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.3);
}

.empty-stack svg {
  margin-bottom: 1rem;
}

/* 12. INDICADOR DE CANTIDAD */
.card-stack::before {
  content: attr(data-count) " licitaciones";
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  text-align: center;
  margin-bottom: 1rem;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 0.5rem;
  backdrop-filter: blur(10px);
}

.card-stack[data-count="0"]::before {
  display: none;
}

/* 13. RESPONSIVE PARA MÓVILES */
@media (max-width: 768px) {
  .kanban-board-stacked {
    flex-direction: column;
    gap: 1.5rem;
    padding: 1rem;
  }
  
  .kanban-column-stacked {
    min-width: auto;
    max-width: none;
    width: 100%;
  }
  
  .kanban-cards-stack-container {
    max-height: 400px;
  }
  
  .card-preview {
    padding: 1rem;
  }
  
  .card-preview-actions {
    opacity: 1; /* Siempre visibles en móvil */
    transform: translateY(0);
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .btnAvanzarFase,
  .btnRetrocederFase {
    width: 100% !important;
    min-height: 40px !important;
    font-size: 0.85rem !important;
  }
}

/* 14. MEJORAS DE ACCESIBILIDAD */
.kanban-card-stacked:focus {
  outline: 3px solid #3b82f6;
  outline-offset: 2px;
  box-shadow: 
    0 0 0 3px rgba(59, 130, 246, 0.3),
    0 12px 30px rgba(0, 0, 0, 0.15);
}

/* 15. SIN ANIMACIONES DE ENTRADA - DIRECTO */
.kanban-card-stacked {
  /* Sin animaciones, aparición inmediata */
  opacity: 1;
  transform: none;
}

/* 16. PREVENIR TODAS LAS ANIMACIONES INNECESARIAS */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

/* FORZAR QUE NO HAYA DELAYS NI ANIMACIONES DE CASCADA */
.kanban-card-stacked,
.card-preview,
.card-preview-actions,
.btnAvanzarFase,
.btnRetrocederFase {
  animation: none !important;
  animation-delay: 0s !important;
  animation-duration: 0s !important;
}

/* Solo mantener las transiciones de hover que son útiles */
.kanban-card-stacked {
  transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}

.card-preview-actions {
  transition: opacity 0.2s ease, transform 0.2s ease !important;
}

.btnAvanzarFase,
.btnRetrocederFase {
  transition: transform 0.1s ease, box-shadow 0.1s ease !important;
}

/* ===== MODAL DE LICITACIÓN MEJORADO - CONSISTENTE CON KANBAN OSCURO ===== */

/* Modal principal */
/* Modal principal - fondo difuminado */
.modal-licitacion {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
}

/* Contenido del modal - diseño oscuro centrado */
.modal-content-licitacion {
  position: relative;
  background: linear-gradient(145deg, 
    rgba(30, 41, 59, 0.95) 0%, 
    rgba(51, 65, 85, 0.9) 100%);
  backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin: 3% auto;
  padding: 0;
  border-radius: 1.5rem;
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 
    0 25px 50px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  animation: modalSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-30px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Botón de cerrar - diseño oscuro */
.close-modal {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  font-size: 1.5rem;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(239, 68, 68, 0.2);
  backdrop-filter: blur(10px);
  border-radius: 50%;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10;
  border: 1px solid rgba(239, 68, 68, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.close-modal:hover {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  transform: scale(1.1) rotate(90deg);
  box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
}

/* Contenido del modal */
.modal-modern-content {
  padding: 2.5rem;
  overflow-y: auto;
  max-height: 90vh;
  color: white;
}

/* Header del modal */
.modal-header-modern {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
}

.modal-title-modern {
  font-size: 1.75rem;
  font-weight: 700;
  color: white;
  margin-bottom: 1rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  background: linear-gradient(135deg, #ffffff 0%, #e2e8f0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.modal-status-modern {
  display: inline-block;
  color: white;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 0.75rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
}

.modal-urgency {
  font-size: 1rem;
  font-weight: 700;
  padding: 0.75rem 1.25rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Campos del modal */
.modal-fields-modern {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.modal-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 640px) {
  .modal-field-row {
    grid-template-columns: 1fr;
  }
}

.modal-field-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.modal-field-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.modal-field-label svg {
  color: rgba(59, 130, 246, 0.8);
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.modal-field-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  padding: 1rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

/* Efecto brillante en hover */
.modal-field-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(255, 255, 255, 0.1), 
    transparent);
  transition: left 0.5s;
}

.modal-field-content:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(59, 130, 246, 0.3);
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.modal-field-content:hover::before {
  left: 100%;
}

.modal-field-value {
  flex: 1;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9rem;
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Botón de editar mejorado */
.modal-edit-btn {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: white;
  border: none;
  border-radius: 0.5rem;
  padding: 0.5rem;
  cursor: pointer;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
  position: relative;
  overflow: hidden;
}

/* Efecto ripple en botón de editar */
.modal-edit-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transition: width 0.3s, height 0.3s, top 0.3s, left 0.3s;
  transform: translate(-50%, -50%);
}

.modal-edit-btn:active::before {
  width: 50px;
  height: 50px;
}

.modal-field-content:hover .modal-edit-btn {
  opacity: 1;
  transform: scale(1.05);
}

.modal-edit-btn:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

/* Input de edición mejorado */
.modal-field-input-edit {
  flex: 1;
  border: 2px solid rgba(59, 130, 246, 0.5);
  border-radius: 0.5rem;
  padding: 0.75rem;
  font-size: 0.9rem;
  outline: none;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  color: #1f2937;
  font-weight: 500;
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transition: all 0.3s ease;
}

.modal-field-input-edit:focus {
  border-color: #3b82f6;
  background: white;
  box-shadow: 
    0 0 0 3px rgba(59, 130, 246, 0.3),
    0 8px 25px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transform: scale(1.02);
}

/* Enlaces mejorados */
.modal-link {
  color: #60a5fa;
  text-decoration: none;
  transition: all 0.3s ease;
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.modal-link:hover {
  color: #93c5fd;
  text-decoration: underline;
  text-shadow: 0 0 8px rgba(96, 165, 250, 0.5);
}

.dynamics-link {
  color: #fbbf24 !important;
}

.dynamics-link:hover {
  color: #fcd34d !important;
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.5);
}

/* Alerta de advertencia mejorada */
.modal-alert-warning {
  background: linear-gradient(135deg, 
    rgba(251, 191, 36, 0.2) 0%, 
    rgba(245, 158, 11, 0.15) 100%);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 1rem;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.modal-alert-warning h3 {
  color: #fbbf24;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.modal-alert-warning p {
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Acciones principales mejoradas */
.modal-actions-modern {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.modal-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  border-radius: 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Efecto ripple en botones de acción */
.modal-action-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transition: width 0.3s, height 0.3s, top 0.3s, left 0.3s;
  transform: translate(-50%, -50%);
}

.modal-action-btn:active::before {
  width: 200px;
  height: 200px;
}

.modal-action-btn:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.modal-btn-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: white;
}

.modal-btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

.modal-btn-success {
  background: linear-gradient(135deg, #10b981 0%, #047857 100%);
  color: white;
}

.modal-btn-success:hover {
  background: linear-gradient(135deg, #047857 0%, #065f46 100%);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.modal-btn-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
}

.modal-btn-warning:hover {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  box-shadow: 0 8px 25px rgba(245, 158, 11, 0.4);
}

/* Sección de comentarios mejorada */
.modal-comments-section {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 2rem;
  background: rgba(0, 0, 0, 0.1);
  margin: 0 -2.5rem -2.5rem;
  padding-left: 2.5rem;
  padding-right: 2.5rem;
  padding-bottom: 2.5rem;
  border-radius: 0 0 1.5rem 1.5rem;
}

.modal-comments-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.modal-comments-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.modal-comments-title svg {
  color: #60a5fa;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.modal-comments-count {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: white;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.375rem 0.75rem;
  border-radius: 1rem;
  min-width: 2rem;
  text-align: center;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Lista de comentarios mejorada */
.modal-comments-list {
  max-height: 250px;
  overflow-y: auto;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-right: 0.5rem;
}

.modal-comment {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  padding: 1rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.modal-comment:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.modal-comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.modal-comment-author {
  font-weight: 600;
  color: #60a5fa;
  font-size: 0.9rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.modal-comment-date {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.8rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.modal-comment-content {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9rem;
  line-height: 1.5;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.modal-no-comments {
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  font-style: italic;
  padding: 3rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 1rem;
  border: 2px dashed rgba(255, 255, 255, 0.1);
}

/* Formulario de comentarios mejorado */
.modal-comment-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal-comment-input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.75rem;
  padding: 1rem;
  font-size: 0.9rem;
  resize: vertical;
  min-height: 100px;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  color: #1f2937;
  font-weight: 500;
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.modal-comment-input:focus {
  outline: none;
  border-color: #3b82f6;
  background: white;
  box-shadow: 
    0 0 0 3px rgba(59, 130, 246, 0.3),
    0 4px 12px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transform: scale(1.02);
}

.modal-comment-input::placeholder {
  color: #6b7280;
}

.modal-comment-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.modal-comment-submit {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: white;
  border: none;
  border-radius: 0.75rem;
  padding: 0.875rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.modal-comment-submit:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

.modal-comment-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.modal-comment-status {
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Scroll personalizado para comentarios */
.modal-comments-list::-webkit-scrollbar {
  width: 6px;
}

.modal-comments-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.modal-comments-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

.modal-comments-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* Responsive para móviles */
@media (max-width: 768px) {
  .modal-content-licitacion {
    width: 95vw;
    max-height: 95vh;
  }
  
  .modal-modern-content {
    padding: 1.5rem;
  }
  
  .modal-title-modern {
    font-size: 1.5rem;
  }
  
  .modal-actions-modern {
    flex-direction: column;
  }
  
  .modal-action-btn {
    width: 100%;
    justify-content: center;
  }
  
  .close-modal {
    top: 1rem;
    right: 1rem;
    width: 2.5rem;
    height: 2.5rem;
  }
}

/* Estados de carga para botones del modal */
.modal-action-btn.loading,
.modal-comment-submit.loading {
  position: relative;
  color: transparent !important;
}

.modal-action-btn.loading::after,
.modal-comment-submit.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1rem;
  height: 1rem;
  margin: -0.5rem 0 0 -0.5rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Mejoras de accesibilidad */
@media (prefers-reduced-motion: reduce) {
  .modal-content-licitacion,
  .modal-action-btn,
  .modal-comment,
  .modal-field-content {
    transition: none;
    animation: none;
  }
  
  .modal-action-btn:hover,
  .modal-comment:hover {
    transform: none;
  }
}

/* ===== ANIMACIONES MEJORADAS ===== */
@keyframes cardStackIn {
  from {
    opacity: 0;
    transform: scale(0.8) translateY(30px) rotate(10deg);
  }
  to {
    opacity: 1;
    transform: scale(calc(1 - var(--card-index) * 0.015)) 
               translateY(0) 
               rotate(calc(var(--card-index) * -0.3deg));
  }
}

.kanban-card-stacked {
  animation: cardStackIn 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  animation-delay: calc(var(--card-index) * 0.1s);
  animation-fill-mode: both;
}

/* ===== RESPONSIVE MEJORADO ===== */
@media (max-width: 1024px) {
  .kanban-board-stacked {
    padding: 1.5rem;
    gap: 1rem;
  }
  
  .kanban-column-stacked {
    min-width: 320px;
    max-width: 340px;
  }
  
  .kanban-card-stacked {
    top: calc(var(--card-index) * 8px);
    left: calc(var(--card-index) * 4px);
  }
}

@media (max-width: 768px) {
  .kanban-board-stacked {
    flex-direction: column;
    gap: 1.5rem;
    padding: 1rem;
  }
  
  .kanban-column-stacked {
    min-width: auto;
    max-width: none;
    width: 100%;
  }
  
  .kanban-card-stacked {
    top: calc(var(--card-index) * 6px);
    left: calc(var(--card-index) * 3px);
    transform: scale(calc(1 - var(--card-index) * 0.01)) 
               rotate(calc(var(--card-index) * -0.2deg));
  }
  
  .card-expanded {
    min-height: 200px;
    padding: 1rem;
  }
}

/* ===== MEJORAS DE ACCESIBILIDAD ===== */
@media (prefers-reduced-motion: reduce) {
  .kanban-card-stacked,
  .card-expanded,
  .kanban-btn-stacked {
    transition: none;
    animation: none;
  }
  
  .kanban-card-stacked:hover {
    transform: scale(1.02) translateY(-4px);
  }
  
  .card-stack:hover .kanban-card-stacked:not(:hover) {
    animation: none;
    transform: scale(calc(1 - var(--card-index) * 0.015)) 
               rotate(calc(var(--card-index) * -0.3deg));
  }
}

/* ===== FOCUS MEJORADO ===== */
.kanban-card-stacked:focus {
  outline: 3px solid #3b82f6;
  outline-offset: 4px;
  box-shadow: 
    0 0 0 3px rgba(59, 130, 246, 0.3),
    0 25px 50px rgba(0, 0, 0, 0.25);
}

.kanban-btn-stacked:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
  box-shadow: 
    0 0 0 3px rgba(59, 130, 246, 0.3),
    0 8px 25px rgba(0, 0, 0, 0.2);
}
/* ===== MEJORAS PARA HACER MÁS VISIBLES LOS BOTONES DE FASE ===== */

/* 1. AUMENTAR EL TAMAÑO DE LA VISTA EXPANDIDA */
.card-expanded {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(145deg, 
    rgba(255, 255, 255, 0.98) 0%, 
    rgba(255, 255, 255, 0.95) 100%);
  backdrop-filter: blur(25px);
  border-radius: 1rem;
  padding: 1.5rem;
  min-height: 280px; /* AUMENTADO de 240px a 280px */
  opacity: 0;
  visibility: hidden;
  transform: translateY(15px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 
    0 25px 50px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(59, 130, 246, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.3);
  z-index: 10;
}

/* 2. HACER LOS BOTONES MÁS GRANDES Y VISIBLES */
.kanban-btn-stacked {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem; /* AUMENTADO de 0.5rem */
  border-radius: 0.75rem;
  font-size: 0.8rem; /* AUMENTADO de 0.75rem */
  font-weight: 600;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); /* AUMENTADO */
  position: relative;
  overflow: hidden;
  min-width: 40px; /* NUEVO: ancho mínimo */
  min-height: 40px; /* NUEVO: alto mínimo */
}

/* 3. MEJORAR EL ÁREA DE ACCIONES */
.card-expanded-actions {
  display: flex;
  gap: 0.75rem; /* AUMENTADO de 0.5rem */
  justify-content: flex-end;
  margin-top: 1rem; /* NUEVO: más separación */
  padding-top: 1rem; /* NUEVO: padding superior */
  border-top: 1px solid rgba(0, 0, 0, 0.1); /* NUEVO: línea separadora */
}

/* 4. ICONOS MÁS GRANDES */
.kanban-btn-stacked svg {
  width: 16px !important; /* AUMENTADO de 12px */
  height: 16px !important;
}

/* 5. BOTONES CON TEXTO DESCRIPTIVO (OPCIONAL) */
.btnAvanzarFase::after {
  content: "Avanzar";
  margin-left: 0.5rem;
  font-size: 0.7rem;
  font-weight: 500;
}

.btnRetrocederFase::after {
  content: "Atrás";
  margin-left: 0.5rem;
  font-size: 0.7rem;
  font-weight: 500;
}

/* 6. COLORES MÁS CONTRASTANTES */
.kanban-btn-primary-stacked {
  background: linear-gradient(135deg, #059669 0%, #047857 100%); /* Verde más visible */
  color: white;
  box-shadow: 0 4px 15px rgba(5, 150, 105, 0.4);
}

.kanban-btn-primary-stacked:hover {
  background: linear-gradient(135deg, #047857 0%, #065f46 100%);
  box-shadow: 0 8px 25px rgba(5, 150, 105, 0.5);
}

.kanban-btn-secondary-stacked {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); /* Naranja más visible */
  color: white;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

.kanban-btn-secondary-stacked:hover {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  box-shadow: 0 8px 25px rgba(245, 158, 11, 0.5);
}

/* 7. ANIMACIÓN PULSANTE PARA LLAMAR LA ATENCIÓN */
@keyframes pulseButton {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
  }
}

.kanban-btn-stacked {
  animation: pulseButton 2s ease-in-out infinite;
}

/* 8. HOVER MÁS DRAMÁTICO */
.kanban-btn-stacked:hover {
  transform: translateY(-4px) scale(1.1); /* AUMENTADO */
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3); /* AUMENTADO */
  animation: none; /* Para el pulso al hacer hover */
}

/* 9. MOSTRAR SIEMPRE EN TARJETAS PEQUEÑAS TAMBIÉN */
.card-preview {
  position: relative;
}

/* Botones pequeños en vista previa (emergencia) */
.card-preview::after {
  content: "⚙️";
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
  background: rgba(59, 130, 246, 0.8);
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.kanban-card-stacked:hover .card-preview::after {
  opacity: 1;
}

/* 10. RESPONSIVE - En móvil hacer aún más grandes */
@media (max-width: 768px) {
  .card-expanded {
    min-height: 320px;
    padding: 1rem;
  }
  
  .kanban-btn-stacked {
    padding: 1rem;
    min-width: 50px;
    min-height: 50px;
    font-size: 0.9rem;
  }
  
  .kanban-btn-stacked svg {
    width: 20px !important;
    height: 20px !important;
  }
  
  .card-expanded-actions {
    flex-direction: column;
    gap: 1rem;
  }
  
  .kanban-btn-stacked {
    width: 100%;
    justify-content: center;
  }
}

/* 11. INDICADOR VISUAL DE QUE HAY BOTONES */
.card-expanded-actions::before {
  content: "🔄 Cambiar Fase:";
  font-size: 0.8rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.5rem;
  display: block;
  text-align: center;
  width: 100%;
}

/* 12. ESTADO DISABLED MÁS CLARO */
.kanban-btn-stacked:disabled,
.kanban-btn-stacked.opacity-50 {
  opacity: 0.3 !important;
  cursor: not-allowed !important;
  animation: none !important;
  transform: none !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

.kanban-btn-stacked:disabled:hover,
.kanban-btn-stacked.opacity-50:hover {
  transform: none !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

/* ===== FORZAR VISUALIZACIÓN COMPLETA DE BOTONES DE FASE ===== */

/* 1. ASEGURAR QUE LOS BOTONES SEAN VISIBLES SIEMPRE */
.btnAvanzarFase,
.btnRetrocederFase {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0.5rem 0.75rem !important;
  border-radius: 0.5rem !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  border: none !important;
  cursor: pointer !important;
  min-width: 70px !important;
  min-height: 32px !important;
  transition: all 0.3s ease !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}

/* 2. COLORES SÚPER CONTRASTANTES */
.btnAvanzarFase {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%) !important;
  color: white !important;
  border: 2px solid #22c55e !important;
}

.btnAvanzarFase:hover {
  background: linear-gradient(135deg, #15803d 0%, #166534 100%) !important;
  transform: translateY(-3px) scale(1.1) !important;
  box-shadow: 0 8px 25px rgba(22, 163, 74, 0.5) !important;
}

.btnRetrocederFase {
  background: linear-gradient(135deg, #ea580c 0%, #dc2626 100%) !important;
  color: white !important;
  border: 2px solid #f97316 !important;
}

.btnRetrocederFase:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%) !important;
  transform: translateY(-3px) scale(1.1) !important;
  box-shadow: 0 8px 25px rgba(234, 88, 12, 0.5) !important;
}

/* 3. FORZAR QUE EL CONTENEDOR DE ACCIONES SEA VISIBLE */
.card-expanded-actions {
  display: flex !important;
  flex-direction: row !important;
  gap: 1rem !important;
  justify-content: center !important;
  align-items: center !important;
  margin-top: 1.5rem !important;
  padding: 1rem !important;
  background: rgba(255, 255, 255, 0.9) !important;
  border-radius: 1rem !important;
  border: 2px solid #3b82f6 !important;
  min-height: 80px !important;
  width: 100% !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

/* 4. AÑADIR TEXTO DESCRIPTIVO ANTES DE LOS BOTONES */
.card-expanded-actions::before {
  content: "🔄 CAMBIAR FASE:" !important;
  display: block !important;
  font-size: 0.9rem !important;
  font-weight: 700 !important;
  color: #1f2937 !important;
  text-align: center !important;
  width: 100% !important;
  margin-bottom: 0.5rem !important;
  text-transform: uppercase !important;
  letter-spacing: 1px !important;
}

/* 5. ASEGURAR QUE LA VISTA EXPANDIDA SEA MÁS GRANDE */
.card-expanded {
  min-height: 350px !important;
  width: 100% !important;
  padding: 2rem !important;
  z-index: 999 !important;
}

/* 6. ICONOS MÁS GRANDES Y VISIBLES */
.btnAvanzarFase svg,
.btnRetrocederFase svg {
  width: 20px !important;
  height: 20px !important;
  margin-right: 0.5rem !important;
}

/* 7. AÑADIR TEXTO A LOS BOTONES */
.btnAvanzarFase::after {
  content: "AVANZAR" !important;
  font-weight: 700 !important;
  font-size: 0.8rem !important;
}

.btnRetrocederFase::after {
  content: "ATRÁS" !important;
  font-weight: 700 !important;
  font-size: 0.8rem !important;
}

/* 8. ANIMACIÓN LLAMATIVA */
@keyframes flashButton {
  0%, 100% {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  }
  50% {
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.6);
  }
}

.btnAvanzarFase,
.btnRetrocederFase {
  animation: flashButton 2s ease-in-out infinite !important;
}

/* 9. PARA DISPOSITIVOS MÓVILES */
@media (max-width: 768px) {
  .card-expanded-actions {
    flex-direction: column !important;
    gap: 1.5rem !important;
  }
  
  .btnAvanzarFase,
  .btnRetrocederFase {
    width: 100% !important;
    min-height: 60px !important;
    font-size: 1.1rem !important;
  }
}

/* 10. SOBRESCRIBIR CUALQUIER ESTILO QUE LOS OCULTE */
.kanban-btn-stacked {
  display: inline-flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

/* 11. ESTILO PARA BOTONES DESHABILITADOS */
.btnAvanzarFase:disabled,
.btnRetrocederFase:disabled,
.btnAvanzarFase.opacity-50,
.btnRetrocederFase.opacity-50 {
  background: #9ca3af !important;
  color: #6b7280 !important;
  cursor: not-allowed !important;
  opacity: 0.6 !important;
  animation: none !important;
}

/* 12. INDICADOR VISUAL EN LA TARJETA PRINCIPAL */
.kanban-card-stacked::after {
  content: "⚙️" !important;
  position: absolute !important;
  top: 0.5rem !important;
  right: 0.5rem !important;
  background: #ef4444 !important;
  color: white !important;
  border-radius: 50% !important;
  width: 24px !important;
  height: 24px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 12px !important;
  z-index: 100 !important;
  animation: pulse 1s infinite !important;
}

/* ===== MEJORAS PARA VISUALIZACIÓN MÚLTIPLES TARJETAS ===== */

/* Hacer más visible la tarjeta superior */
.kanban-card-stacked:first-child {
  border: 2px solid rgba(59, 130, 246, 0.3) !important;
  box-shadow: 
    0 12px 40px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(59, 130, 246, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.4) !important;
}

/* Indicador visual de cantidad */
.card-stack::before {
  content: attr(data-count) " licitaciones";
  position: absolute;
  top: -10px;
  right: 10px;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
  z-index: 100;
  border: 2px solid white;
}

/* Numeración en cada tarjeta */
.card-preview::before {
  content: "#" counter(card-number);
  counter-increment: card-number;
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(107, 114, 128, 0.8);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.card-stack {
  counter-reset: card-number;
}

/* ===== SCROLL PERSONALIZADO ===== */
.kanban-cards-stack-container::-webkit-scrollbar {
  width: 6px;
}

.kanban-cards-stack-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.kanban-cards-stack-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

.kanban-cards-stack-container::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}
/* Indicador visual mejorado para stacks con múltiples tarjetas */
.card-stack[data-count]:not([data-count="0"]):not([data-count="1"])::before {
  content: "📚 " attr(data-count) " licitaciones";
  position: absolute;
  top: -35px;
  left: 0;
  right: 0;
  text-align: center;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 1rem;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
  z-index: 30;
  border: 2px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
}

/* Ocultar indicador para stacks vacíos o con una sola tarjeta */
.card-stack[data-count="0"]::before,
.card-stack[data-count="1"]::before {
  display: none !important;
}

/* Clase especial para la tarjeta superior */
.card-top {
  border: 2px solid rgba(59, 130, 246, 0.4) !important;
  box-shadow: 
    0 8px 25px rgba(0, 0, 0, 0.15), 
    0 0 0 1px rgba(59, 130, 246, 0.2) !important;
}

/* Efecto especial cuando hay múltiples tarjetas */
.card-stack:hover .kanban-card-stacked:not(:hover) {
  transform: translateZ(0) scale(calc(1 - var(--card-index, 0) * 0.03)) 
             rotate(calc(var(--card-index, 0) * -1deg))
             translateX(calc(var(--card-index, 0) * 8px));
  opacity: 0.7;
}

/* Mejoras responsive para móviles */
@media (max-width: 768px) {
  .card-expanded {
    min-height: 350px !important;
    padding: 1rem !important;
  }
  
  .card-stack .kanban-card-stacked {
    margin-top: calc(var(--card-index, 0) * -50px) !important;
  }
  
  .card-stack::before {
    top: -25px !important;
    font-size: 0.7rem !important;
    padding: 0.375rem 0.75rem !important;
  }
}

.btn-nueva-invitacion {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: white;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.btn-nueva-invitacion:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

.modal-overlay-invitacion {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  backdrop-filter: blur(4px);
}

.modal-container-invitacion {
  background: white;
  border-radius: 16px;
  width: 95%;
  max-width: 900px;  /* ← MÁS ANCHO */
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.modal-header-invitacion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px;
  border-bottom: 1px solid #e5e7eb;
}

.modal-title-invitacion {
  display: flex;
  align-items: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: #1f2937;
}

.modal-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #6b7280;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s;
}

.modal-close-btn:hover {
  background: #f3f4f6;
  color: #374151;
}

.modal-body-invitacion {
  padding: 24px;
}

.modal-info-box {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: #eff6ff;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  margin-bottom: 24px;
}

.modal-info-box p {
  margin: 0;
  color: #1e40af;
  font-size: 0.95rem;
  line-height: 1.6;
}

.upload-section {
  margin-bottom: 24px;
}

.upload-area {
  border: 2px dashed #d1d5db;
  border-radius: 12px;
  padding: 40px;
  text-align: center;
  transition: all 0.3s;
  cursor: pointer;
}

.upload-area:hover {
  border-color: #8b5cf6;
  background: #faf5ff;
}

.upload-area.drag-over {
  border-color: #8b5cf6;
  background: #ede9fe;
  transform: scale(1.02);
}

.btn-select-file {
  padding: 8px 20px;
  background: #8b5cf6;
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-select-file:hover {
  background: #7c3aed;
}

.file-preview {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
}

.file-icon {
  flex-shrink: 0;
}

.file-info {
  flex: 1;
}

.file-name {
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 4px 0;
}

.file-size {
  font-size: 0.875rem;
  color: #6b7280;
  margin: 0;
}

.btn-remove-file {
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: all 0.2s;
}

.btn-remove-file:hover {
  background: #fee2e2;
}

.datos-adicionales {
  margin-top: 24px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.form-input, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.95rem;
  transition: all 0.2s;
}

.form-input:focus, .form-textarea:focus {
  border-color: #8b5cf6;
  outline: none;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.modal-footer-invitacion {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 24px;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
  border-radius: 0 0 16px 16px;
}

.btn-cancel {
  padding: 10px 20px;
  background: #e5e7eb;
  color: #374151;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-cancel:hover {
  background: #d1d5db;
}

.btn-process {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.btn-process:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

.btn-process:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Estilos para modal de 2FA en login */
#modal2FALogin .modal-content {
  max-width: 400px;
  margin: 15% auto;
  padding: 20px;
  text-align: center;
}

#codigo2FALogin {
  width: 200px;
  margin: 0 auto;
  display: block;
  text-align: center;
  font-size: 18px;
  letter-spacing: 2px;
  padding: 10px;
  border: 2px solid #ddd;
  border-radius: 4px;
}

#codigo2FALogin:focus {
  border-color: #3498db;
  outline: none;
}

#modal2FALogin .modal-actions {
  margin-top: 20px;
  display: flex;
  gap: 10px;
  justify-content: center;
}

#modal2FALogin .error-message {
  color: #e74c3c;
  margin-top: 10px;
  font-size: 14px;
}

#modal2FALogin .btn {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

#modal2FALogin .btn-primary {
  background-color: #3498db;
  color: white;
}

#modal2FALogin .btn-secondary {
  background-color: #95a5a6;
  color: white;
}

#modal2FALogin .btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ===== SISTEMA DE URGENCIA POR FECHA LÍMITE ===== */

/* 1. CLASES BASE PARA URGENCIA */
.urgencia-normal {
  /* Tarjeta normal - sin cambios */
}

.urgencia-amarilla {
  background: linear-gradient(145deg, 
    rgba(255, 251, 235, 0.98) 0%, 
    rgba(254, 243, 199, 0.95) 100%) !important;
  border: 2px solid rgba(251, 191, 36, 0.4) !important;
  box-shadow: 
    0 4px 12px rgba(251, 191, 36, 0.2),
    0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

.urgencia-amarilla:hover {
  background: linear-gradient(145deg, 
    rgba(255, 251, 235, 1) 0%, 
    rgba(254, 243, 199, 0.98) 100%) !important;
  border-color: rgba(251, 191, 36, 0.6) !important;
  box-shadow: 
    0 12px 30px rgba(251, 191, 36, 0.3),
    0 0 0 2px rgba(251, 191, 36, 0.3) !important;
}

.urgencia-roja {
  background: linear-gradient(145deg, 
    rgba(254, 242, 242, 0.98) 0%, 
    rgba(254, 226, 226, 0.95) 100%) !important;
  border: 2px solid rgba(239, 68, 68, 0.4) !important;
  box-shadow: 
    0 4px 12px rgba(239, 68, 68, 0.2),
    0 1px 3px rgba(0, 0, 0, 0.1) !important;
  animation: pulsoUrgente 2s ease-in-out infinite;
}

.urgencia-roja:hover {
  background: linear-gradient(145deg, 
    rgba(254, 242, 242, 1) 0%, 
    rgba(254, 226, 226, 0.98) 100%) !important;
  border-color: rgba(239, 68, 68, 0.6) !important;
  box-shadow: 
    0 12px 30px rgba(239, 68, 68, 0.3),
    0 0 0 2px rgba(239, 68, 68, 0.3) !important;
  animation: none; /* Parar animación en hover */
}

.urgencia-vencida {
  background: linear-gradient(145deg, 
    rgba(127, 29, 29, 0.95) 0%, 
    rgba(153, 27, 27, 0.9) 100%) !important;
  border: 2px solid rgba(220, 38, 38, 0.8) !important;
  color: white !important;
  box-shadow: 
    0 4px 12px rgba(220, 38, 38, 0.4),
    0 1px 3px rgba(0, 0, 0, 0.2) !important;
  animation: pulsoVencida 1.5s ease-in-out infinite;
}

.urgencia-vencida:hover {
  background: linear-gradient(145deg, 
    rgba(127, 29, 29, 1) 0%, 
    rgba(153, 27, 27, 0.95) 100%) !important;
  border-color: rgba(220, 38, 38, 1) !important;
  box-shadow: 
    0 12px 30px rgba(220, 38, 38, 0.5),
    0 0 0 2px rgba(220, 38, 38, 0.5) !important;
}

/* 2. ANIMACIONES DE URGENCIA */
@keyframes pulsoUrgente {
  0%, 100% { 
    transform: scale(1);
    box-shadow: 
      0 4px 12px rgba(239, 68, 68, 0.2),
      0 1px 3px rgba(0, 0, 0, 0.1);
  }
  50% { 
    transform: scale(1.02);
    box-shadow: 
      0 6px 18px rgba(239, 68, 68, 0.3),
      0 2px 6px rgba(0, 0, 0, 0.15);
  }
}

@keyframes pulsoVencida {
  0%, 100% { 
    transform: scale(1);
    box-shadow: 
      0 4px 12px rgba(220, 38, 38, 0.4),
      0 1px 3px rgba(0, 0, 0, 0.2);
  }
  50% { 
    transform: scale(1.03);
    box-shadow: 
      0 8px 24px rgba(220, 38, 38, 0.6),
      0 4px 12px rgba(0, 0, 0, 0.3);
  }
}

/* 3. AJUSTES DE TEXTO PARA TARJETAS URGENTES */
.urgencia-vencida .card-preview-title,
.urgencia-vencida .card-preview-organismo,
.urgencia-vencida .card-preview-deadline {
  color: white !important;
}

.urgencia-vencida .card-preview-organismo svg {
  color: rgba(255, 255, 255, 0.8) !important;
}

.urgencia-vencida .card-preview-deadline svg {
  color: rgba(255, 255, 255, 0.8) !important;
}

/* 4. INDICADORES VISUALES DE URGENCIA */
.urgencia-amarilla::before {
  content: '⚠️';
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  font-size: 1.2rem;
  z-index: 10;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.urgencia-roja::before {
  content: '🔥';
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  font-size: 1.2rem;
  z-index: 10;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
  animation: parpadeo 1s ease-in-out infinite;
}

.urgencia-vencida::before {
  content: '💀';
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  font-size: 1.2rem;
  z-index: 10;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
  animation: parpadeo 0.8s ease-in-out infinite;
}

@keyframes parpadeo {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* 5. ESTILOS ESPECIALES PARA FECHAS EN TARJETAS URGENTES */
.urgencia-amarilla .card-preview-days {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%) !important;
  color: white !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 6px rgba(251, 191, 36, 0.4) !important;
}

.urgencia-roja .card-preview-days {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
  color: white !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4) !important;
  animation: parpadeo 1s ease-in-out infinite;
}

.urgencia-vencida .card-preview-days {
  background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 100%) !important;
  color: white !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 6px rgba(127, 29, 29, 0.6) !important;
  animation: parpadeo 0.8s ease-in-out infinite;
}

/* 6. CONTADOR DE COLUMNA CON INDICADORES DE URGENCIA */
.kanban-column-count-stacked.has-urgent {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%) !important;
  color: white !important;
  animation: pulsoContador 2s ease-in-out infinite;
}

.kanban-column-count-stacked.has-critical {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
  color: white !important;
  animation: pulsoContador 1.5s ease-in-out infinite;
}

@keyframes pulsoContador {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* 7. RESPONSIVE - AJUSTES PARA MÓVIL */
@media (max-width: 768px) {
  .urgencia-amarilla::before,
  .urgencia-roja::before,
  .urgencia-vencida::before {
    top: 0.25rem;
    right: 0.25rem;
    font-size: 1rem;
  }
  
  .urgencia-roja,
  .urgencia-vencida {
    animation-duration: 3s; /* Animaciones más lentas en móvil */
  }
}

/* 8. PREVENIR ANIMACIONES EN DISPOSITIVOS CON PREFERENCIA REDUCIDA */
@media (prefers-reduced-motion: reduce) {
  .urgencia-roja,
  .urgencia-vencida,
  .urgencia-roja::before,
  .urgencia-vencida::before,
  .kanban-column-count-stacked.has-urgent,
  .kanban-column-count-stacked.has-critical {
    animation: none !important;
  }
  
  .urgencia-roja:hover,
  .urgencia-vencida:hover {
    transform: translateY(-2px) !important;
  }
}

/* ===== MODAL DE ELIMINACIÓN DE LICITACIONES ===== */

/* 1. OVERLAY Y CONTENEDOR PRINCIPAL */
.modal-overlay-eliminacion {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 1rem;
}

.modal-container-eliminacion {
  background: white;
  border-radius: 1.5rem;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 
    0 25px 50px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(0, 0, 0, 0.1);
  animation: modalEliminacionSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalEliminacionSlideIn {
  from {
    opacity: 0;
    transform: translateY(-30px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* 2. HEADER DEL MODAL */
.modal-header-eliminacion {
  padding: 2rem 2rem 1.5rem;
  border-radius: 1.5rem 1.5rem 0 0;
  position: relative;
  color: white;
}

.modal-title-eliminacion {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.modal-close-btn {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: white;
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

/* 3. BODY DEL MODAL */
.modal-body-eliminacion {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* 4. INFORMACIÓN DE LA LICITACIÓN */
.info-licitacion {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 1.5rem;
}

.info-licitacion h3 {
  margin: 0 0 1rem 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #1f2937;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.info-grid {
  display: grid;
  gap: 0.75rem;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.info-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #6b7280;
}

.info-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1f2937;
  word-wrap: break-word;
}

.estado-badge {
  display: inline-block;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.8rem;
  max-width: fit-content;
}

/* 5. ALERTAS */
.alert-eliminacion {
  display: flex;
  gap: 1rem;
  padding: 1.5rem;
  border-radius: 1rem;
  border: 2px solid;
}

.alert-no-go {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  border-color: #f87171;
  color: #7f1d1d;
}

.alert-warning {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border-color: #fbbf24;
  color: #92400e;
}

.alert-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.alert-content h4 {
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
  font-weight: 600;
}

.alert-content p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* 6. FORMULARIO DE MOTIVO */
.form-motivo {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.form-label {
  display: flex;
  align-items: center;
  font-size: 1rem;
  font-weight: 600;
  color: #1f2937;
}

.form-textarea-motivo {
  width: 100%;
  padding: 1rem;
  border: 2px solid #e5e7eb;
  border-radius: 0.75rem;
  font-size: 0.95rem;
  font-family: inherit;
  resize: vertical;
  min-height: 100px;
  transition: all 0.3s ease;
  background: #fafafa;
}

.form-textarea-motivo:focus {
  outline: none;
  border-color: #3b82f6;
  background: white;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  transform: scale(1.01);
}

.form-help {
  font-size: 0.8rem;
  color: #6b7280;
  font-style: italic;
}

/* 7. OPCIONES DE NOTIFICACIÓN */
.opciones-notificacion {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 1.25rem;
}

.opciones-notificacion h4 {
  margin: 0 0 1rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: #1f2937;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: #374151;
  transition: color 0.2s ease;
}

.checkbox-label:hover {
  color: #1f2937;
}

.checkbox-custom {
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid #d1d5db;
  border-radius: 0.25rem;
  position: relative;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

input[type="checkbox"] {
  opacity: 0;
  position: absolute;
  width: 0;
  height: 0;
}

input[type="checkbox"]:checked + .checkbox-custom {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  border-color: #3b82f6;
}

input[type="checkbox"]:checked + .checkbox-custom::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 0.8rem;
  font-weight: bold;
}

input[type="checkbox"]:disabled + .checkbox-custom {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 8. FOOTER Y BOTONES */
.modal-footer-eliminacion {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  padding: 1.5rem 2rem 2rem;
  background: #f9fafb;
  border-radius: 0 0 1.5rem 1.5rem;
}

.btn-cancel-eliminacion,
.btn-confirm-eliminacion {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 120px;
}

.btn-cancel-eliminacion {
  background: #e5e7eb;
  color: #374151;
}

.btn-cancel-eliminacion:hover {
  background: #d1d5db;
  transform: translateY(-1px);
}

.btn-confirm-eliminacion {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-confirm-eliminacion:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.btn-confirm-eliminacion:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-no-go {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
}

.btn-no-go:hover:not(:disabled) {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

.btn-delete {
  background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
  color: white;
}

.btn-delete:hover:not(:disabled) {
  background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
}

/* 9. BOTÓN DE ELIMINACIÓN EN MODAL PRINCIPAL */
.modal-btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  border: 2px solid transparent;
}

.modal-btn-danger:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  border-color: rgba(239, 68, 68, 0.3);
  box-shadow: 0 8px 25px rgba(239, 68, 68, 0.3);
}

/* 10. RESPONSIVE */
@media (max-width: 640px) {
  .modal-overlay-eliminacion {
    padding: 0.5rem;
  }
  
  .modal-container-eliminacion {
    border-radius: 1rem;
  }
  
  .modal-header-eliminacion {
    padding: 1.5rem 1.5rem 1rem;
    border-radius: 1rem 1rem 0 0;
  }
  
  .modal-title-eliminacion {
    font-size: 1.25rem;
  }
  
  .modal-close-btn {
    top: 1rem;
    right: 1rem;
    width: 2.5rem;
    height: 2.5rem;
  }
  
  .modal-body-eliminacion {
    padding: 1.5rem;
  }
  
  .modal-footer-eliminacion {
    flex-direction: column;
    padding: 1.25rem 1.5rem 1.5rem;
  }
  
  .btn-cancel-eliminacion,
  .btn-confirm-eliminacion {
    width: 100%;
  }
  
  .info-grid {
    grid-template-columns: 1fr;
  }
}

.kanban-btn-success-stacked {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: white;
  border: none;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  transition: all 0.2s;
}

.kanban-btn-success-stacked:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.kanban-btn-danger-stacked {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  border: none;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  transition: all 0.2s;
}

.kanban-btn-danger-stacked:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.contador-presentada {
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.modal-field-value {
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  word-wrap: break-word;
}

/* ===== NUEVO DISEÑO DE TARJETAS DE LICITACIÓN ===== */

/* 1. CONTENEDOR PRINCIPAL DE RESULTADOS */
#misLicitacionesContainer,
#historyResults {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 1.5rem;
  padding: 1.5rem;
  background: transparent;
}

/* 2. TARJETA DE LICITACIÓN REDISEÑADA */
.result-card {
  background: white;
  border-radius: 1rem;
  padding: 0;
  margin: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  max-width: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid #e5e7eb;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.result-card::before {
  display: none; /* Eliminar barra lateral azul */
}

.result-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
  border-color: #3b82f6;
}

/* 3. HEADER DE LA TARJETA */
.card-header-section {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  padding: 1.25rem;
  border-bottom: 1px solid #e5e7eb;
}

.card-expediente-badge {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: white;
  padding: 0.375rem 0.875rem;
  border-radius: 2rem;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: 'SF Mono', 'Consolas', monospace;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
  margin-bottom: 0.75rem;
}

.card-expediente-badge::before {
  content: "📋";
  margin-right: 0.5rem;
}

.card-title-main {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1f2937;
  line-height: 1.4;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 4. BODY DE LA TARJETA */
.card-body-section {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* 5. INFORMACIÓN EN GRID */
.card-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.card-info-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.card-info-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-info-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: #374151;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

/* 6. BADGES DE ESTADO */
.estado-badge-card {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  gap: 0.25rem;
}

.estado-badge-card.publicada {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}

.estado-badge-card.evaluacion {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde047;
}

.estado-badge-card.adjudicada {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #93c5fd;
}

.estado-badge-card.cerrada {
  background: #f3f4f6;
  color: #4b5563;
  border: 1px solid #d1d5db;
}

/* 7. IMPORTE CON ESTILO */
.importe-value {
  background: linear-gradient(135deg, #fef3c7 0%, #fde047 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 1.1rem;
  font-weight: 700;
}

/* 8. FECHA LÍMITE DESTACADA */
.fecha-limite-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  margin-top: auto;
}

.fecha-limite-card.proxima {
  background: #fef3c7;
  border-color: #fde047;
}

.fecha-limite-card.urgente {
  background: #fee2e2;
  border-color: #fca5a5;
  animation: pulseUrgent 2s ease-in-out infinite;
}

@keyframes pulseUrgent {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

.fecha-limite-text {
  font-size: 0.8rem;
  font-weight: 600;
  color: #7f1d1d;
}

.dias-restantes {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
  background: white;
  border-radius: 0.25rem;
  color: #dc2626;
}

/* 9. SECCIÓN DE ACCIONES */
.card-actions-section {
  background: #f9fafb;
  padding: 1rem 1.25rem;
  border-top: 1px solid #e5e7eb;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
}

/* 10. ENLACES Y BOTONES MEJORADOS */
.link-licitacion a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #3b82f6;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.2s;
}

.link-licitacion a:hover {
  color: #1d4ed8;
  transform: translateX(2px);
}

/* 11. BOTONES DE ACCIÓN REDISEÑADOS */
.card-actions-section button,
.card-action-buttons button {
  padding: 0.5rem 1rem !important;
  border-radius: 0.5rem !important;
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  border: none !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}

.add-fav-btn {
  background: white !important;
  color: #6b7280 !important;
  border: 1px solid #e5e7eb !important;
}

.add-fav-btn:hover:not(:disabled) {
  background: #f9fafb !important;
  color: #fbbf24 !important;
  border-color: #fbbf24 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 6px rgba(251, 191, 36, 0.1) !important;
}

.add-fav-btn:disabled {
  background: #dcfce7 !important;
  color: #16a34a !important;
  border-color: #86efac !important;
  cursor: default !important;
}

.remove-fav-btn {
  background: white !important;
  color: #ef4444 !important;
  border: 1px solid #fecaca !important;
}

.remove-fav-btn:hover {
  background: #fef2f2 !important;
  color: #dc2626 !important;
  border-color: #ef4444 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 6px rgba(239, 68, 68, 0.1) !important;
}

.analizar-btn {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%) !important;
  color: white !important;
}

.analizar-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3) !important;
}

.analizar-btn:disabled {
  background: #e5e7eb !important;
  color: #9ca3af !important;
  cursor: not-allowed !important;
  opacity: 0.6 !important;
}

/* 12. RESPONSIVE PARA MÓVILES */
@media (max-width: 768px) {
  #misLicitacionesContainer,
  #historyResults {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1rem;
  }
  
  .card-info-grid {
    grid-template-columns: 1fr;
  }
  
  .card-actions-section {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .card-action-buttons {
    width: 100%;
    display: flex;
    flex-direction: column;
  }
  
  .card-action-buttons button {
    width: 100% !important;
  }
}

/* ===== BUSCADOR AVANZADO DE FAVORITOS ===== */

/* 1. CONTENEDOR PRINCIPAL */
.favoritos-search-container {
  background: white;
  border-radius: 1.5rem;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  border: 1px solid #e5e7eb;
}

/* 2. HEADER DE FAVORITOS */
.favoritos-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid #f3f4f6;
}

.favoritos-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.75rem;
  font-weight: 700;
  color: #1f2937;
  margin: 0;
}

.title-icon {
  font-size: 1.5rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.favoritos-count {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: white;
  font-size: 1rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 2rem;
  min-width: 2.5rem;
  text-align: center;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.btn-refresh-favoritos {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: white;
  color: #6b7280;
  border: 1px solid #e5e7eb;
  padding: 0.625rem 1.25rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-refresh-favoritos:hover {
  background: #f9fafb;
  color: #3b82f6;
  border-color: #3b82f6;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(59, 130, 246, 0.1);
}

.btn-refresh-favoritos:hover svg {
  animation: spin 0.5s ease-in-out;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* 3. FILTROS */
.favoritos-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.filter-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #4b5563;
}

.filter-label svg {
  width: 16px;
  height: 16px;
  color: #9ca3af;
}

.filter-input,
.filter-select {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  background: white;
}

.filter-input:focus,
.filter-select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.filter-range {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-input-range {
  flex: 1;
  padding: 0.625rem 0.875rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.filter-input-range:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.filter-separator {
  color: #9ca3af;
  font-weight: 500;
}

.btn-clear-filters {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fecaca;
  padding: 0.625rem 1.25rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: auto;
}

.btn-clear-filters:hover {
  background: #fecaca;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(239, 68, 68, 0.1);
}

/* 4. ESTADÍSTICAS */
.favoritos-stats {
  display: flex;
  gap: 2rem;
  padding: 1rem;
  background: #f9fafb;
  border-radius: 0.75rem;
  border: 1px solid #f3f4f6;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.stat-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #6b7280;
}

.stat-value {
  font-size: 1.125rem;
  font-weight: 700;
  color: #1f2937;
}

.stat-go {
  color: #16a34a;
}

.stat-nogo {
  color: #dc2626;
}

.stat-pendiente {
  color: #f59e0b;
}

.stat-urgente {
  color: #ef4444;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* 5. RESPONSIVE */
@media (max-width: 1024px) {
  .favoritos-filters {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
}

@media (max-width: 768px) {
  .favoritos-search-container {
    padding: 1.5rem 1rem;
  }
  
  .favoritos-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .favoritos-title {
    font-size: 1.5rem;
  }
  
  .favoritos-filters {
    grid-template-columns: 1fr;
  }
  
  .favoritos-stats {
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
  }
  
  .btn-clear-filters {
    width: 100%;
  }
}

/* 6. MENSAJE DE NO RESULTADOS */
.no-results-message {
  text-align: center;
  padding: 4rem 2rem;
  color: #6b7280;
}

.no-results-message svg {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  display: block;
  color: #d1d5db;
}

.no-results-message h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #4b5563;
  margin-bottom: 0.5rem;
}

.no-results-message p {
  font-size: 0.875rem;
  color: #9ca3af;
}

/* ===== FAVORITAS ADMIN - DISEÑO MEJORADO ===== */

/* 1. CONTENEDOR PRINCIPAL */
.admin-favoritas-container {
  background: white;
  border-radius: 1.5rem;
  padding: 2rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  border: 1px solid #e5e7eb;
}

/* 2. HEADER */
.admin-favoritas-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid #f3f4f6;
}

.admin-favoritas-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.75rem;
  font-weight: 700;
  color: #1f2937;
  margin: 0;
}

.admin-favoritas-count {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: white;
  font-size: 1rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 2rem;
  min-width: 2.5rem;
  text-align: center;
  box-shadow: 0 2px 4px rgba(139, 92, 246, 0.3);
}

.admin-header-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.admin-user-filter {
  padding: 0.625rem 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  min-width: 200px;
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
}

.admin-user-filter:focus {
  outline: none;
  border-color: #8b5cf6;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.btn-refresh-admin {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: white;
  color: #6b7280;
  border: 1px solid #e5e7eb;
  padding: 0.625rem 1.25rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-refresh-admin:hover {
  background: #f9fafb;
  color: #8b5cf6;
  border-color: #8b5cf6;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(139, 92, 246, 0.1);
}

/* 3. ESTADÍSTICAS */
.admin-favoritas-stats {
  display: flex;
  gap: 2rem;
  padding: 1rem;
  background: #f9fafb;
  border-radius: 0.75rem;
  border: 1px solid #f3f4f6;
  margin-bottom: 2rem;
}

.admin-stat-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-stat-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #6b7280;
}

.admin-stat-value {
  font-size: 1.125rem;
  font-weight: 700;
  color: #8b5cf6;
}

/* 4. GRID DE TARJETAS */
.admin-favoritas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.5rem;
}

/* 5. TARJETA DE FAVORITA */
.admin-fav-card {
  background: white;
  border-radius: 1rem;
  border: 1px solid #e5e7eb;
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
}

.admin-fav-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
  border-color: #8b5cf6;
}

.admin-fav-header {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  padding: 1.25rem;
  border-bottom: 1px solid #e5e7eb;
}

.admin-fav-expediente {
  font-size: 0.875rem;
  font-weight: 700;
  color: #8b5cf6;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-fav-titulo {
  font-size: 1rem;
  font-weight: 600;
  color: #1f2937;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.admin-fav-body {
  padding: 1.25rem;
}

.admin-fav-info {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.admin-fav-info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
}

.admin-fav-label {
  color: #6b7280;
  font-weight: 500;
}

.admin-fav-value {
  color: #374151;
  font-weight: 600;
}

.admin-fav-user {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.admin-fav-footer {
  background: #f9fafb;
  padding: 1rem 1.25rem;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-fav-date {
  font-size: 0.75rem;
  color: #6b7280;
}

.admin-fav-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-view-detail {
  background: #8b5cf6;
  color: white;
  border: none;
  padding: 0.375rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-view-detail:hover {
  background: #7c3aed;
  transform: translateY(-1px);
}

/* 6. MODAL DE DETALLE */
.modal-overlay-admin {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  backdrop-filter: blur(4px);
}

.modal-container-admin {
  background: white;
  border-radius: 1.5rem;
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
}

.modal-header-admin {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2rem;
  border-bottom: 1px solid #e5e7eb;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.modal-title-admin {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: #1f2937;
  margin: 0;
}

.modal-close-admin {
  background: none;
  border: none;
  cursor: pointer;
  color: #6b7280;
  padding: 0.5rem;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
}

.modal-close-admin:hover {
  background: #f3f4f6;
  color: #374151;
}

.modal-body-admin {
  padding: 2rem;
}

.modal-field-group {
  margin-bottom: 1.5rem;
}

.modal-field-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #4b5563;
  margin-bottom: 0.5rem;
}

.modal-field-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.modal-field-input:focus {
  outline: none;
  border-color: #8b5cf6;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.modal-field-input[readonly] {
  background: #f9fafb;
  color: #6b7280;
  cursor: not-allowed;
}

.modal-field-textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  min-height: 100px;
  resize: vertical;
  transition: all 0.2s ease;
}

.modal-field-textarea:focus {
  outline: none;
  border-color: #8b5cf6;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.modal-footer-admin {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  padding: 1.5rem 2rem;
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
}

.btn-cancel-admin {
  background: #e5e7eb;
  color: #374151;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-cancel-admin:hover {
  background: #d1d5db;
}

.btn-save-admin {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-save-admin:hover {
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

/* 7. RESPONSIVE */
@media (max-width: 768px) {
  .admin-favoritas-header {
    flex-direction: column;
    gap: 1rem;
  }
  
  .admin-header-actions {
    width: 100%;
    flex-direction: column;
  }
  
  .admin-user-filter {
    width: 100%;
  }
  
  .admin-favoritas-stats {
    flex-direction: column;
    gap: 1rem;
  }
  
  .admin-favoritas-grid {
    grid-template-columns: 1fr;
  }
  
  .modal-container-admin {
    width: 95%;
    margin: 1rem;
  }
}
