/* ===== 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 {
  /* OJO: nada de display:none aquí */
  padding: 32px 40px;
  max-width: 1400px;
  margin: 0 auto;
}

/* Oculta solo las que no están activas */
.section:not(.active) {
  display: none;
}

.section.active {
  display: block;
}

/* 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” pero acotados a secciones y grupos de búsqueda */
.section button:not(.action-btn):not(.modern-btn):not(.thoria-float-btn),
.search-group button:not(.action-btn):not(.modern-btn):not(.thoria-float-btn),
#loginForm button {
  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);
}

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

.section button:not(.action-btn):not(.modern-btn):not(.thoria-float-btn):active,
.search-group button:not(.action-btn):not(.modern-btn):not(.thoria-float-btn):active,
#loginForm button:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.section button:not(.action-btn):not(.modern-btn):not(.thoria-float-btn):disabled,
.search-group button:not(.action-btn):not(.modern-btn):not(.thoria-float-btn):disabled,
#loginForm button:disabled {
  background: var(--gray-300);
  color: var(--gray-500);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.section button:not(.action-btn):not(.modern-btn):not(.thoria-float-btn)::before,
.search-group button:not(.action-btn):not(.modern-btn):not(.thoria-float-btn)::before,
#loginForm button::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 */


.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);
}



.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%;
  }



  .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 */
/* === OVERRIDE: ocultar engranajes parpadeantes en tarjetas === */
.kanban-card-stacked::after,
.card-preview::after {
  content: none !important;
  display: none !important;
  animation: none !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;
}

/* === COLOREADO POR ESTADO (no rompe estilos actuales) === */

/* Presentada → amarillo suave */
.kanban-card-stacked.wf-estado-presentada {
  background: linear-gradient(145deg, #fff8e1 0%, #fffbeb 100%);
  border-color: rgba(245, 158, 11, 0.35);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.12);
}

.kanban-card-stacked.wf-estado-presentada .card-preview-expediente {
  box-shadow: 0 3px 8px rgba(245, 158, 11, 0.25);
}

/* Adjudicada → verde suave */
.kanban-card-stacked.wf-estado-adjudicada {
  background: linear-gradient(145deg, #ecfdf5 0%, #f0fdf4 100%);
  border-color: rgba(16, 185, 129, 0.35);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.12);
}

.kanban-card-stacked.wf-estado-adjudicada .card-preview-expediente {
  box-shadow: 0 3px 8px rgba(16, 185, 129, 0.25);
}

/* Perdida → rojo suave (mandatorio) */
.kanban-card-stacked.wf-estado-perdida {
  background: linear-gradient(145deg, #fef2f2 0%, #fee2e2 100%);
  border-color: rgba(239, 68, 68, 0.35);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
}

.kanban-card-stacked.wf-estado-perdida .card-preview-expediente {
  box-shadow: 0 3px 8px rgba(239, 68, 68, 0.25);
}

/* Si por cualquier motivo coincidiera con clases de urgencia,
   damos prioridad visual al color por estado. */
/* opcional */
.kanban-card-stacked.estado-presentada {
  background: linear-gradient(180deg, #fffbe6, #fff7cc);
  border-left: 4px solid #f59e0b;
}

.kanban-card-stacked.estado-adjudicada {
  background: linear-gradient(180deg, #ecfdf5, #d1fae5);
  border-left: 4px solid #10b981;
}

.kanban-card-stacked.estado-perdida {
  background: linear-gradient(180deg, #fef2f2, #fee2e2);
  border-left: 4px solid #ef4444;
}

/* 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;
  }
}

.modal-comment--unread {
  outline: 2px solid #fde68a;
  border-radius: 8px;
}

/* ThorIA panel: sin colchón inferior del body en esta vista */
body.thoria-page {
  padding-bottom: 0;
}

/* =========================================================
   Resúmenes de pliegos · Toolbar avanzada (bonita y on-brand)
   ========================================================= */
.resumenes-toolbar.avanzada {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 4px solid #ff6600;
  /* acento naranja Thor */
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  padding: 18px 18px 10px;
  margin: 18px 0 22px;
}

.resumenes-toolbar.avanzada .fila {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.resumenes-toolbar.avanzada .campo {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 180px;
  /* Auto-span inteligente en desktop */
  grid-column: span 3;
}

.resumenes-toolbar.avanzada .campo.wide {
  grid-column: span 6;
}

.resumenes-toolbar.avanzada .campo.narrow {
  grid-column: span 2;
}

.resumenes-toolbar.avanzada label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Inputs: ya tienes un estilo base; añadimos “tonos” y micro-UX */
.resumenes-toolbar.avanzada .input,
.resumenes-toolbar.avanzada .input-busqueda,
.resumenes-toolbar.avanzada input,
.resumenes-toolbar.avanzada select {
  border: 2px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 10px 12px;
  border-radius: 10px;
  transition: all var(--transition-fast);
  font-size: 0.92rem;
}

.resumenes-toolbar.avanzada .input:focus,
.resumenes-toolbar.avanzada .input-busqueda:focus,
.resumenes-toolbar.avanzada input:focus,
.resumenes-toolbar.avanzada select:focus {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .12);
  background: var(--very-light-blue);
}

/* Buscador con icono */
.resumenes-toolbar.avanzada .input-busqueda {
  padding-left: 38px;
  background-image:
    url("data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px 50%;
  background-size: 18px;
}

/* Mini grid para pares (importe mín/máx) */
.resumenes-toolbar.avanzada .grid {
  display: grid;
  gap: 10px;
}

.resumenes-toolbar.avanzada .grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

/* Toggle tipo “switch” */
.resumenes-toolbar.avanzada .switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}

.resumenes-toolbar.avanzada .switch input {
  appearance: none;
  width: 44px;
  height: 24px;
  background: var(--gray-300);
  border-radius: 999px;
  position: relative;
  outline: none;
  cursor: pointer;
  transition: background .2s;
  border: 1px solid var(--border-color);
}

.resumenes-toolbar.avanzada .switch input::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transform: translateY(-50%);
  box-shadow: var(--shadow-sm);
  transition: left .2s;
}

.resumenes-toolbar.avanzada .switch input:checked {
  background: linear-gradient(135deg, #ff6600 0%, #ff9900 100%);
  border-color: #ff7a1f;
}

.resumenes-toolbar.avanzada .switch input:checked::after {
  left: 23px;
}

.resumenes-toolbar.avanzada .switch span {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 600;
}

/* Botones de acción (no pisan tus botones globales) */
.resumenes-toolbar.avanzada .btn-primario,
.resumenes-toolbar.avanzada .btn-secundario {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  border: 0;
  transition: transform .15s ease, box-shadow .15s ease;
  min-height: 42px;
}

.resumenes-toolbar.avanzada .btn-primario {
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.resumenes-toolbar.avanzada .btn-primario:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  background: linear-gradient(135deg, var(--primary-blue-dark) 0%, var(--primary-blue-darker) 100%);
}

.resumenes-toolbar.avanzada .btn-secundario {
  background: #fff;
  color: var(--text-primary);
  border: 2px solid var(--border-color);
}

.resumenes-toolbar.avanzada .btn-secundario:hover {
  border-color: var(--border-hover);
  background: var(--gray-50);
  transform: translateY(-1px);
}

/* “Badge” extra para invitaciones (si la usas) */
.badge-warning {
  background-color: #fff4e6;
  color: #b45309;
  border: 1px solid #ffd3a6;
}

/* Responsive */
@media (max-width: 1100px) {
  .resumenes-toolbar.avanzada .campo {
    grid-column: span 4;
  }
}

@media (max-width: 900px) {
  .resumenes-toolbar.avanzada {
    padding: 14px;
  }

  .resumenes-toolbar.avanzada .fila {
    grid-template-columns: repeat(6, 1fr);
  }

  .resumenes-toolbar.avanzada .campo {
    grid-column: span 6;
  }

  .resumenes-toolbar.avanzada .grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .resumenes-toolbar.avanzada .fila {
    grid-template-columns: repeat(4, 1fr);
  }

  .resumenes-toolbar.avanzada .campo {
    grid-column: span 4;
  }
}

/* ============================
   Chip toggle (Invitaciones)
   ============================ */
.resumenes-toolbar.avanzada .chip-toggle {
  display: inline-block;
}

.resumenes-toolbar.avanzada .chip-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.resumenes-toolbar.avanzada .chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 2px solid var(--border-color);
  background: #fff;
  color: var(--text-primary);
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, border-color .2s ease, background .2s ease;
  box-shadow: var(--shadow-sm);
}

.resumenes-toolbar.avanzada .chip:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.resumenes-toolbar.avanzada .chip .icon {
  font-size: 1rem;
}

.resumenes-toolbar.avanzada .chip .txt {
  font-size: .92rem;
}

.resumenes-toolbar.avanzada .chip .badge {
  display: none;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  font-weight: 800;
  background: var(--primary-blue);
  color: #fff;
}

.resumenes-toolbar.avanzada .chip.is-on {
  background: linear-gradient(135deg, #fff0e6 0%, #ffe6d1 100%);
  border-color: #ffcaa6;
  /* acento invitaciones */
}

.resumenes-toolbar.avanzada .chip.is-on .badge {
  display: inline-flex;
}

.resumenes-toolbar.avanzada .hint {
  font-size: .8rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* === Presence UI (Kanban) =============================================== */
.presence-dock {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-left: 4px solid #ff7a00;
  padding: 10px 12px;
  margin: 10px 0 16px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(2, 23, 64, 0.06);
}

.presence-dock-title {
  font-weight: 700;
  color: #0f172a
}

.presence-dock-avatars {
  display: flex;
  gap: 6px;
  flex-wrap: wrap
}

.presence-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 12px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15)
}

.presence-none {
  font-size: 12px;
  color: #667085
}

.presence-stack {
  position: absolute;
  right: 8px;
  top: 8px;
  display: flex;
  gap: 4px;
  z-index: 3;
}

.presence-dot {
  width: 22px;
  height: 22px;
  border-radius: 9999px;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18)
}

.presence-plus {
  min-width: 22px;
  height: 22px;
  padding: 0 4px;
  border-radius: 9999px;
  background: #0f172a;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ======================================================================= */

/* === Sidebar (drawer lateral) === */
.hamburger {
  position: absolute;
  left: 16px;
  top: 20px;
  z-index: 1010;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: transform var(--transition-fast);
}

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

/* Contenedor del drawer */
nav.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  /* top:0; right:auto; bottom:0; left:0 */
  width: 300px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  transform: translateX(-100%);
  transition: transform var(--transition-normal);
  z-index: 1100;
  padding: 16px 16px 24px 16px;
}

nav.sidebar.open {
  transform: translateX(0);
}

nav.sidebar[aria-hidden="false"] {
  transform: translateX(0);
}

/* Cabecera del drawer */
nav.sidebar .sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

nav.sidebar .sidebar-title {
  font-weight: 700;
  color: var(--primary-blue);
}

nav.sidebar .sidebar-close {
  background: transparent;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--gray-600);
  padding: 6px 8px;
  border-radius: 8px;
}

nav.sidebar .sidebar-close:hover {
  background: var(--bg-hover);
}

/* Backdrop */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
  z-index: 1090;
}

.sidebar-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

/* Sobrescribir SOLO dentro del sidebar:
   el menú pasa a vertical y de ancho completo */
nav.sidebar ul.menu {
  display: flex !important;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
  list-style: none;
}

nav.sidebar ul.menu li {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

nav.sidebar ul.menu li:hover {
  background: var(--bg-hover);
}

nav.sidebar ul.menu li.active {
  background: rgba(59, 130, 246, 0.10);
  border-color: var(--primary-blue);
  color: var(--primary-blue);
  box-shadow: var(--shadow-sm);
}

/* Botón logout dentro del sidebar */
nav.sidebar #logoutBtn {
  width: 100%;
  margin-top: 14px;
}

/* Notificaciones dentro del sidebar: que el menú desplegable se ajuste al ancho */
nav.sidebar #notifMenu {
  position: relative;
  right: auto;
  left: 0;
  width: 100%;
}

/* Pequeño ajuste del header al tener el botón hamburguesa */
header {
  padding-left: 56px;
}

/* Responsive: en pantallas pequeñas ocupamos 85% del ancho */
@media (max-width: 640px) {
  nav.sidebar {
    width: 85vw;
  }
}

/* === Paleta naranja Thor (no invasiva) === */
:root {
  --brand-orange: #ff6600;
  /* base */
  --brand-orange-dark: #cc5200;
  /* más oscuro */
  --brand-orange-light: #ff944d;
  /* más claro */
  --brand-orange-soft: rgba(255, 102, 0, 0.14);
  /* para sombras suaves */
}

/* === H1 con tonos naranjas en el header === */
header h1 {
  /* Fallback sólido si no hay soporte de clip */
  color: var(--brand-orange);

  /* Gradiente naranja en el texto */
  background-image: linear-gradient(180deg,
      var(--brand-orange-light) 0%,
      var(--brand-orange) 65%,
      var(--brand-orange-dark) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;

  /* Ajustes sutiles */
  font-weight: 800;
  letter-spacing: -0.02em;
  text-align: center;
  /* conserva centrado */
  text-shadow:
    0 1px 0 rgba(0, 0, 0, 0.15),
    0 14px 28px var(--brand-orange-soft);
  position: relative;
}

/* Subrayado decorativo suave (puedes quitarlo si no te gusta) */
header h1::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: -8px;
  height: 6px;
  width: 72px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand-orange) 0%, var(--brand-orange-light) 100%);
  box-shadow: 0 8px 24px var(--brand-orange-soft);
}

/* Ajuste responsive para móviles */
@media (max-width: 640px) {
  header h1::after {
    height: 4px;
    width: 46px;
    bottom: -6px;
  }
}

/* === Paleta naranja (si ya la añadiste antes, puedes omitir este :root) === */
:root {
  --brand-orange: #ff6600;
  /* base */
  --brand-orange-dark: #cc5200;
  /* más oscuro */
  --brand-orange-light: #ff944d;
  /* más claro */
  --brand-orange-soft: rgba(255, 102, 0, 0.14);
}

/* === Header en tonos naranja + blanco (override seguro) === */
/* usamos !important para ganar a reglas previas duplicadas del header */
body>header {
  background: linear-gradient(135deg,
      #ffffff 0%,
      #fff7f0 28%,
      #ffe7d2 65%,
      #ffd6b3 100%) !important;
  border-bottom: 3px solid var(--brand-orange-dark) !important;
  color: var(--text-primary) !important;
}

/* Mejora de legibilidad del botón hamburguesa sobre fondo claro */
.hamburger {
  color: var(--brand-orange-dark) !important;
  background: rgba(255, 102, 0, 0.08) !important;
  border: 1px solid rgba(255, 102, 0, 0.25) !important;
}

/* Si prefieres que el título respire un poco más sobre el nuevo fondo */
header h1 {
  text-shadow:
    0 1px 0 rgba(0, 0, 0, 0.10),
    0 14px 28px var(--brand-orange-soft) !important;
}

/* Línea decorativa del h1 ajustada al nuevo fondo */
header h1::after {
  background: linear-gradient(90deg, var(--brand-orange) 0%, var(--brand-orange-light) 100%) !important;
  box-shadow: 0 8px 24px var(--brand-orange-soft) !important;
}

/* ==== Thoria: UI Auto-triaje ==== */
.pill-auto {
  display: inline-block;
  padding: 2px 8px;
  font-size: 12px;
  line-height: 1.4;
  border-radius: 999px;
  background: #ffefe3;
  /* naranja muy suave */
  color: #c45500;
  /* naranja fuerte (legible) */
  border: 1px solid #ffc9a6;
  font-weight: 600;
  vertical-align: middle;
  margin-left: 8px;
}

.btn-no-me-interesa-thoria {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-size: 13px;
  border-radius: 8px;
  border: 1px solid #ffd3b5;
  background: #fff;
  color: #c45500;
  cursor: pointer;
  transition: background .15s ease, transform .05s ease;
}

.btn-no-me-interesa-thoria:hover {
  background: #fff6f0;
}

.btn-no-me-interesa-thoria:active {
  transform: translateY(1px);
}

.btn-no-me-interesa-thoria .x {
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
}

/* ======== THOR Kanban — Tema Naranja/Blanco (Overrides) ======== */
:root {
  --brand-orange-50: #fff7ed;
  --brand-orange-100: #ffedd5;
  --brand-orange-200: #fed7aa;
  --brand-orange-300: #fdba74;
  --brand-orange-400: #fb923c;
  --brand-orange-500: #f97316;
  --brand-orange-600: #ea580c;
  --brand-orange-700: #c2410c;
  --brand-orange-800: #9a3412;
  --brand-surface: #ffffff;
  --brand-surface-2: #fafafa;
  --brand-border: #f1f5f9;
  --brand-text: #0f172a;
  --brand-muted: #64748b;
}

/* Tablero claro (antes era oscuro) */
.kanban-board-stacked {
  background: linear-gradient(180deg, var(--brand-surface) 0%, var(--brand-surface-2) 100%) !important;
  box-shadow: inset 0 1px 0 #fff;
  border-radius: 20px;
}

/* Columnas claras */
.kanban-column-stacked {
  background: #fff !important;
  border: 1px solid var(--brand-border) !important;
  box-shadow:
    0 4px 24px rgba(2, 6, 23, .06),
    0 1px 0 rgba(255, 255, 255, .9) inset !important;
}

/* Header de columna con degradado naranja (ignoramos clases tailwind inyectadas) */
.kanban-column-title-stacked {
  background: linear-gradient(135deg, var(--brand-orange-400), var(--brand-orange-600)) !important;
  color: #fff !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, .25);
  border: 1px solid rgba(255, 255, 255, .25);
}

/* Contador de columna: pastilla clara */
.kanban-column-count-stacked {
  background: #fff !important;
  color: var(--brand-text) !important;
  border: 1px solid var(--brand-border) !important;
}

/* Scroll contenedor tarjetas: sutil */
.kanban-cards-stack-container::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, .15) !important;
}

.kanban-cards-stack-container::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, .04) !important;
}

/* Tarjetas: base clara + hover en naranja (reemplaza azul) */
.kanban-card-stacked {
  background: linear-gradient(145deg, #fff 0%, #fff 100%) !important;
  border: 1px solid var(--brand-border) !important;
  box-shadow: 0 2px 10px rgba(2, 6, 23, .05) !important;
}

.kanban-card-stacked:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 28px rgba(2, 6, 23, .12), 0 0 0 2px rgba(249, 115, 22, .25) !important;
  /* naranja 500 */
  background: linear-gradient(145deg, #fff 0%, #fff 100%) !important;
}

/* Encabezado dentro de la tarjeta (si existe) */
.card-preview-header .badge,
.card-preview-header .chip {
  background: var(--brand-orange-50);
  color: var(--brand-orange-700);
  border: 1px solid var(--brand-orange-200);
}

/* Botones de fase (si usas .btnAvanzarFase / .btnRetrocederFase) */
.btnAvanzarFase,
.btnRetrocederFase,
.btnEstrategia {
  background: linear-gradient(135deg, var(--brand-orange-500), var(--brand-orange-600)) !important;
  color: #fff !important;
  border: none !important;
  box-shadow: 0 6px 18px rgba(249, 115, 22, .35) !important;
}

.btnAvanzarFase:hover,
.btnRetrocederFase:hover,
.btnEstrategia:hover {
  filter: brightness(1.03);
  transform: translateY(-1px);
}

.btnAvanzarFase:disabled,
.btnRetrocederFase:disabled {
  background: linear-gradient(135deg, #e5e7eb, #cbd5e1) !important;
  color: #475569 !important;
  box-shadow: none !important;
}

/* Focus accesible en naranja (sustituye outline azul) */
.kanban-card-stacked:focus {
  outline: 3px solid rgba(249, 115, 22, .65) !important;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, .25) !important;
}

.kanban-btn-stacked:focus {
  outline: 2px solid rgba(249, 115, 22, .85) !important;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, .25) !important;
}

/* Indicador de cantidad en stacks (si se usa) a tono naranja */
.card-stack::before {
  background: var(--brand-orange-50) !important;
  color: var(--brand-orange-800) !important;
  border: 1px solid var(--brand-orange-200);
}

/* Botón “Nueva invitación” → naranja */
.btn-nueva-invitacion {
  background: linear-gradient(135deg, var(--brand-orange-500), var(--brand-orange-700)) !important;
  box-shadow: 0 6px 18px rgba(249, 115, 22, .35) !important;
}

.btn-nueva-invitacion:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(249, 115, 22, .45) !important;
}

/* Modal de invitación: cabecera y botones en naranja */
.modal-header-invitacion {
  border-bottom: 1px solid var(--brand-border) !important;
  background: linear-gradient(180deg, #fff, var(--brand-orange-50)) !important;
}

.modal-title-invitacion {
  color: var(--brand-text) !important;
}

#btnCerrarModalInvitacion svg {
  color: var(--brand-muted);
}

/* Presence dock ya lleva acento naranja; mantenemos estética */
.presence-dock {
  border-left-color: var(--brand-orange-500) !important;
}

/* Badges de “no leídos” ya son rojas, no cambiamos. Si quisieras naranja: */
/*
.badge-unread{
  background: var(--brand-orange-600) !important;
}
*/

/* Borde lateral por estado (sutil) */
.kanban-column-stacked[data-estado="Adjudicada"] {
  border-left: 4px solid #16a34a;
}

/* verde */
.kanban-column-stacked[data-estado="Perdida"] {
  border-left: 4px solid #64748b;
}

/* gris */
.kanban-column-stacked[data-estado="Presentada"] {
  border-left: 4px solid #06b6d4;
}

/* cian */
.kanban-column-stacked[data-estado="Favorita"] {
  border-left: 4px solid var(--brand-orange-500);
}

.kanban-column-stacked[data-estado="GoNoGo"] {
  border-left: 4px solid #f59e0b;
}

/* amber */

/* === URGENCIA: variantes de tarjeta (debe ir AL FINAL del CSS) === */
/* Aumentamos especificidad para ganar a .kanban-card-stacked { ... !important } */

.kanban-card-stacked.urgencia-amarilla {
  background: linear-gradient(145deg, #fffbea 0%, #fef3c7 100%) !important;
  border: 2px solid rgba(251, 191, 36, 0.45) !important;
  box-shadow: 0 10px 24px rgba(251, 191, 36, .25), 0 0 0 2px rgba(251, 191, 36, .18) !important;
}

.kanban-card-stacked.urgencia-amarilla:hover {
  background: linear-gradient(145deg, #fff9e6 0%, #fdecc1 100%) !important;
  border-color: rgba(251, 191, 36, .6) !important;
}

.kanban-card-stacked.urgencia-roja,
.kanban-card-stacked.urgencia-vencida {
  background: linear-gradient(145deg, #fef2f2 0%, #fee2e2 100%) !important;
  border: 2px solid rgba(239, 68, 68, 0.45) !important;
  box-shadow: 0 10px 24px rgba(239, 68, 68, .25), 0 0 0 2px rgba(239, 68, 68, .18) !important;
}

.kanban-card-stacked.urgencia-roja:hover,
.kanban-card-stacked.urgencia-vencida:hover {
  background: linear-gradient(145deg, #fde8e8 0%, #fbd5d5 100%) !important;
  border-color: rgba(239, 68, 68, .6) !important;
}

.kanban-card-stacked.urgencia-normal {
  background: linear-gradient(145deg, #f0fdf4 0%, #dcfce7 100%) !important;
  border: 2px solid rgba(34, 197, 94, .45) !important;
  box-shadow: 0 10px 24px rgba(34, 197, 94, .25), 0 0 0 2px rgba(34, 197, 94, .18) !important;
}

.kanban-card-stacked.urgencia-normal:hover {
  background: linear-gradient(145deg, #e9fbef 0%, #d6f9e0 100%) !important;
  border-color: rgba(34, 197, 94, .6) !important;
}

/* Pastilla “días” dentro de la tarjeta según urgencia */
.kanban-card-stacked.urgencia-amarilla .card-preview-days {
  background: #fffbeb !important;
  border-color: #fde68a !important;
  color: #b45309 !important;
  /* ámbar oscuro */
}

.kanban-card-stacked.urgencia-roja .card-preview-days,
.kanban-card-stacked.urgencia-vencida .card-preview-days {
  background: #fef2f2 !important;
  border-color: #fca5a5 !important;
  color: #b91c1c !important;
}

.kanban-card-stacked.urgencia-normal .card-preview-days {
  background: #f0fdf4 !important;
  border-color: #86efac !important;
  color: #166534 !important;
}

/* Opcional: si quieres que el contador del encabezado avise de urgencias */
.kanban-column-count-stacked.has-urgent {
  background: #fff7ed !important;
  color: #c2410c !important;
  border-color: #fed7aa !important;
}

.kanban-column-count-stacked.has-critical {
  background: #fef2f2 !important;
  color: #b91c1c !important;
  border-color: #fecaca !important;
}

/* === ESTADOS FINALES: Adjudicada (verde) y Perdida (roja)
     Debe ir AL FINAL del CSS para prevalecer sobre overrides previos === */

/* ADJUDICADA → verde */
.kanban-card-stacked.estado-adjudicada {
  background: linear-gradient(145deg, #f0fdf4 0%, #dcfce7 100%) !important;
  border: 2px solid rgba(34, 197, 94, .45) !important;
  /* verde 500 */
  box-shadow: 0 10px 24px rgba(34, 197, 94, .25), 0 0 0 2px rgba(34, 197, 94, .18) !important;
}

.kanban-card-stacked.estado-adjudicada:hover {
  background: linear-gradient(145deg, #e9fbef 0%, #d6f9e0 100%) !important;
  border-color: rgba(34, 197, 94, .6) !important;
}

/* Si por lógica viniera con alguna urgencia, el estado manda */
.kanban-card-stacked.estado-adjudicada[class*="urgencia-"] {
  background: linear-gradient(145deg, #f0fdf4 0%, #dcfce7 100%) !important;
  border-color: rgba(34, 197, 94, .45) !important;
  box-shadow: 0 10px 24px rgba(34, 197, 94, .25), 0 0 0 2px rgba(34, 197, 94, .18) !important;
}

/* Pastilla de días dentro de la tarjeta */
.kanban-card-stacked.estado-adjudicada .card-preview-days {
  background: #f0fdf4 !important;
  border-color: #86efac !important;
  color: #166534 !important;
}

/* PERDIDA → roja */
.kanban-card-stacked.estado-perdida {
  background: linear-gradient(145deg, #fef2f2 0%, #fee2e2 100%) !important;
  border: 2px solid rgba(239, 68, 68, .45) !important;
  /* rojo 500 */
  box-shadow: 0 10px 24px rgba(239, 68, 68, .25), 0 0 0 2px rgba(239, 68, 68, .18) !important;
}

.kanban-card-stacked.estado-perdida:hover {
  background: linear-gradient(145deg, #fde8e8 0%, #fbd5d5 100%) !important;
  border-color: rgba(239, 68, 68, .6) !important;
}

/* Si por lógica viniera con alguna urgencia, el estado manda */
.kanban-card-stacked.estado-perdida[class*="urgencia-"] {
  background: linear-gradient(145deg, #fef2f2 0%, #fee2e2 100%) !important;
  border-color: rgba(239, 68, 68, .45) !important;
  box-shadow: 0 10px 24px rgba(239, 68, 68, .25), 0 0 0 2px rgba(239, 68, 68, .18) !important;
}

/* Pastilla de días dentro de la tarjeta */
.kanban-card-stacked.estado-perdida .card-preview-days {
  background: #fef2f2 !important;
  border-color: #fca5a5 !important;
  color: #b91c1c !important;
}

/* (Opcional) PRESENTADA → ámbar/amarillo como antes */
.kanban-card-stacked.estado-presentada {
  background: linear-gradient(145deg, #fffbea 0%, #fef3c7 100%) !important;
  border: 2px solid rgba(251, 191, 36, .45) !important;
  box-shadow: 0 10px 24px rgba(251, 191, 36, .25), 0 0 0 2px rgba(251, 191, 36, .18) !important;
}

.kanban-card-stacked.estado-presentada .card-preview-days {
  background: #fffbeb !important;
  border-color: #fde68a !important;
  color: #b45309 !important;
}

/* Nota: mantenemos las urgencias para el resto de estados,
   pero en Adjudicada/Perdida/PRESENTADA prioriza el color de estado. */

/* ===== Tipografía negra uniforme en tarjetas Kanban ===== */
/* Base: todo texto dentro de la tarjeta en negro */
.kanban-card-stacked,
.kanban-card-stacked * {
  color: #0f172a !important;
  /* negro/gris muy oscuro */
}

/* Títulos y metadatos importantes */
.kanban-card-stacked .card-preview-title,
.kanban-card-stacked .card-importe,
.kanban-card-stacked .card-meta,
.kanban-card-stacked .card-preview-expediente,
.kanban-card-stacked .card-preview-organismo,
.kanban-card-stacked .card-preview-days,
.kanban-card-stacked p,
.kanban-card-stacked small,
.kanban-card-stacked time,
.kanban-card-stacked a {
  color: #0f172a !important;
}

/* Botones dentro de la tarjeta: pasamos a estilo claro para que el texto negro contraste bien */
.kanban-card-stacked .card-actions .btn,
.kanban-card-stacked .btnEstrategia,
.kanban-card-stacked .btnAvanzarFase,
.kanban-card-stacked .btnRetrocederFase {
  background: #ffffff !important;
  border: 1px solid #ffd4b0 !important;
  color: #0f172a !important;
  box-shadow: none !important;
}

.kanban-card-stacked .card-actions .btn:hover,
.kanban-card-stacked .btnEstrategia:hover,
.kanban-card-stacked .btnAvanzarFase:hover,
.kanban-card-stacked .btnRetrocederFase:hover {
  background: #fff7f0 !important;
}

/* Pastilla de días: mantenemos los fondos de urgencia pero texto negro */
.kanban-card-stacked .card-preview-days {
  color: #0f172a !important;
}

/* Badges/contadores que llevaban texto blanco: también negros */
.kanban-card-stacked .badge,
.kanban-card-stacked .chip,
.kanban-card-stacked .badge-unread {
  color: #0f172a !important;
  background: #fff7f0 !important;
  /* fondo claro para que el texto negro se lea siempre */
  border: 1px solid #ffd4b0 !important;
}

/* Estados finales siguen con su fondo (verde/rojo/ámbar), pero el texto va en negro */
.kanban-card-stacked.estado-adjudicada *,
.kanban-card-stacked.estado-perdida *,
.kanban-card-stacked.estado-presentada * {
  color: #0f172a !important;
}

/* actualización nuevo estilo 

/* Overlays y modales cerrados por defecto con clases explícitas para abrir */
.overlay {
  display: none;
}

.overlay.open {
  display: flex;
}

.modal {
  display: none;
}

.modal.show {
  display: block;
}

/* === Tarjeta compacta === */
.kanban-card-stacked--modern .card-preview--compact {
  gap: .35rem;
}

.card-preview-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}

.card-preview-expediente {
  font-weight: 600;
  font-size: .78rem;
  color: #0f172a;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  padding: .15rem .45rem;
  border-radius: .5rem;
}

.card-preview-status {
  width: 46px;
  height: 6px;
  border-radius: 999px;
  opacity: .9;
}

.card-preview-title {
  font-weight: 700;
  color: #0b1736;
  line-height: 1.25;
}

.card-preview-meta {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
  color: #334155;
  font-size: .85rem;
}

.card-preview-importe {
  margin-left: auto;
  font-weight: 600;
  color: #0b1736;
}

.card-preview-deadline {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .82rem;
  color: #334155;
}

.card-preview-actions {
  display: flex;
  gap: .25rem;
  flex-wrap: wrap;
  margin-top: .25rem;
}

.card-preview-actions--hover {
  opacity: 0;
  transition: .18s ease;
}

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

/* === Pills/buttons compactos === */
.kpills {
  display: flex;
  gap: .25rem;
  flex-wrap: wrap;
}

.kbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 .55rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: .85rem;
  line-height: 1;
  background: #f1f5f9;
  color: #0b1736;
  cursor: pointer;
  transition: .16s ease;
}

.kbtn:hover {
  filter: brightness(0.97);
}

.kbtn[disabled] {
  opacity: .55;
  cursor: not-allowed;
}

.kbtn--primary {
  background: #e0ecff;
  border-color: #c7dbff;
}

.kbtn--ok {
  background: #dcfce7;
  border-color: #86efac;
}

.kbtn--danger {
  background: #fee2e2;
  border-color: #fecaca;
}

.kbtn--ghost {
  background: #f8fafc;
  border-color: #e2e8f0;
}

/* === Modal acciones sticky === */
.modal-actions-modern--sticky {
  position: sticky;
  bottom: 0;
  z-index: 2;
  backdrop-filter: blur(6px);
  background: linear-gradient(180deg, rgba(255, 255, 255, .55) 0%, rgba(255, 255, 255, .9) 100%);
  padding-top: .75rem;
  margin-top: .75rem;
  border-top: 1px solid #e5e7eb;
}

/* === Chat limpio === */
.modal-comments-header--clean {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.badge-soft {
  background: #eef2ff;
  color: #1f3a8a;
  padding: .25rem .5rem;
  border-radius: 999px;
  font-size: .75rem;
}

.modal-comments-list--clean .modal-comment {
  border: 1px solid #eef2ff;
  border-radius: .75rem;
  padding: .6rem .75rem;
  margin-bottom: .5rem;
}

.modal-comment-form--clean {
  border-top: 1px dashed #e5e7eb;
  padding-top: .75rem;
}

.btn-soft {
  background: #e0ecff;
  border: 1px solid #c7dbff;
  color: #0b1736;
  border-radius: .6rem;
  padding: .45rem .8rem;
}

.btn-soft:hover {
  filter: brightness(.98);
}

/* === Urgencias (ya usabas clases; añadimos suavizado) === */
.urgencia-roja {
  box-shadow: 0 0 0 2px rgba(239, 68, 68, .12) inset;
}

.urgencia-amarilla {
  box-shadow: 0 0 0 2px rgba(251, 191, 36, .14) inset;
}

.urgencia-normal {
  box-shadow: 0 0 0 2px rgba(34, 197, 94, .12) inset;
}

/* ====== Thor • Tarjeta grande (modal de licitación) ====== */
:root {
  --th-accent: #ff7a18;
  --th-accent-2: #FFB703;
  --th-surface: #0b1220;
  --th-card: #0e162a;
  --th-border: #1b2a4a;
  --th-text: #e6edf7;
  --th-title: #ffffff;
}

#modalLicitacion.th-modal .th-modal-dialog {
  max-width: 1100px;
}

#modalLicitacion.th-modal .th-modal-content {
  background: var(--th-card);
  border: 1px solid var(--th-border);
  border-radius: 18px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, .35);
  overflow: hidden;
}

#modalLicitacion.th-modal .th-modal-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 14px 18px;
  background: linear-gradient(180deg, #0f172a, #0b1220);
  border-bottom: 1px solid var(--th-border);
  color: var(--th-title);
}

#modalLicitacion.th-modal .th-modal-body {
  padding: 16px 18px 8px;
  background: var(--th-surface);
  color: var(--th-text);
}

#modalLicitacion.th-modal .th-modal-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--th-border);
  background: var(--th-surface);
}

/* Grid principal dentro del modal (si lo usas) */
#modalLicitacion.th-modal .lic-grid {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 14px;
}

@media (max-width:1024px) {
  #modalLicitacion.th-modal .lic-grid {
    grid-template-columns: 1fr;
  }
}

/* Paneles */
#modalLicitacion.th-modal .lic-panel {
  background: var(--th-card);
  border: 1px solid var(--th-border);
  border-radius: 14px;
  padding: 14px;
}

#modalLicitacion.th-modal .lic-panel h3 {
  margin: 0 0 8px;
  font-size: .95rem;
  font-weight: 700;
  color: var(--th-title);
}

/* Formularios dentro del modal */
#modalLicitacion.th-modal input[type="text"],
#modalLicitacion.th-modal input[type="date"],
#modalLicitacion.th-modal input[type="number"],
#modalLicitacion.th-modal select,
#modalLicitacion.th-modal textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--th-border);
  border-radius: 10px;
  background: #0b1220;
  color: var(--th-text);
}

#modalLicitacion.th-modal textarea {
  min-height: 110px;
  resize: vertical;
}

#modalLicitacion.th-modal input::placeholder,
#modalLicitacion.th-modal textarea::placeholder {
  color: #94a3b8;
  opacity: .85;
}

/* Chips/etiquetas */
#modalLicitacion.th-modal .chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#modalLicitacion.th-modal .chip {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: .8rem;
  border: 1px solid var(--th-border);
  background: #0e1730;
  color: var(--th-text);
}

/* Chat dentro del modal */
#modalLicitacion.th-modal .th-chat-log {
  height: 320px;
  /* se adaptará si tu contenedor es flex */
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--th-border);
  border-radius: 12px;
  background: #0a101a;
}

#modalLicitacion.th-modal .th-chat-bar {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

#modalLicitacion.th-modal .th-chat-bar input,
#modalLicitacion.th-modal .th-chat-bar textarea {
  flex: 1;
}

#modalLicitacion.th-modal .th-msg-user,
#modalLicitacion.th-modal .th-msg-ai {
  display: inline-block;
  padding: 8px 10px;
  border-radius: 12px;
  margin: 6px 0;
  max-width: 85%;
  line-height: 1.25;
}

#modalLicitacion.th-modal .th-msg-user {
  align-self: flex-end;
  background: linear-gradient(90deg, #ff8a00, #ff5e00);
  color: #111;
  font-weight: 600;
}

#modalLicitacion.th-modal .th-msg-ai {
  align-self: flex-start;
  background: #15223b;
  border: 1px solid #24314d;
  color: #e6edf7;
}

/* Botones del modal */
#modalLicitacion.th-modal .btn {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--th-border);
  background: #11203d;
  color: var(--th-text);
  cursor: pointer;
}

#modalLicitacion.th-modal .btn.primary {
  background: linear-gradient(90deg, #ff8a00, #ff5e00);
  border: 0;
  color: #111;
  font-weight: 700;
}

/* Cerrar (X) – si usas .btn-close o similar */
#modalLicitacion.th-modal .btn-close,
#modalLicitacion.th-modal .modal-close,
#modalLicitacion.th-modal .close {
  filter: none;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #ff7a18;
  /* naranja fuerte para buen contraste */
  opacity: 1;
}

#modalLicitacion.th-modal .btn-close:hover,
#modalLicitacion.th-modal .modal-close:hover,
#modalLicitacion.th-modal .close:hover {
  background: #ff5e00;
}

/* ====== Thor • Modal light (blanco + naranjas) ====== */
#modalLicitacion.th-modal.th-light {
  --thl-bg: #ffffff;
  --thl-surface: #ffffff;
  --thl-muted: #f6f8fb;
  --thl-card: #ffffff;
  --thl-border: #e6ebf2;
  --thl-text: #20324b;
  --thl-subtext: #6b778c;
  --thl-primary: #ff7a18;
  --thl-primary-600: #f36a05;
  --thl-primary-700: #e25f00;
  --thl-link: #ff7a18;
  --thl-shadow: 0 18px 50px rgba(26, 33, 52, .12);
}

/* Ancho y contenedor */
#modalLicitacion.th-modal.th-light .th-modal-dialog {
  max-width: 1100px;
}

#modalLicitacion.th-modal.th-light .th-modal-content {
  background: var(--thl-card) !important;
  /* sobrescribe el gradiente oscuro */
  border: 1px solid var(--thl-border);
  border-radius: 18px;
  box-shadow: var(--thl-shadow);
  overflow: hidden;
}

/* Header: limpio, blanco, con división sutil */
#modalLicitacion.th-modal.th-light .th-modal-header {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: 18px 22px;
  background: var(--thl-bg) !important;
  border-bottom: 1px solid var(--thl-border);
  color: var(--thl-text);
}

#modalLicitacion.th-modal.th-light .th-modal-header h1,
#modalLicitacion.th-modal.th-light .th-modal-header h2,
#modalLicitacion.th-modal.th-light .th-modal-header .title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: .2px;
}

/* Badges dentro del header (Favorita, días restantes, etc.) */
#modalLicitacion.th-modal.th-light .badge,
#modalLicitacion.th-modal.th-light .chip-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: .8rem;
  background: #fff3e7;
  color: #9b3b00;
  border: 1px solid #ffd8b4;
}

#modalLicitacion.th-modal.th-light .badge--warning {
  background: #ffe9e9;
  color: #a42525;
  border-color: #ffcaca;
}

/* Body: blanco, tipografía sobria */
#modalLicitacion.th-modal.th-light .th-modal-body {
  padding: 16px 22px 10px;
  background: var(--thl-surface) !important;
  color: var(--thl-text);
}

/* Paneles secundarios dentro del body */
#modalLicitacion.th-modal.th-light .lic-panel {
  background: var(--thl-bg);
  border: 1px solid var(--thl-border);
  border-radius: 14px;
  padding: 14px;
}

#modalLicitacion.th-modal.th-light .lic-panel h3 {
  margin: 0 0 10px;
  font-size: .95rem;
  font-weight: 800;
  color: var(--thl-text);
}

/* Etiquetas de campos */
#modalLicitacion.th-modal.th-light label {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--thl-subtext);
  font-weight: 700;
  margin-bottom: 6px;
}

/* Inputs y selects: blancos, borde sutil y foco naranja */
#modalLicitacion.th-modal.th-light input[type="text"],
#modalLicitacion.th-modal.th-light input[type="url"],
#modalLicitacion.th-modal.th-light input[type="date"],
#modalLicitacion.th-modal.th-light input[type="number"],
#modalLicitacion.th-modal.th-light select,
#modalLicitacion.th-modal.th-light textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--thl-border);
  border-radius: 12px;
  background: #fff;
  color: var(--thl-text);
  outline: none;
  transition: border .15s ease, box-shadow .15s ease;
}

#modalLicitacion.th-modal.th-light textarea {
  min-height: 110px;
  resize: vertical;
}

#modalLicitacion.th-modal.th-light input::placeholder,
#modalLicitacion.th-modal.th-light textarea::placeholder {
  color: #9aa6bb;
}

#modalLicitacion.th-modal.th-light input:focus,
#modalLicitacion.th-modal.th-light select:focus,
#modalLicitacion.th-modal.th-light textarea:focus {
  border-color: var(--thl-primary);
  box-shadow: 0 0 0 3px rgba(255, 122, 24, .18);
}

/* Enlaces (p.ej. “Abrir”) */
#modalLicitacion.th-modal.th-light a {
  color: var(--thl-link);
  font-weight: 700;
  text-decoration: none;
}

#modalLicitacion.th-modal.th-light a:hover {
  text-decoration: underline;
}

/* Footer */
#modalLicitacion.th-modal.th-light .th-modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--thl-border);
  background: var(--thl-muted);
}

/* Botones (primary naranja + secundarios grises) */
#modalLicitacion.th-modal.th-light .btn {
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 800;
  border: 1px solid var(--thl-border);
  background: #fff;
  color: var(--thl-text);
  cursor: pointer;
  transition: transform .04s ease, box-shadow .15s ease;
}

#modalLicitacion.th-modal.th-light .btn:hover {
  box-shadow: 0 6px 18px rgba(26, 33, 52, .08);
}

#modalLicitacion.th-modal.th-light .btn:active {
  transform: translateY(1px);
}

#modalLicitacion.th-modal.th-light .btn.primary {
  border: 0;
  color: #fff;
  background: linear-gradient(180deg, var(--thl-primary) 0%, var(--thl-primary-600) 100%);
}

#modalLicitacion.th-modal.th-light .btn.primary:hover {
  background: linear-gradient(180deg, var(--thl-primary-600) 0%, var(--thl-primary-700) 100%);
}

/* Variante “ghost” (contorno) si la usas */
#modalLicitacion.th-modal.th-light .btn.ghost {
  background: #fff;
  color: var(--thl-text);
  border: 1px solid var(--thl-border);
}

/* Botón peligro (eliminar) */
#modalLicitacion.th-modal.th-light .btn.danger {
  background: #ffeaea;
  color: #9f1f1f;
  border: 1px solid #ffcdcd;
}

#modalLicitacion.th-modal.th-light .btn.danger:hover {
  background: #ffdede;
}

/* Cerrar (X) pequeña y naranja fuerte */
#modalLicitacion.th-modal.th-light .btn-close,
#modalLicitacion.th-modal.th-light .modal-close,
#modalLicitacion.th-modal.th-light .close {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--thl-primary);
  color: #fff;
  opacity: 1;
  border: 0;
  display: inline-grid;
  place-items: center;
}

#modalLicitacion.th-modal.th-light .btn-close:hover,
#modalLicitacion.th-modal.th-light .modal-close:hover,
#modalLicitacion.th-modal.th-light .close:hover {
  background: var(--thl-primary-700);
}

/* Chat dentro del modal (blanco) */
#modalLicitacion.th-modal.th-light .th-chat-log {
  height: 320px;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--thl-border);
  border-radius: 12px;
  background: var(--thl-muted);
}

#modalLicitacion.th-modal.th-light .th-chat-bar {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

#modalLicitacion.th-modal.th-light .th-msg-user,
#modalLicitacion.th-modal.th-light .th-msg-ai {
  display: inline-block;
  padding: 10px 12px;
  border-radius: 12px;
  margin: 6px 0;
  max-width: 85%;
  line-height: 1.28;
  font-size: .95rem;
  border: 1px solid transparent;
}

#modalLicitacion.th-modal.th-light .th-msg-user {
  background: #fff5ea;
  border-color: #ffd9b5;
  color: #7a2b00;
  font-weight: 700;
}

#modalLicitacion.th-modal.th-light .th-msg-ai {
  background: #f2f5fa;
  border-color: #e4e9f2;
  color: #20324b;
}

/* Pequeñas ayudas visuales */
#modalLicitacion.th-modal.th-light hr {
  border: 0;
  border-top: 1px solid var(--thl-border);
  margin: 16px 0;
}

#modalLicitacion.th-modal.th-light .help,
#modalLicitacion.th-modal.th-light .hint {
  color: var(--thl-subtext);
  font-size: .85rem;
}

/* === SOLO TARJETA DE EDICIÓN DE LICITACIÓN (MODAL) — OVERRIDES SUAVES === */
/* Pega este bloque al FINAL del archivo para que tenga prioridad */

.modal-content-licitacion {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-color) !important;
  box-shadow: var(--shadow-lg) !important;
}

.modal-modern-content {
  color: var(--text-primary) !important;
}

/* Título en azul (quitamos el efecto de texto degradado anterior) */
.modal-title-modern {
  background: none !important;
  -webkit-background-clip: initial !important;
  -webkit-text-fill-color: initial !important;
  color: var(--primary-blue) !important;
  text-shadow: none !important;
}

/* Badges/estado con texto legible en tema claro del modal */
.modal-status-modern,
.modal-urgency {
  color: var(--text-primary) !important;
  background: rgba(0, 0, 0, 0.04) !important;
  border: 1px solid var(--border-color) !important;
  box-shadow: none !important;
}

/* Filas y campos */
.modal-field-label {
  color: var(--text-secondary) !important;
}

.modal-field-content {
  background: var(--bg-secondary) !important;
  border: 1px solid var(--border-color) !important;
  box-shadow: none !important;
}

.modal-field-value {
  color: var(--text-primary) !important;
}

/* Inputs de edición */
.modal-field-input-edit {
  background: #fff !important;
  color: var(--text-primary) !important;
  border-color: var(--primary-blue-light) !important;
}

.modal-field-input-edit:focus {
  border-color: var(--primary-blue) !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .12) !important;
  transform: none !important;
}

/* Botón de editar (iconito del lápiz) en azul */
.modal-edit-btn {
  background: linear-gradient(135deg, var(--primary-blue), var(--primary-blue-dark)) !important;
  box-shadow: var(--shadow-sm) !important;
  opacity: 1 !important;
}

.modal-edit-btn:hover {
  background: linear-gradient(135deg, var(--primary-blue-dark), var(--primary-blue-darker)) !important;
}

/* Cabecera del modal fija arriba al hacer scroll dentro */
.modal-header-modern {
  position: sticky !important;
  top: 0 !important;
  background: var(--bg-card) !important;
  z-index: 3 !important;
}

/* Acciones principales con fondo suave, sin efecto “vidrio” */
.modal-actions-modern {
  background: var(--very-light-blue) !important;
  border-color: var(--border-color) !important;
  box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.03) !important;
}

/* Comentarios sin capa oscura extra */
.modal-comments-section {
  background: transparent !important;
}

/* ❌ Botón cerrar más pequeño y naranja intenso */
.close-modal {
  width: 2rem !important;
  height: 2rem !important;
  font-size: 1rem !important;
  color: #fff !important;
  background: linear-gradient(135deg, #ff6600, #ff851b) !important;
  border: 1px solid #ff6600 !important;
  box-shadow: var(--shadow-sm) !important;
  transform: none !important;
}

.close-modal:hover {
  background: linear-gradient(135deg, #e55a00, #cc4d00) !important;
  transform: scale(1.05) !important;
}

/* ========= Chat dentro del modal de licitación (resaltado visual) ========= */
:root {
  --th-naranja: #ff7a18;
  --th-naranja-oscuro: #d9620f;
  --th-azul: #0f3d5e;
  --th-borde: #e6e8ee;
  --th-texto: #1b2430;
  --th-dim: #6c7280;
  --th-gris: #f6f8fc;
}

/* Cabecera */
#chatComentarios .modal-comments-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding-bottom: .5rem;
  margin-bottom: .5rem;
  border-bottom: 1px solid var(--th-borde);
}

#chatComentarios .modal-comments-title {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: 0;
  color: var(--th-azul);
  font-weight: 700;
}

#chatComentarios .modal-comments-title svg {
  width: 18px;
  height: 18px;
}

/* Contador */
#chatComentarios .badge-soft {
  background: linear-gradient(180deg, #ffe7d4, #ffd7b7);
  color: #8a4b09;
  font-weight: 700;
  padding: .2rem .5rem;
  border-radius: 999px;
  border: 1px solid #ffc694;
}

/* Lista y scroll */
#chatComentarios .modal-comments-list {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  max-height: 40vh;
  overflow: auto;
  padding-right: .25rem;
  background: var(--th-gris);
  border: 1px solid var(--th-borde);
  border-radius: 12px;
  padding: .6rem;
}

#chatComentarios .modal-comments-list::-webkit-scrollbar {
  width: 10px;
}

#chatComentarios .modal-comments-list::-webkit-scrollbar-thumb {
  background: #d7dbe6;
  border-radius: 8px;
}

/* Tarjeta de comentario */
#chatComentarios .modal-comment {
  position: relative;
  background: #fff;
  border: 1px solid var(--th-borde);
  border-radius: 12px;
  padding: .6rem .75rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .04);
}

#chatComentarios .modal-comment--unread {
  border-color: #ffb25d;
  box-shadow: 0 0 0 3px rgba(255, 122, 24, .16) inset;
}

/* Header del comentario */
#chatComentarios .modal-comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  margin-bottom: .25rem;
  font-size: .92rem;
}

#chatComentarios .modal-comment-author {
  font-weight: 700;
  color: var(--th-azul);
}

#chatComentarios .modal-comment-date {
  color: var(--th-dim);
  font-size: .85rem;
  white-space: nowrap;
}

/* Contenido y adjuntos */
#chatComentarios .modal-comment-content {
  color: var(--th-texto);
  line-height: 1.38;
  white-space: pre-wrap;
  word-break: break-word;
}

#chatComentarios .modal-comment-images {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: .5rem;
}

#chatComentarios .modal-comment-images img {
  max-height: 110px;
  border-radius: 8px;
  border: 1px solid var(--th-borde);
  background: #fff;
}

/* Estado vacío */
#chatComentarios .modal-no-comments {
  text-align: center;
  color: var(--th-dim);
  background: #fff;
  border: 1px dashed var(--th-borde);
  border-radius: 10px;
  padding: .75rem;
}

/* Formulario de envío */
#chatComentarios .modal-comment-form {
  margin-top: .75rem;
  padding-top: .5rem;
  border-top: 1px dashed var(--th-borde);
  position: sticky;
  bottom: 0;
  background: #fff;
}

#chatComentarios .modal-comment-input {
  width: 100%;
  padding: .65rem .75rem;
  min-height: 44px;
  border: 1px solid var(--th-borde);
  border-radius: 10px;
  font: inherit;
  color: var(--th-texto);
  background: #fff;
  outline: none;
  resize: vertical;
  max-height: 140px;
}

#chatComentarios .modal-comment-input:focus {
  border-color: var(--th-naranja);
  box-shadow: 0 0 0 3px rgba(255, 122, 24, .18);
}

#chatComentarios .modal-comment-actions {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-top: .5rem;
}

#chatComentarios .modal-comment-submit.btn-soft {
  border: none;
  border-radius: 10px;
  padding: .55rem .9rem;
  cursor: pointer;
  background: linear-gradient(180deg, var(--th-naranja), var(--th-naranja-oscuro));
  color: #fff;
  font-weight: 700;
}

#chatComentarios .modal-comment-submit.btn-soft:disabled {
  opacity: .7;
  cursor: default;
}

/* Si el modal recorta contenido, forzamos a mostrarlo */
.modal .modal-body {
  overflow: visible;
}

/* === Overlay global de carga (estilo Thor naranja/blanco) === */
#globalLoader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  /* .show => flex */
  align-items: center;
  justify-content: center;
  background: radial-gradient(1200px 600px at 50% 0%, rgba(255, 149, 74, .12), rgba(255, 149, 74, .06), transparent),
    linear-gradient(180deg, rgba(255, 255, 255, .85), rgba(255, 247, 238, .92));
  backdrop-filter: blur(3px);
}

#globalLoader.show {
  display: flex;
  animation: gl-fade .25s ease-out;
}

#globalLoader .gl-card {
  width: min(520px, 92vw);
  background: linear-gradient(180deg, #fff7ef, #ffe6cf);
  border: 1px solid #ffd4ae;
  border-radius: 18px;
  padding: 28px 30px;
  box-shadow: 0 12px 40px rgba(255, 120, 40, .25), 0 6px 16px rgba(0, 0, 0, .08);
  text-align: center;
}

#globalLoader .gl-title {
  font-weight: 800;
  font-size: 20px;
  color: #ea580c;
  letter-spacing: .2px;
  margin-bottom: 10px;
}

#globalLoader .gl-sub {
  color: #a84e1f;
  font-size: 14px;
  opacity: .85;
  margin-bottom: 18px;
}

#globalLoader .gl-spinner {
  width: 44px;
  height: 44px;
  margin: 0 auto 14px;
  border: 4px solid #ffe8d6;
  border-top-color: #f97316;
  border-radius: 50%;
  animation: gl-spin 1s linear infinite;
}

#globalLoader .gl-progress {
  height: 8px;
  background: #ffe1c7;
  border-radius: 9999px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .06);
}

#globalLoader .gl-bar {
  width: 35%;
  height: 100%;
  background: linear-gradient(90deg, #f97316, #fb923c);
  border-radius: inherit;
  animation: gl-bar 1.4s ease-in-out infinite;
}

@keyframes gl-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes gl-bar {
  0% {
    transform: translateX(-40%);
  }

  50% {
    transform: translateX(80%);
  }

  100% {
    transform: translateX(120%);
  }
}

@keyframes gl-fade {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* ========== Modal "Preguntar en el portal" ENCIMA del modal de licitación ========== */

.modal-pregunta-estado-overlay {
  position: fixed;
  /* Flotando sobre toda la pantalla */
  inset: 0;
  /* top:0; right:0; bottom:0; left:0 */
  z-index: 10000;
  /* Por encima del contenido del modal moderno */
  background: rgba(15, 23, 42, 0.65);
  /* Fondo oscurecido */
  display: none;
  /* Se muestra por JS */
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  box-sizing: border-box;
}

/* El contenido interno del modal de preguntas */
.modal-pregunta-estado {
  background: #ffffff;
  border-radius: 1rem;
  max-width: 780px;
  width: 100%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow:
    0 18px 45px rgba(15, 23, 42, 0.55),
    0 0 0 1px rgba(148, 163, 184, 0.3);
}

/* Cabecera del modal de preguntas */
.modal-pregunta-header {
  padding: 1.25rem 1.5rem 0.75rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
}

.modal-pregunta-header .modal-subtitle {
  font-size: 1rem;
  font-weight: 600;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.modal-pregunta-header .modal-help-text {
  margin-top: 0.4rem;
  font-size: 0.85rem;
  color: #6b7280;
}

/* Cuerpo scrollable */
.modal-pregunta-body {
  padding: 1rem 1.5rem;
  overflow-y: auto;
  scrollbar-width: thin;
}

.modal-pregunta-body::-webkit-scrollbar {
  width: 6px;
}

.modal-pregunta-body::-webkit-scrollbar-thumb {
  border-radius: 999px;
}

/* Secciones internas */
.modal-pregunta-section {
  padding: 0.75rem 0 1rem;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.5);
}

.modal-pregunta-section:last-of-type {
  border-bottom: none;
}

.modal-section-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #111827;
}

/* Textos de ayuda */
.modal-pregunta-list .modal-help-text {
  font-size: 0.85rem;
  color: #6b7280;
}

/* Textarea */
.modal-textarea {
  width: 100%;
  resize: vertical;
  min-height: 100px;
  max-height: 260px;
  margin-top: 0.5rem;
  padding: 0.75rem 0.9rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.7);
  font-size: 0.9rem;
  outline: none;
  box-sizing: border-box;
}

.modal-textarea:focus {
  border-color: #fb923c;
  box-shadow: 0 0 0 1px rgba(251, 146, 60, 0.35);
}

/* Footer */
.modal-pregunta-footer {
  padding: 0.75rem 1.5rem 1rem;
  border-top: 1px solid rgba(148, 163, 184, 0.35);
  display: flex;
  justify-content: flex-end;
}

/* Botones reutilizando tu estilo base */
.modal-pregunta-actions {
  margin-top: 0.6rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* Por si quieres remarcar un poco los botones de este modal
   (asumiendo que ya tienes .modal-btn-primary y .modal-btn-secondary) */
.modal-pregunta-estado .modal-btn-primary {
  font-size: 0.9rem;
  padding-inline: 0.9rem;
}

.modal-pregunta-estado .modal-btn-secondary {
  font-size: 0.85rem;
  padding-inline: 0.8rem;
}

/* ===== Cierre del modal de licitación moderno ===== */

/* Aseguramos referencia para posicionar el botón de cierre */
#modalLicitacion .modal-dialog,
#modalLicitacion .th-modal-dialog {
  position: relative;
}

/* Botón "X" de cerrar modal */
#cerrarModalLicitacion {
  position: absolute;
  top: 0.9rem;
  right: 1rem;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1;
  color: #ffffff;

  /* Naranja + azul, estilo Thor */
  background: linear-gradient(135deg, #fb923c, #2563eb);
  box-shadow:
    0 10px 20px rgba(15, 23, 42, 0.35),
    0 0 0 1px rgba(148, 163, 184, 0.4);

  z-index: 100;
  /* por encima del contenido del modal */
}

/* Efecto hover */
#cerrarModalLicitacion:hover {
  transform: translateY(-1px) scale(1.05);
  box-shadow:
    0 14px 30px rgba(15, 23, 42, 0.45),
    0 0 0 1px rgba(251, 146, 60, 0.6);
}

/* Efecto al pulsar */
#cerrarModalLicitacion:active {
  transform: translateY(0) scale(0.97);
  box-shadow:
    0 6px 16px rgba(15, 23, 42, 0.35),
    0 0 0 1px rgba(30, 64, 175, 0.7);
}

/* Accesibilidad: foco visible */
#cerrarModalLicitacion:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* ===== Botones "editar campo" en línea con el botón de cerrar ===== */

/* Contenedor para alinear bien texto + botón */
.modal-fields-modern .modal-field-content {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Botón base */
.modal-fields-modern .modal-edit-btn {
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 999px;
  border: none;
  padding: 0;
  cursor: pointer;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  background: linear-gradient(135deg, #fb923c, #2563eb);
  /* naranja → azul, igual que la X */
  box-shadow:
    0 6px 14px rgba(15, 23, 42, 0.35),
    0 0 0 1px rgba(148, 163, 184, 0.4);

  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}

/* Icono dentro del botón */
.modal-fields-modern .modal-edit-btn svg {
  width: 0.9rem;
  height: 0.9rem;
  color: #ffffff;
}

/* Hover */
.modal-fields-modern .modal-edit-btn:hover {
  transform: translateY(-1px) scale(1.04);
  box-shadow:
    0 9px 20px rgba(15, 23, 42, 0.45),
    0 0 0 1px rgba(251, 146, 60, 0.65);
}

/* Active (clic) */
.modal-fields-modern .modal-edit-btn:active {
  transform: translateY(0) scale(0.96);
  box-shadow:
    0 4px 10px rgba(15, 23, 42, 0.35),
    0 0 0 1px rgba(30, 64, 175, 0.65);
}

/* Foco accesible con teclado */
.modal-fields-modern .modal-edit-btn:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* ===== Botones de cambio de fase (mismo estilo que la X / editar) ===== */

.modal-actions-modern .btn-cambio-fase,
.modal-actions-modern .btnCambioFase,
.modal-actions-modern .btn-fase,
.modal-actions-modern .modal-btn-fase {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;

  padding: 0.45rem 1.1rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;

  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;

  color: #ffffff;
  background: linear-gradient(135deg, #fb923c, #2563eb);
  /* naranja → azul */
  box-shadow:
    0 8px 18px rgba(15, 23, 42, 0.45),
    0 0 0 1px rgba(148, 163, 184, 0.4);

  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}

/* Iconos dentro del botón (si los hay) */
.modal-actions-modern .btn-cambio-fase svg,
.modal-actions-modern .btnCambioFase svg,
.modal-actions-modern .btn-fase svg,
.modal-actions-modern .modal-btn-fase svg {
  width: 1rem;
  height: 1rem;
  color: #ffffff;
}

/* Hover */
.modal-actions-modern .btn-cambio-fase:hover,
.modal-actions-modern .btnCambioFase:hover,
.modal-actions-modern .btn-fase:hover,
.modal-actions-modern .modal-btn-fase:hover {
  transform: translateY(-1px) scale(1.03);
  box-shadow:
    0 12px 24px rgba(15, 23, 42, 0.55),
    0 0 0 1px rgba(251, 146, 60, 0.7);
}

/* Active (clic) */
.modal-actions-modern .btn-cambio-fase:active,
.modal-actions-modern .btnCambioFase:active,
.modal-actions-modern .btn-fase:active,
.modal-actions-modern .modal-btn-fase:active {
  transform: translateY(0) scale(0.97);
  box-shadow:
    0 5px 14px rgba(15, 23, 42, 0.4),
    0 0 0 1px rgba(30, 64, 175, 0.7);
}

/* Foco accesible */
.modal-actions-modern .btn-cambio-fase:focus-visible,
.modal-actions-modern .btnCambioFase:focus-visible,
.modal-actions-modern .btn-fase:focus-visible,
.modal-actions-modern .modal-btn-fase:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* ============ Caja de cambio de fase ============ */

.workflow-phase-box {
  background: linear-gradient(135deg,
      rgba(59, 130, 246, 0.10) 0%,
      rgba(29, 78, 216, 0.05) 100%);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(59, 130, 246, 0.2);
  border-radius: 1rem;
  padding: 2rem;
  margin: 2rem 0;
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.18);
}

.workflow-phase-title {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: #2563eb;
  margin-bottom: 1.4rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Grid de fase actual + botones */
.workflow-phase-grid {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 1.75rem;
  flex-wrap: wrap;
}

/* Fase actual */
.workflow-phase-current {
  text-align: center;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 0.85rem;
  border: 2px solid #e5e7eb;
  min-width: 140px;
}

.workflow-phase-current-label {
  font-size: 0.8rem;
  color: #6b7280;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.workflow-phase-current-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: #111827;
  margin-top: 0.45rem;
}

/* Placeholders (cuando no hay fase anterior/siguiente) */

.workflow-phase-placeholder {
  padding: 1.4rem 1.8rem;
  border-radius: 1rem;
  background: #f3f4f6;
  color: #6b7280;
  font-weight: 600;
  text-align: center;
  min-width: 140px;
  border: 2px dashed #d1d5db;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.workflow-phase-placeholder-icon {
  font-size: 1.4rem;
  opacity: 0.5;
}

.workflow-phase-placeholder-main {
  font-size: 0.9rem;
}

.workflow-phase-placeholder-sub {
  font-size: 0.8rem;
  margin-top: 0.2rem;
}

/* ============ Botones de cambio de fase ============ */

.modal-phase-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;

  padding: 1.4rem 2rem;
  border-radius: 1rem;
  border: none;
  cursor: pointer;

  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
  min-width: 160px;
  color: #ffffff;

  box-shadow:
    0 10px 24px rgba(15, 23, 42, 0.35),
    0 0 0 1px rgba(148, 163, 184, 0.45);

  transition:
    transform 0.14s ease,
    box-shadow 0.14s ease,
    opacity 0.14s ease,
    filter 0.14s ease;
}

/* Icono + textos dentro del botón */

.modal-phase-btn-icon {
  font-size: 1.5rem;
}

.modal-phase-btn-main {
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}

.modal-phase-btn-sub {
  font-size: 0.83rem;
  opacity: 0.95;
  font-weight: 500;
  line-height: 1.25;
}

.modal-phase-btn-extra {
  font-size: 0.75rem;
  margin-top: 0.2rem;
  opacity: 0.9;
}

/* Hover / active genéricos */

.modal-phase-btn:hover:not(:disabled) {
  transform: translateY(-1px) scale(1.03);
  box-shadow:
    0 14px 30px rgba(15, 23, 42, 0.5),
    0 0 0 1px rgba(251, 146, 60, 0.7);
  filter: brightness(1.02);
}

.modal-phase-btn:active:not(:disabled) {
  transform: translateY(0) scale(0.97);
  box-shadow:
    0 7px 18px rgba(15, 23, 42, 0.4),
    0 0 0 1px rgba(37, 99, 235, 0.7);
}

/* Foco accesible */

.modal-phase-btn:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* Botón RETROCEDER: degradado más "warning" pero moderno */
.modal-phase-btn--back {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
}

/* Botón AVANZAR: misma línea naranja/azul que la X y editar */
.modal-phase-btn--forward {
  background: linear-gradient(135deg, #fb923c 0%, #2563eb 100%);
}

/* Estado bloqueado (GoNoGo sin Dynamics, Revision sin permisos, etc.) */

.modal-phase-btn--blocked {
  background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
  box-shadow:
    0 6px 16px rgba(156, 163, 175, 0.4),
    0 0 0 1px rgba(148, 163, 184, 0.7);
  cursor: not-allowed;
  opacity: 0.7;
}

.modal-phase-btn--blocked:hover {
  transform: none;
  box-shadow:
    0 6px 16px rgba(156, 163, 175, 0.4),
    0 0 0 1px rgba(148, 163, 184, 0.7);
  filter: none;
}

/************************************************************
 🟧 THOR — TEMA BLANCO + NARANJAS (override no destructivo)
 Pega este bloque al FINAL de style.css
*************************************************************/

/* 1) Paleta principal: reasignamos las variables existentes */
:root {
  /* Naranjas principales */
  --primary-blue: #f97316;
  /* naranja 500 */
  --primary-blue-dark: #ea580c;
  /* naranja 600 */
  --primary-blue-darker: #c2410c;
  /* naranja 700 */
  --primary-blue-light: #fdba74;
  /* naranja 300 */
  --primary-blue-lighter: #ffedd5;
  /* naranja 100 */

  /* “Secundario” antes azul → ahora naranja profundo */
  --secondary-blue: #9a3412;

  /* Acento suave (antes cian): tono ámbar/melocotón */
  --accent-blue: #fbbf24;
  /* amber 400 */

  /* Fondos “azules claros” → cremas/blancos cálidos */
  --light-blue: #fff7ed;
  /* crema */
  --very-light-blue: #fffaf5;
  /* crema muy suave */

  /* Grises y neutros: mantenemos, pero aclaramos el fondo global */
  --bg-primary: #ffffff;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-hover: #fff3e6;

  /* Texto y bordes: igual, con sutiles ajustes */
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;

  --border-color: #f1f5f9;
  /* borde suave */
  --border-hover: #e5e7eb;

  /* Sombras suaves y cálidas */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .05);
  --shadow-md: 0 8px 16px -8px rgba(0, 0, 0, .12);
  --shadow-lg: 0 18px 35px -10px rgba(0, 0, 0, .18);

  /* Transiciones (igual) */
  --transition-fast: 0.15s ease-in-out;
  --transition-normal: 0.30s ease-in-out;
  --transition-slow: 0.50s ease-in-out;
}

/* 2) Fondo general más “Apple-like” (blanco con leve degradado cálido) */
body {
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(249, 115, 22, 0.06), transparent),
    radial-gradient(900px 500px at -10% 20%, rgba(253, 186, 116, 0.10), transparent),
    #ffffff;
  color: var(--text-primary);
}

/* 3) Header: degradado naranja elegante */
header {
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%) !important;
  border-bottom: 3px solid var(--primary-blue-darker) !important;
}

/* Trama sutil del header más discreta */
header::before {
  background: linear-gradient(45deg,
      rgba(255, 255, 255, .12) 25%, transparent 25%,
      transparent 50%, rgba(255, 255, 255, .10) 50%,
      rgba(255, 255, 255, .08) 75%, transparent 75%) !important;
  background-size: 20px 20px !important;
}

/* 4) Botones base que usan las variables “blue” → ahora naranjas */
.section button:not(.action-btn):not(.modern-btn):not(.thoria-float-btn),
.search-group button:not(.action-btn):not(.modern-btn):not(.thoria-float-btn),
#loginForm button,
.btn-primary.full-width {
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%) !important;
}

.section button:hover:not(.action-btn):not(.modern-btn):not(.thoria-float-btn),
.search-group button:hover:not(.action-btn):not(.modern-btn):not(.thoria-float-btn),
#loginForm button:hover,
.btn-primary.full-width:hover {
  background: linear-gradient(135deg, var(--primary-blue-dark) 0%, var(--primary-blue-darker) 100%) !important;
}

/* 5) Tablas y listas: cabecera con naranja, filas hover crema */
.results th,
#tablaUsuarios th,
#contenidoResumenPliego th,
#tablaResumenesBody th,
.estado-table thead {
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%) !important;
}

.results tr:hover,
#tablaUsuarios tr:hover,
#contenidoResumenPliego tr:hover,
#tablaResumenesBody tr:hover,
.estado-table tbody tr:hover {
  background: var(--light-blue) !important;
}

/* 6) Tarjetas de resultados: banda izquierda con gradiente naranja */
.result-card::before {
  background: linear-gradient(to bottom, var(--primary-blue), var(--secondary-blue)) !important;
}

.result-card:hover {
  border-color: var(--primary-blue-light) !important;
}

/* 7) Inputs/Focus: brillo naranja suave */
input,
select,
textarea,
.form-control {
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
}

input:focus,
select:focus,
textarea:focus,
.form-control:focus {
  border-color: var(--primary-blue) !important;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15) !important;
  /* naranja 500 */
  background: #fff7ed !important;
}

/* 8) Badges de estado más acordes con el tema */
.estado-adjudicado {
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%) !important;
  color: var(--primary-blue) !important;
  border-color: #fdba74 !important;
}

/* 9) Scrollbar y selección en naranja */
::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%) !important;
}

::selection,
::-moz-selection {
  background: var(--primary-blue-light) !important;
  color: #1f2937 !important;
}

/* 10) Gradiente de texto utilitario (antes azul) ahora naranja */
.text-gradient {
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%) !important;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* 11) Toasts/info con crema instead of azul claro */
.toast-info {
  background: linear-gradient(135deg, var(--very-light-blue) 0%, var(--light-blue) 100%) !important;
  border-left-color: var(--accent-blue) !important;
  /* ámbar */
}

/* 12) Cards y grupos: borde más claro y hover cálido */
.card,
.search-group:not(.resumenes-preserve),
.form-section,
.chart-container {
  border-color: var(--border-color) !important;
}

.search-group:not(.resumenes-preserve):hover,
.card:hover {
  border-color: var(--primary-blue-light) !important;
  box-shadow: var(--shadow-lg) !important;
}

/* 13) Modal headings en naranja */
.modal-content h3 {
  color: var(--primary-blue) !important;
}

/* 14) Enlaces de tarjetas a naranja */
.result-card a {
  color: var(--primary-blue) !important;
}

.result-card a:hover {
  color: var(--primary-blue-dark) !important;
}

/* 15) Botones “pill” de días (si los usas) con naranja */
.btn-pill {
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%) !important;
}

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

/* 16) Menús desplegables: fondo blanco y halo crema */
.dropdown-menu {
  background: #ffffff !important;
  border-color: var(--border-color) !important;
  box-shadow: var(--shadow-lg) !important;
}

/* 17) Kanban — si usas el nuevo tablero, suaviza el fondo a claro */
.kanban-board-stacked {
  background: linear-gradient(135deg, #ffffff 0%, #fff7ed 50%, #ffedd5 100%) !important;
}

.kanban-column-stacked {
  background: rgba(255, 255, 255, 0.85) !important;
  border: 1px solid rgba(0, 0, 0, 0.06) !important;
  backdrop-filter: blur(14px) !important;
}

.card-preview-expediente {
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%) !important;
}

/* 18) Utilidades de color (opcional) */
.text-brand {
  color: var(--primary-blue) !important;
}

.bg-brand {
  background: var(--primary-blue) !important;
  color: #fff !important;
}

.bg-brand-soft {
  background: #fff7ed !important;
}

.border-brand {
  border-color: var(--primary-blue) !important;
}

.shadow-soft {
  box-shadow: var(--shadow-md) !important;
}

/* ===== Legibilidad y contrastes Thor (blanco+naranja) ===== */

/* Fallback seguro para textos con degradado (evita letras “transparentes”) */
.text-gradient-orange {
  color: #c2410c;
  /* fallback visible */
  background-image: linear-gradient(90deg, #c2410c 0%, #f97316 45%, #fb923c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  /* En Safari/Chromium aplicamos relleno transparente; si no, queda el fallback */
  -webkit-text-fill-color: transparent;
}

/* Parrafos y links del hero con más contraste */
.hero-copy {
  color: #334155;
}

/* ink-700 aprox */
.hero-meta {
  color: #475569;
}

/* ink-600 aprox */
.nav-link {
  color: #334155;
}

/* forzamos legibilidad en topbar */
.nav-link:hover {
  color: #c2410c;
}

/* Botón secundario del hero (borde + texto) con mayor contraste */
.btn-outline-contrast {
  border: 1.5px solid #fdba74;
  /* naranja 300 */
  color: #9a3412;
  /* naranja 800 */
  background: #fff;
}

.btn-outline-contrast:hover {
  border-color: #f59e0b;
  /* amber 500 */
  background: #fff7ed;
  /* crema suave */
}

/* Tarjeta "Vista previa" — fondo blanco real, borde visible y sombra */
.mock-wrap {
  background: #fff;
  border: 1px solid #ffe0bf;
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, .18);
}

.mock-slot {
  background: #fff;
  border: 1.5px solid #fed7aa;
  box-shadow: 0 4px 14px -8px rgba(0, 0, 0, .12);
}

.mock-slot-soft {
  background: #fffdf9;
  border: 1.5px solid #fed7aa;
  box-shadow: 0 4px 14px -8px rgba(0, 0, 0, .12);
}

/* Badge “IA activa” con mejor lectura */
.badge-ia {
  background: rgba(255, 255, 255, .95);
  border: 1px solid #fed7aa;
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, .18);
  color: #0f172a;
}

/* Secciones crema: subimos contraste del texto dentro */
.section-cream {
  background: #fff3e6;
}

.section-cream h2,
.section-cream h3 {
  color: #0f172a;
}

.section-cream p {
  color: #334155;
}

/* Contenedor de imágenes de comentarios y previews */
.modal-comment-images {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

/* Miniaturas */
.modal-comment-images img {
  max-width: 96px;
  max-height: 96px;
  border-radius: 6px;
  object-fit: cover;
  cursor: zoom-in;
}

/* Botones de pliegos en el modal (PPT / PCAP) */
.modal-actions-modern__group--pliegos {
  display: inline-flex;
  gap: 0.5rem;
  margin-left: 0.5rem;
}

.modal-pdf-btn {
  border-radius: 9999px;
  /* redondos */
  padding: 0.35rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  background: #ff7a1a;
  color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.modal-pdf-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.22);
}

.modal-pdf-btn:disabled {
  opacity: 0.7;
  cursor: wait;
}

.modal-action-btn--quote {
  background: linear-gradient(90deg, #f97316, #ea580c);
  color: #fff;
  border: none;
}

.modal-action-btn--quote:hover {
  filter: brightness(1.05);
}

/* Modo edición en resúmenes */
.resumen-editable {
  outline: 1px dashed rgba(255, 140, 0, 0.8);
  background: rgba(255, 248, 236, 0.9);
}

.resumen-edit-textarea {
  width: 100%;
  min-height: 180px;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid #ffd9a3;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.4;
  resize: vertical;
  background: #fffdf8;
  box-shadow: 0 0 0 1px rgba(255, 165, 0, 0.15);
}

.resumen-edit-textarea:focus {
  outline: none;
  border-color: #ff9b2b;
  box-shadow: 0 0 0 2px rgba(255, 155, 43, 0.35);
}

.comentario-burbuja--unread {
  border-left: 3px solid #3b82f6;
  background: #eff6ff;
}

.comentario-pill-nuevo {
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 10px;
  background: #3b82f6;
  color: #fff;
}

/* El contenido del modal: una sola tarjeta con scroll vertical plano */
.modal-modern-content {
  max-height: 80vh;
  /* para no ocupar toda la pantalla */
  overflow-y: auto;
  /* scroll único */
  display: flex;
  flex-direction: column;
}

/* Header (título + botones) fijo arriba dentro de la tarjeta */
.modal-header-modern--sticky {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--th-modal-bg, #0b1220);
  /* ajusta al color de tu tarjeta */
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
}

/* Fila de acciones: plana, sin pegajoso abajo */
.modal-actions-modern {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

/* Si tenías estilos que hacían "sticky" la barra de botones, los anulas */
.modal-actions-modern--sticky {
  position: static !important;
  bottom: auto !important;
  box-shadow: none !important;
}

/* ============================================
   BOTÓN HISTORIAL ELIMINACIONES
   ============================================ */
.btn-historial-eliminaciones {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
  color: white;
  border: none;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(107, 114, 128, 0.3);
}

.btn-historial-eliminaciones:hover {
  background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(107, 114, 128, 0.4);
}

.historial-count {
  background: #ef4444;
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
  min-width: 1.25rem;
  text-align: center;
}

/* ============================================
   PANEL LATERAL HISTORIAL
   ============================================ */
.historial-panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.historial-panel-overlay.active {
  opacity: 1;
  visibility: visible;
}

.historial-panel {
  position: fixed;
  top: 0;
  right: -420px;
  width: 420px;
  max-width: 100vw;
  height: 100vh;
  background: #ffffff;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  transition: right 0.3s ease;
}

.historial-panel.active {
  right: 0;
}

.historial-panel-header {
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.historial-panel-title {
  font-size: 1.125rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.historial-panel-close {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.historial-panel-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.historial-panel-stats {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.historial-stat {
  flex: 1;
  text-align: center;
  padding: 0.75rem;
  background: white;
  border-radius: 0.5rem;
  border: 1px solid #e5e7eb;
}

.historial-stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: #1f2937;
}

.historial-stat-label {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 0.25rem;
}

.historial-stat.no-go .historial-stat-value {
  color: #dc2626;
}

.historial-stat.manual .historial-stat-value {
  color: #6b7280;
}

.historial-panel-filters {
  padding: 1rem 1.5rem;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex-shrink: 0;
}

.historial-search {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.historial-search:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.historial-filter-row {
  display: flex;
  gap: 0.5rem;
}

.historial-filter-select {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 0.8rem;
  background: white;
  cursor: pointer;
}

.historial-panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.5rem;
}

.historial-item {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 1rem;
  margin-bottom: 0.75rem;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.historial-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-color: #d1d5db;
}

.historial-item.no-go {
  border-left: 4px solid #dc2626;
}

.historial-item.manual {
  border-left: 4px solid #6b7280;
}

.historial-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.historial-item-expediente {
  font-weight: 700;
  color: #1f2937;
  font-size: 0.9rem;
}

.historial-item-tipo {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  text-transform: uppercase;
}

.historial-item-tipo.no-go {
  background: #fef2f2;
  color: #dc2626;
}

.historial-item-tipo.manual {
  background: #f3f4f6;
  color: #6b7280;
}

.historial-item-titulo {
  font-size: 0.85rem;
  color: #374151;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.historial-item-organismo {
  font-size: 0.8rem;
  color: #6b7280;
  margin-bottom: 0.75rem;
}

.historial-item-motivo {
  background: #f9fafb;
  border-radius: 0.5rem;
  padding: 0.75rem;
  font-size: 0.8rem;
  color: #4b5563;
  line-height: 1.5;
  margin-bottom: 0.75rem;
  border-left: 3px solid #d1d5db;
}

.historial-item-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: #9ca3af;
}

.historial-item-usuario {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.historial-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: #9ca3af;
}

.historial-empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.historial-panel-footer {
  padding: 1rem 1.5rem;
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.historial-page-btn {
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  background: white;
  border-radius: 0.375rem;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.historial-page-btn:hover:not(:disabled) {
  background: #f3f4f6;
}

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

.historial-page-btn.active {
  background: #1f2937;
  color: white;
  border-color: #1f2937;
}

.historial-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 3rem;
}

.historial-loading-spinner {
  width: 2rem;
  height: 2rem;
  border: 3px solid #e5e7eb;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* === LOGIN CON MICROSOFT === */
.login-container {
  max-width: 400px;
  margin: 0 auto;
  padding: 2rem;
  text-align: center;
}

.login-header {
  margin-bottom: 1.5rem;
}

.login-subtitle {
  color: #6b7280;
  font-size: 0.95rem;
  margin-top: 0.5rem;
}

.btn-microsoft {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #2b2b2b 0%, #1a1a1a 100%);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-microsoft:hover {
  background: linear-gradient(135deg, #3b3b3b 0%, #2a2a2a 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.login-hint {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: #9ca3af;
}

.login-divider {
  display: flex;
  align-items: center;
  margin: 1.5rem 0;
  color: #9ca3af;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #e5e7eb;
}

.login-divider span {
  padding: 0 1rem;
  font-size: 0.85rem;
}

.login-tradicional {
  text-align: left;
  margin-top: 1rem;
}

.login-tradicional summary {
  cursor: pointer;
  color: #6b7280;
  font-size: 0.9rem;
  padding: 0.5rem 0;
}

.login-tradicional summary:hover {
  color: #374151;
}

.login-tradicional[open] summary {
  margin-bottom: 1rem;
}

/* ===== Botón adjuntar imágenes en comentarios ===== */
.btn-attach {
  background: #f3f4f6 !important;
  color: #4b5563 !important;
  border: 1px solid #d1d5db !important;
  padding: 6px 12px !important;
  font-size: 13px !important;
  border-radius: 6px !important;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-attach:hover {
  background: #e5e7eb !important;
  color: #1f2937 !important;
  border-color: #9ca3af !important;
}

.modal-comment-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Preview de imágenes mejorado */
#previewPegadas {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
  padding: 8px;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px dashed #d1d5db;
}

#previewPegadas img {
  max-width: 80px;
  max-height: 80px;
  border-radius: 6px;
  object-fit: cover;
  border: 2px solid #e5e7eb;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
}

#previewPegadas img:hover {
  transform: scale(1.05);
  border-color: #3b82f6;
}