body {
  background: #f8f9fa;
  font-family: "Inter", sans-serif;
}
.navbar-brand img {
  height: 45px;
}
.hero {
  background: linear-gradient(90deg, rgb(133 194 38), rgb(49 116 7));
  /* url(public/img/img_3.jpg) center / cover; */
  color: white;
  text-align: center;
  padding: 4rem 1rem;
}
.search-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  padding: 2rem;
  margin-top: -3rem;
}
.filter-box {
  background: #f1f4f8;
  border-radius: 8px;
  padding: 1.5rem;
}
.spinner-dots {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}
.dot {
  width: 10px;
  height: 10px;
  margin: 0 5px;
  border-radius: 50%;
  background: #007bff;
  animation: bounce 1.4s infinite ease-in-out both;
}
.dot:nth-child(1) {
  animation-delay: -0.32s;
}
.dot:nth-child(2) {
  animation-delay: -0.16s;
}
@keyframes bounce {
  0%,
  80%,
  100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}
.clickable:hover {
  background-color: #ffe9ec;
  cursor: pointer;
}
#resultsTable {
  width: 100% !important;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}
#resultsTable thead {
  background-color: #4e8f12;
  color: #fff;
  font-weight: 500;
}
#resultsTable tbody tr:hover {
  background-color: #e9f4ff !important;
  cursor: pointer;
}
/* Fila seleccionada */
#resultsTable tbody tr.selected {
  background-color: #4b8f2121 !important;
  font-weight: 600;
}
.exp-tiempo-actual {
  color: #d00000;
  font-size: 0.8rem;
  font-weight: 600;
}
/* Contenedor general */
.exp-wrapper {
  background: #f7fafc;
  padding: 10px 5px 20px 5px;
}
/* UL raíz */
.exp-timeline,
.exp-children {
  list-style: none;
  margin: 0;
  padding: 0;
}
/* Cada nodo */
.exp-item {
  position: relative;
  margin-bottom: 18px;
}
/* Marca y línea vertical de este nivel */
.exp-marker {
  position: absolute;
  left: 14px;
  top: 0;
  bottom: 0;
}
/* Línea vertical (solo se ve si hay hijos o siguiente item) */
.exp-marker::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: -12px;
  border-left: 2px solid #e2e8f0;
}
/* Punto del nodo */
.exp-dot {
  position: absolute;
  top: 18px;
  left: -5px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #2563eb;
}
/* Tarjeta del documento */
.exp-card {
  margin-left: 5px;
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
  padding: 10px 14px;
}
.exp-expediente {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e293b; /* slate-800 */
  background: #f1f5f9; /* slate-100 */
  padding: 6px 10px;
  border-left: 4px solid #2563eb; /* blue-600 */
  margin-bottom: 8px;
  border-radius: 4px;
}

/* Cabecera tarjeta */
.exp-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 4px;
}
.exp-dep {
  font-weight: 600;
  font-size: 0.9rem;
}
.exp-remitente {
  font-size: 0.75rem;
  color: #6b7280;
}
.exp-fecha {
  font-size: 0.75rem;
  padding: 3px 7px;
  border-radius: 20px;
  background: #fee2e2;
  color: #b91c1c;
}
/* Cuerpo tarjeta */
.exp-body {
  font-size: 0.78rem;
}
.exp-tipo-num {
  margin-bottom: 4px;
}
.exp-tipo {
  font-weight: 700;
}
.exp-num {
  font-weight: 600;
  margin-left: 4px;
}
/* Etiquetas */
.exp-label {
  font-weight: 600;
}
/* Badges de estado */
.exp-badge {
  display: inline-block;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 999px;
  margin-left: 4px;
  color: #fff;
}
.indent {
  margin-left: 40px;
}

.exp-node.exp-indent {
  margin-left: 40px;
  position: relative;
}

.exp-node.exp-indent::before {
  content: "";
  position: absolute;
  left: -20px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #e5e7eb; /* gris claro GOV-style */
}

.estado-recibido {
  background: #16a34a;
}
.estado-parcial {
  background: #0d9488;
}
.estado-emitido {
  background: #2563eb;
}
.estado-noleido {
  background: #f97316;
}
.estado-default {
  background: #6b7280;
}
.estado-enviado {
  background: #0284c7; /* sky-600 */
}
.estado-derivado {
  background: #0ea5e9; /* sky-500 */
}
.estado-atendido {
  background: #7c3aed; /* violet-600 */
}
.estado-atendido-parcial {
  background: #a78bfa; /* violet-400 */
}
.estado-anulado {
  background: #dc2626; /* red-600 */
}
.estado-observado {
  background: #e11d48; /* rose-600 */
}
.estado-pendientes {
  background: #ca8a04; /* yellow-600 */
}
.estado-para-despacho {
  background: #eab308; /* yellow-500 */
}
.estado-archivado {
  background: #b45309; /* amber-700 */
}
.estado-en-proyecto {
  background: #334155; /* slate-700 */
}
/* Subniveles: línea vertical a la izquierda para simular árbol */
.exp-children {
  margin-top: 8px;
  margin-left: 35px;
  /* padding-left: 25px; */
  /* border-left: 2px solid #e2e8f0; */
}
/* Timeline vertical GOV */
.timeline {
  position: relative;
  list-style-type: none;
  margin: 0;
  padding-left: 0;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, #e5e7eb, #cbd5f5);
  animation: timeline-flow 3s linear infinite;
  opacity: 0.6;
}

@keyframes timeline-flow {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 0 40px;
  }
}

/* Tarjeta tipo expediente digital */
.exp-card {
  position: relative;
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  padding: 10px 12px;
}

/* Línea que conecta el icono con la línea vertical */
.exp-node {
  position: relative;
  margin-bottom: 18px;
}

.exp-node-icon-wrapper {
  position: relative;
  margin-right: 8px;
}

/* Si NO debe tener línea → se elimina */
.exp-node.no-line::before {
  display: none !important;
}

/* Si es hijo indentado */
.exp-indent {
  margin-left: 40px;
}

/* Ícono circular */
.exp-node-icon-wrapper {
  position: relative;
  z-index: 5;
}

/* Línea horizontal hacia el nodo */
.exp-node-icon-wrapper::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 2px;
  background: #d0d7de;
  left: -20px;
  top: 50%;
}

.exp-node::before {
  content: "";
  position: absolute;
  left: 20px; /* alineado con la línea */
  top: 32px;
  bottom: -16px;
  width: 2px;
  background-color: transparent; /* ya la línea principal está en .timeline */
}

/* Icono redondo tipo expediente 📁 */
.exp-icon {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #ffffff;
  box-shadow: 0 0 0 2px #ffffff;
}

/* Colores por nivel (opcional) */
.exp-nivel-0 .exp-icon {
  background: #2563eb;
} /* azul */
.exp-nivel-1 .exp-icon {
  background: #0d9488;
} /* teal */
.exp-nivel-2 .exp-icon {
  background: #16a34a;
} /* verde */
.exp-nivel-3 .exp-icon {
  background: #f97316;
} /* naranja */
.exp-nivel-4 .exp-icon {
  background: #7c3aed;
} /* violeta */
.exp-nivel-5 .exp-icon {
  background: #dc2626;
} /* rojo */

/* Cabecera GOV */
.exp-expediente {
  font-size: 0.85rem;
  font-weight: 700;
  color: #1e293b;
  background: #f1f5f9;
  padding: 4px 8px;
  border-left: 4px solid #2563eb;
  margin-bottom: 6px;
  border-radius: 4px;
}

.exp-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.exp-dep {
  font-weight: 600;
  color: #0f172a;
  font-size: 0.9rem;
}

.exp-remitente {
  font-size: 0.8rem;
  color: #6b7280;
}

.exp-fecha {
  font-size: 0.8rem;
  color: #6b7280;
  text-align: center;
  min-width: 18%;
}

/* Asunto / contenido */
.exp-body p {
  margin-bottom: 0.25rem;
  font-size: 0.83rem;
}

/* Badges de estado (uses tus clases de estado) */
.exp-estado-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 0.7rem;
  color: #ffffff;
}

/* Tus colores de estados (los que ya definiste + ampliados) */
.estado-recibido {
  background: #16a34a;
}
.estado-parcial {
  background: #0d9488;
}
.estado-emitido {
  background: #2563eb;
}
.estado-noleido {
  background: #f97316;
}
.estado-default {
  background: #6b7280;
}
.estado-enviado {
  background: #0284c7;
}
.estado-derivado {
  background: #0ea5e9;
}
.estado-atendido {
  background: #7c3aed;
}
.estado-atendido-parcial {
  background: #a78bfa;
}
.estado-observado {
  background: #e11d48;
}
.estado-anulado {
  background: #dc2626;
}
.estado-pendientes {
  background: #ca8a04;
}
.estado-para-despacho {
  background: #eab308;
}
.estado-archivado {
  background: #b45309;
}
.estado-en-proyecto {
  background: #334155;
}

/* Botón expandir / contraer */
.exp-toggle-btn {
  border: none;
  background: transparent;
  font-size: 0.8rem;
  color: #64748b;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 0;
}

.exp-toggle-btn:hover {
  color: #0f172a;
}

/* Contenedor hijos */
.exp-children {
  margin-left: 35px;
  /* border-left: 1px dashed #e5e7eb;
    padding-left: 10px; */
  margin-top: 6px;
}

/* Sello / firma para ATENDIDO / ARCHIVADO */
.exp-sello {
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #dc2626;
  border: 2px solid #dc2626;
  padding: 2px 6px;
  border-radius: 4px;
  transform: rotate(-8deg);
  opacity: 0.85;
  background: rgba(248, 250, 252, 0.95);
}

.resumen-oficinas {
  font-family: sans-serif;
}

.resumen-item {
  padding: 10px;
  margin-bottom: 12px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.resumen-title {
  color: #2563eb;
  font-weight: 600;
}

.resumen-main {
  font-size: 1.6rem;
  font-weight: 700;
  margin-top: 3px;
}

.resumen-sub {
  font-size: 0.85rem;
  color: #4b5563;
}

/* BLOQUE REMITENTE */
.remitente-box {
  border-left: 4px solid #2a74d8; /* Azul más formal y visible */
  padding: 6px 10px;
  margin-bottom: 6px;
  background: #e9f2ff; /* Fondo azul suave */
  border-radius: 6px;
}

/* ============================================
 BLOQUE DESTINO (VERDE DESTACADO)
 ============================================ */
.destino-box {
  border-left: 4px solid #1fa34a; /* Verde más intenso = acción */
  padding: 6px 10px;
  background: #e9faef; /* Verde suave */
  border-radius: 6px;
  margin-bottom: 8px;
}

/* ============================================
 TEXTO DE OFICINA (PRINCIPAL)
 ============================================ */
.oficina-label {
  font-weight: 700;
  font-size: 0.95rem;
  color: #000;
  display: block;
  margin-bottom: 2px;
}

/* ============================================
 TEXTO DEL USUARIO (SECUNDARIO)
 ============================================ */
.usuario-label {
  font-size: 0.82rem;
  color: #555;
  margin-top: -2px;
}

.timeline-wrapper {
  overflow: auto;
  white-space: nowrap;
  cursor: grab;
}

.timeline-wrapper.dragging {
  cursor: grabbing;
  user-select: none;
}

/* El árbol de nodos ahora fluye horizontalmente */
.exp-tree-root,
.exp-children {
  display: block;
  position: relative;
  padding-left: 20px; /* desplazamiento base */
}

/* Las tarjetas NO se achican jamás */
.exp-card {
  width: 700px; /* 🔥 el ancho real de cada tarjeta */
  min-width: 700px;
  max-width: 700px;
  display: block;
  white-space: normal; /* el contenido sí envuelve texto */
}

#timelineWrapper {
  /* width: 100%; */
  /* height: 70vh; */
  position: relative;
  overflow: auto;
  cursor: grab;
  touch-action: auto;
}

.timeline-zoom {
  transform-origin: 0 0;
  transition: transform 0.1s linear;
  touch-action: none; /* ⬅️ NECESARIO para móviles */
}

#timelineWrapper.dragging {
  cursor: grabbing !important;
}

#timeline {
  transform-origin: 0 0;
  touch-action: none; /* NECESARIO PARA MULTITOUCH */
}

@media (max-width: 768px) {
  #timelineWrapper {
    height: 60vh !important;
  }
}

.expediente-card {
  background: #fff;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 12px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  font-family: Arial, sans-serif;
}

.expediente-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.95rem;
  font-weight: bold;
  color: #3949ab;
}

.expediente-tiempo {
  color: #555;
  font-weight: 600;
}

.expediente-body {
  margin-top: 8px;
}

.exp-num {
  font-weight: bold;
  color: #000;
  font-size: 1rem;
}

.exp-doc {
  color: #555;
  margin-top: 2px;
  font-size: 0.9rem;
}

.exp-detalles {
  margin-top: 6px;
  font-size: 0.85rem;
  color: #666;
}

.exp-veces {
  margin-left: 10px;
}
