.trip-in-progress {
  background-color: var(--warning-bg);
  color: var(--warning);
}

/* ====== Admin Tabs ====== */
.admin-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 0;
  background: #fff;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  overflow-x: auto;
  padding: 0 0.5rem;
}

.admin-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.85rem 1.3rem;
  font-size: var(--font-size-body);
  font-weight: 600;
  color: var(--gris-claro);
  text-decoration: none;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
}

.admin-tab:hover {
  color: var(--texto-primario);
  background: var(--blanco-ui);
}

.admin-tab--active {
  color: var(--azul-gazapo);
  border-bottom-color: var(--azul-gazapo);
  background: var(--blanco-ui);
}

.tab-badge {
  background: var(--azul-gazapo);
  color: #fff;
  font-size: 0.7rem;
  padding: 1px 7px;
  border-radius: var(--radius-md);
  font-weight: 700;
  line-height: 1.4;
}

.tab-badge--red {
  background: var(--error);
}

/* Document statuses */
.doc-status--pending { background: var(--warning-bg); color: var(--warning); padding: 2px 8px; border-radius: 4px; font-size: 0.78rem; font-weight: 600; }
.doc-status--aprobado { background: var(--success-bg); color: var(--success); padding: 2px 8px; border-radius: 4px; font-size: 0.78rem; font-weight: 600; }
.doc-status--rechazado { background: var(--error-bg); color: var(--error); padding: 2px 8px; border-radius: 4px; font-size: 0.78rem; font-weight: 600; }
.doc-status--pendiente_revision { background: var(--info-bg); color: var(--info); padding: 2px 8px; border-radius: 4px; font-size: 0.78rem; font-weight: 600; }

/* Empty state */
.empty-state {
  background: var(--blanco-ui);
  border: 2px dashed var(--bordes);
  border-radius: var(--radius-md);
}

/* Paleta y Base */
.admin-body {
  background-color: var(--blanco-ui);
  margin: 0;
  min-height: 100vh;
  padding-top: 69px; /* evita que el header fijo tape el contenido */
}

/* Navbar */
.admin-nav {
  background: white;
  padding: 1rem 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-card);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 15px;
  border-left: 1px solid var(--bordes);
  padding-left: 20px;
}

.btn-salir {
  background: var(--azul-oscuro);
  color: white;
  padding: 0.6rem 1.5rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 700;
  border: none;
}

/* Contenedor y Títulos */
.admin-container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 20px;
}

.panel-title {
  color: var(--coral);
  font-weight: 800;
  font-size: 2rem;
  margin: 0;
  margin-bottom: 2rem;
}

/* Contenedor Principal de la Sección */
.admin-section {
  background: white;
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-card);
}

/* Encabezado de la Sección */
.admin-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.admin-section h3 {
  color: var(--azul-gazapo);
  font-weight: 800;
  font-size: 1.25rem;
  margin: 0;
  margin-bottom: 1rem;
}

/* Badge de Sistema Automático */
.badge-ai-system {
  background: var(--info-bg);
  color: var(--info);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Grid de métricas */
.ia-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.2rem;
}

/* Estilo Base de las Tarjetas IA */
.ia-card {
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.ia-card strong {
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  display: block;
}

.ia-card .metric-value {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
}

/* Variantes de Color exactas según capturas */
.ia-blue {
  background-color: var(--info-bg);
  color: var(--info);
}

.ia-green {
  background-color: var(--success-bg);
  color: var(--success);
}

.ia-yellow {
  background-color: var(--warning-bg);
  color: var(--warning);
}

.ia-purple {
  background-color: #fcfaff;
  color: #8b5cf6;
}

/* Cards de Métricas Superiores */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 2rem;
}

.metric-card {
  background: white;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  gap: 15px;
  box-shadow: var(--shadow-card);
  border-left: 4px solid var(--coral);
}

.metric-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--blanco-ui);
  color: var(--coral);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.2rem;
}

/* Tablas y Secciones Blancas (dentro de tabs) */
.admin-tabs + .admin-section {
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  margin-top: 0;
}

.admin-section {
  background: white;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-card);
}

table {
  width: 100%;
  border-collapse: collapse;
}

/* Fondo para encabezados de tablas */
.admin-section table thead,
.trips-table thead {
  background-color: var(--blanco-ui);
}

/* Borde inferior para encabezados de tablas */
.admin-section table thead th,
.trips-table thead th {
  border-bottom: 1px solid var(--azul-gazapo);
}

th {
  text-align: left;
  font-size: var(--font-size-label);
  color: var(--gris-claro);
  text-transform: uppercase;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--bordes);
}

td {
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--bordes);
  font-size: var(--font-size-body);
  font-weight: 600;
  color: var(--texto-primario);
}

/* Badges y Etiquetas */
.badge-status {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
}

.status-pendiente {
  background-color: var(--warning-bg);
  color: var(--warning);
}

.status-aprobado {
  background-color: var(--success-bg);
  color: var(--success);
}

.status-rechazado, .status-error {
  background-color: var(--error-bg);
  color: var(--error);
}

/* Barras de confianza */
.confidence-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-bg {
  width: 80px;
  height: 8px;
  background-color: var(--bordes);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-md);
}

/* Colores dinámicos de la barra según confianza */
.bar-high { background-color: var(--success); }
.bar-medium { background-color: var(--warning); }
.bar-low { background-color: var(--error); }

.confidence-text {
  font-size: 0.85rem;
  color: var(--texto-secundario);
}

/* Contenedor de la Tabla */
.admin-section table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

/* Encabezados de Columna */
.admin-section th {
  text-align: left;
  font-size: var(--font-size-label);
  color: var(--texto-secundario);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.75rem 1.5rem;
  border-bottom: 2px solid var(--bordes);
  font-weight: 600;
}

/* Celdas de la Tabla */
.admin-section td {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--bordes);
  font-size: var(--font-size-body);
  color: var(--texto-primario);
  font-weight: 500;
  vertical-align: middle;
}

.admin-section td.name-cell {
  color: var(--azul-gazapo);
  font-weight: 800;
}

/* Enlaces de Acción */
.action-revisar {
  color: var(--coral);
  text-decoration: none;
  font-weight: 700;
  transition: opacity 0.2s;
}

.action-revisar:hover {
  text-decoration: underline;
  opacity: 0.8;
}

.action-detalles {
  color: var(--azul-gazapo);
  text-decoration: none;
  font-weight: 700;
}

.action-detalles:hover {
  text-decoration: underline;
  opacity: 0.8;
}

/* Sección de Gestión de Disputas */
.disputes-section {
  background: white;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-card);
  font-family: inherit;
}

.disputes-section h3 {
  color: var(--azul-gazapo);
  font-weight: 800;
  font-size: 1.25rem;
  margin: 0 0 1rem;
}

.dispute-card {
  border: 1px solid var(--bordes);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1rem;
  position: relative;
}

.dispute-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.badge-dispute {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: var(--font-size-label);
  font-weight: 800;
}

.badge-abierta {
  background-color: var(--error-bg);
  color: var(--error);
}

.badge-revision {
  background-color: var(--warning-bg);
  color: var(--warning);
}

.dispute-date {
  color: var(--gris-claro);
  font-size: var(--font-size-body);
  font-weight: 600;
}

.dispute-title {
  color: var(--azul-gazapo);
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.dispute-parties {
  font-size: var(--font-size-body);
  color: var(--texto-secundario);
  margin-bottom: 12px;
}

.dispute-parties strong {
  color: var(--texto-primario);
}

.dispute-description {
  font-size: 0.95rem;
  color: var(--texto-primario);
  line-height: 1.5;
  margin: 0;
}

.btn-resolver {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background-color: var(--coral);
  color: white;
  border: none;
  padding: 8px 24px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: var(--font-size-body);
  cursor: pointer;
  transition: background 0.2s;
}

.btn-resolver:hover {
  background-color: var(--azul-oscuro);
}

/* Sección de Supervisar Viajes */
.trips-section {
  background: white;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
}

.trips-section h3 {
  color: var(--azul-gazapo);
  font-weight: 800;
  font-size: 1.25rem;
  margin: 0;
  margin-bottom: 1rem;
}

.trips-table {
  width: 100%;
  border-collapse: collapse;
}

.trips-table th {
  text-align: left;
  font-size: var(--font-size-label);
  color: var(--texto-secundario);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.75rem 1.5rem;
  border-bottom: 2px solid var(--bordes);
}

.trips-table td {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--bordes);
  font-size: var(--font-size-body);
  color: var(--texto-primario);
  font-weight: 500;
}

.route-text {
  font-weight: 800 !important;
  color: var(--azul-gazapo) !important;
}

.badge-trip {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: var(--font-size-label);
  font-weight: 700;
  display: inline-block;
}

.trip-available {
  background-color: var(--success-bg);
  color: var(--success);
}

.trip-completed {
  background-color: var(--info-bg);
  color: var(--info);
}

.publisher-name {
  color: var(--texto-primario);
}

.applicants-count {
  text-align: center;
  color: var(--azul-gazapo);
}

/* --- Overlay (Fondo oscuro) --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.45);
  z-index: 999;
  transition: all 0.3s ease;
}

/* --- Contenedor Principal --- */
.modal-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-elevated);
  width: 580px;
  max-width: 95vw;
  z-index: 1000;
  font-family: var(--font-family);
  overflow: hidden;
}

/* --- Encabezado --- */
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
}

.modal-header h3 {
  margin: 0 !important;
  color: var(--azul-gazapo) !important;
  font-size: 1.5rem !important;
  font-weight: 800 !important;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  color: var(--gris-claro);
  line-height: 1;
}

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

/* --- Cuerpo del Modal --- */
.modal-body {
  padding: 0 1.5rem 1.5rem;
}

/* --- Secciones con Bordes --- */
.modal-bordered-section {
  border: 1px solid var(--bordes);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
}

.section-title {
  margin: 0 0 16px 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--azul-gazapo);
}

/* --- Grid de Información Personal --- */
.modal-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.info-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Estilo: Etiqueta arriba, Valor abajo */
.info-group label {
  font-size: var(--font-size-body);
  color: var(--texto-secundario);
}

.info-group span {
  font-size: 1rem;
  font-weight: 600;
  color: var(--azul-gazapo);
}

/* --- Sección de Créditos (Inline) --- */
.inline-group {
  display: flex;
  gap: 12px;
  align-items: center;
}

.input-simple {
  flex: 1;
  padding: 12px 14px;
  border: 1px solid var(--bordes);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.input-simple:focus {
  border-color: var(--azul-gazapo);
}

/* Placeholder con fuente */
.input-simple::placeholder {
  font-family: var(--font-family);
}
.input-simple::-webkit-input-placeholder {
  font-family: var(--font-family);
}
.input-simple::-moz-placeholder {
  font-family: var(--font-family);
}
.input-simple:-ms-input-placeholder {
  font-family: var(--font-family);
}
.input-simple::-ms-input-placeholder {
  font-family: var(--font-family);
}

/* --- Footer y Botones --- */
.modal-actions-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 10px;
}

/* Botón Cargar/Agregar */
.btn-primary {
  background: var(--azul-gazapo);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-weight: 700;
  cursor: pointer;
  font-size: 1rem;
  font-family: var(--font-family);
}

.btn-credits {
  background: var(--success);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-weight: 700;
  cursor: pointer;
  font-size: 1rem;
  font-family: var(--font-family);
}

/* Botón Suspender */
.btn-danger {
  background: var(--error);
  color: white;
  border: none;
  padding: 8px 24px;
  border-radius: var(--radius-md);
  font-weight: 700;
  cursor: pointer;
  font-size: 1rem;
  font-family: var(--font-family);
}

/* Botón Cancelar */
.btn-cancel {
  background: var(--blanco-ui);
  color: var(--texto-primario);
  border: none;
  padding: 8px 24px !important;
  border-radius: var(--radius-md);
  font-weight: 700;
  cursor: pointer;
  font-size: 1rem;
  font-family: var(--font-family);
}

.btn-primary:hover { background: var(--azul-oscuro); }
.btn-danger:hover { background: #a33b2e; }
.btn-cancel:hover { background: var(--bordes); }

/* === Filtros de búsqueda === */
.admin-filter-form {
  margin-bottom: 1rem;
}

.filter-row {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
}

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

.filter-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--texto-secundario);
}

.filter-input {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--bordes);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-body);
  min-width: 200px;
  font-family: var(--font-family);
}

.filter-input:focus {
  outline: none;
  border-color: var(--azul-gazapo);
}

.filter-select {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--bordes);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-body);
  min-width: 150px;
  font-family: var(--font-family);
  background: white;
}

.filter-select:focus {
  outline: none;
  border-color: var(--azul-gazapo);
}

.btn-filter {
  padding: 0.5rem 1rem;
  background: var(--azul-gazapo);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-family);
}

.btn-filter:hover {
  background: var(--azul-oscuro);
}

.btn-clear {
  padding: 0.5rem 1rem;
  background: var(--blanco-ui);
  color: var(--texto-primario);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  font-family: var(--font-family);
}

.btn-clear:hover {
  background: var(--bordes);
}

/* === Estados adicionales === */
.status-pending {
  background-color: var(--warning-bg);
  color: var(--warning);
}

.status-approved {
  background-color: var(--success-bg);
  color: var(--success);
}

.status-rejected {
  background-color: var(--error-bg);
  color: var(--error);
}

.status-published {
  background-color: var(--info-bg);
  color: var(--info);
}

/* === Totalizadores === */
.totals-bar {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--blanco-ui);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--texto-secundario);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.totals-bar .filter-active {
  color: var(--coral);
  font-weight: 600;
}

.totals-bar .totals-summary {
  color: var(--texto-primario);
  font-weight: 600;
}
