:root {
  --azul: #0e3a5d;
  --azul-claro: #1d5c8c;
  --fondo: #f4f7fb;
  --hoja: #ffffff;
  --tinta: #1e2933;
  --suave: #5c6b78;
  --linea: #d5dee8;
  --fuente: "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--tinta);
  background: var(--fondo);
  font-family: var(--fuente);
  font-size: 17px;
  line-height: 1.5;
}

a { color: #0b5cab; }

img { max-width: 100%; height: auto; }

.saltar {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--azul);
  color: white;
  padding: 0.5rem 0.8rem;
  z-index: 6;
}

.saltar:focus { top: 1rem; }

.envoltorio {
  width: min(1080px, calc(100% - 2rem));
  margin-inline: auto;
}

.franja {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.6rem 5.5rem;
  background: var(--azul);
  color: #f4f8fc;
  font-weight: 650;
  text-align: center;
}

.menu-btn {
  position: absolute;
  top: 50%;
  right: 1rem;
  transform: translateY(-50%);
  color: white;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: transparent;
  font: inherit;
  font-size: 14px;
  padding: 6px 12px;
  cursor: pointer;
}

.marca {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 18px 16px 14px;
  text-align: center;
  background: var(--hoja);
}

.marca-enlace {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.marca img { width: 84px; height: 90px; object-fit: contain; }

.marca strong {
  display: block;
  color: var(--azul);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.15;
}

.marca-dato { margin: 0; color: var(--suave); font-size: 14px; }

.marca-dato .telefono { color: inherit; font: inherit; font-weight: inherit; text-decoration: none; }

.menu { display: none; background: var(--hoja); border-bottom: 1px solid var(--linea); }

.menu.abierto { display: block; }

.menu .envoltorio {
  display: flex;
  flex-direction: column;
  padding: 0.35rem 0 0.6rem;
}

.menu a {
  color: var(--azul);
  text-decoration: none;
  font-weight: 650;
  padding: 0.7rem 0.2rem;
  border-bottom: 1px solid var(--linea);
}

.menu a[aria-current="page"] { color: var(--azul-claro); }

main { padding: 28px 0 40px; }

.presentacion h1,
.seccion h1,
.aviso h1,
.panel h1,
.panel h2,
.horario h2,
.aviso-acuerdo h2 {
  margin: 0 0 8px;
  color: var(--azul);
  font-size: 26px;
  font-weight: 700;
  text-align: center;
}

.ayuda { margin: 0 0 18px; color: var(--suave); }
.centro { text-align: center; }

.modulos {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-areas:
    "numero cedula"
    "nombre traslado"
    "estado cui";
  gap: 10px;
  margin-top: 8px;
  align-items: start;
}

.modulo {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 112px;
  padding: 12px 8px;
  text-align: center;
  text-decoration: none;
  font-size: 16px;
  font-weight: 650;
  line-height: 1.15;
  border: 2px solid var(--linea);
  border-radius: 8px;
}

.icono {
  width: 40px;
  height: 40px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.modulo-desplegable { padding: 0; align-items: stretch; }

.modulo-numero { grid-area: numero; background: #e7f1fa; border-color: #c3d7ec; color: #1d4f78; }

.modulo-abre {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 112px;
  padding: 12px 8px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.campo-modulo {
  display: grid;
  gap: 8px;
  width: 100%;
  padding: 0 10px 12px;
}

.campo-modulo[hidden] { display: none; }

.campo-modulo label { font-size: 14px; text-align: center; }

.faltan {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
  text-align: center;
}

.campo-modulo .boton { width: 100%; padding: 10px 12px; font-size: 16px; }

.campo-modulo .fechas {
  display: grid;
  gap: 6px;
  max-height: 240px;
  margin: 0;
  overflow: auto;
}

.campo-modulo .fechas a { width: 100%; justify-content: center; }

.campo-modulo .paginacion { margin: 0; }

.campo-modulo .vacio { margin: 0; text-align: center; font-size: 14px; }
.modulo-cedula { grid-area: cedula; background: #e6f5ee; border-color: #bddfce; color: #1d5c45; }
.modulo-nombre { grid-area: nombre; background: #f3eef8; border-color: #d9cbe6; color: #5a3d78; }
.modulo-estado { grid-area: estado; background: #e6f4f4; border-color: #bddcdc; color: #1d5c5c; }
.modulo-traslado { grid-area: traslado; background: #f8f1e4; border-color: #e6d4b0; color: #6b5420; }
.modulo-cui { grid-area: cui; background: #eef1f6; border-color: #cdd6e4; color: #3d4d66; }

.modulo-numero:hover { background: #d4e6f6; }
.modulo-cedula:hover { background: #d3eddf; }
.modulo-nombre:hover { background: #e7dff2; }
.modulo-estado:hover { background: #d3ecec; }
.modulo-traslado:hover { background: #f3e6cf; }
.modulo-cui:hover { background: #e0e6ef; }

.horario,
.aviso-acuerdo,
.panel,
.aviso,
.ficha {
  background: var(--hoja);
  border: 1px solid var(--linea);
  border-radius: 8px;
  padding: 22px 20px;
  margin-top: 16px;
}

.horario p,
.aviso-acuerdo p { margin: 0.35rem 0 0; text-align: center; }

.formulario { display: grid; gap: 8px; }

label { font-size: 18px; font-weight: 650; }

input[type="text"],
input[type="search"] {
  width: 100%;
  border: 2px solid #b7c6d4;
  border-radius: 8px;
  padding: 14px 16px;
  font: inherit;
  font-size: 18px;
  background: white;
}

input:focus {
  outline: 3px solid rgba(29, 92, 140, 0.25);
  border-color: var(--azul-claro);
}

.boton,
button.boton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  border: 0;
  border-radius: 8px;
  background: var(--azul);
  color: white;
  font: inherit;
  font-size: 18px;
  font-weight: 700;
  padding: 14px 24px;
  text-decoration: none;
  cursor: pointer;
}

.boton:hover,
button.boton:hover { background: var(--azul-claro); }

.boton.secundario {
  background: white;
  color: var(--azul);
  border: 2px solid var(--azul);
}

.fechas {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.fechas a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  background: #e7f1fa;
  color: var(--azul);
  border: 1px solid #b7d0e8;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
}

.fechas a:hover { background: var(--azul); color: white; }

.paginacion { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

.lista { margin: 8px 0 0; padding-left: 1.1rem; }
.lista li { margin: 0.45rem 0; }

.juzgados {
  display: grid;
  gap: 10px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.juzgados a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 72px;
  padding: 14px 16px;
  background: var(--hoja);
  color: var(--azul);
  border: 1px solid var(--linea);
  border-radius: 8px;
  text-align: left;
  text-decoration: none;
}

.juzgados a:hover { background: #e7f1fa; border-color: #b7d0e8; }

.juzgados strong {
  display: block;
  font-size: 18px;
  line-height: 1.2;
}

.juzgados a > span span {
  display: block;
  margin-top: 2px;
  color: var(--suave);
  font-size: 15px;
  font-weight: 500;
}

.sale {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.reporte-cabeza { text-align: center; }

.reporte-fecha {
  margin: 0;
  color: var(--azul);
  font-size: 20px;
  font-weight: 700;
  text-wrap: balance;
}

.reporte-total {
  display: inline-flex;
  margin: 10px 0 0;
  padding: 4px 14px;
  border-radius: 999px;
  background: #e7f1fa;
  color: var(--azul);
  font-weight: 700;
}

.reporte h2.grupo-estado {
  margin: 22px 0 8px;
  color: var(--azul);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
}

.estados {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.estado-card {
  display: block;
  padding: 14px 16px;
  background: #f7fafc;
  color: inherit;
  border: 1px solid var(--linea);
  border-radius: 8px;
  text-decoration: none;
}

.estado-card:hover { background: #e7f1fa; border-color: #b7d0e8; }

.estado-card strong {
  color: var(--azul);
  font-size: 20px;
  letter-spacing: 0.03em;
}

.estado-tipo {
  display: block;
  margin-top: 2px;
  color: var(--suave);
  font-size: 14px;
  font-weight: 650;
}

.estado-card dl {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
}

.estado-card dt {
  color: var(--suave);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.estado-card dd {
  margin: 0;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.estado-pie {
  margin: 12px 0 0;
  color: var(--suave);
  font-size: 14px;
}

.estado-pie span {
  display: block;
  margin-top: 4px;
  color: var(--tinta);
  font-weight: 650;
}

.reporte-acciones {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 18px 0 0;
}

.mapa {
  width: 100%;
  min-height: 280px;
  height: 55vw;
  max-height: 420px;
  border: 0;
  border-radius: 8px;
  margin-top: 12px;
}

.tabla-movil { overflow-x: auto; }

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

th, td {
  text-align: left;
  padding: 8px 10px;
  border: 1px solid #9bb0c3;
  vertical-align: top;
}

th { background: #e7f1fa; color: var(--azul); }

.ficha-cabeza { text-align: center; }

.numero-proceso {
  margin: 0;
  color: var(--azul);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.subtipo { margin: 4px 0 0; font-weight: 700; }

.estado-proceso {
  display: inline-flex;
  margin: 12px 0 0;
  padding: 4px 14px;
  border-radius: 999px;
  background: #e7f1fa;
  color: var(--azul);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.ficha-datos {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 18px 0 0;
}

.ficha-datos div {
  padding: 10px 12px;
  background: #f7fafc;
  border: 1px solid var(--linea);
  border-radius: 8px;
}

.ficha-datos dt { color: var(--suave); font-size: 13px; }

.ficha-datos dd { margin: 2px 0 0; color: var(--azul); font-weight: 700; }

.ficha-datos .ancho { grid-column: 1 / -1; }

.ficha-accion,
.acciones { margin: 16px 0 0; text-align: center; }

.ficha-accion .boton,
.acciones .boton { width: auto; }

.pila { display: grid; gap: 10px; }

.movimiento,
.persona {
  padding: 12px 14px;
  background: #f7fafc;
  border: 1px solid var(--linea);
  border-radius: 8px;
}

.movimiento p,
.persona p { margin: 0.2rem 0 0; }

.persona-nombre,
.movimiento-titulo { font-weight: 700; }

.persona-doc,
.movimiento-meta { color: var(--suave); font-size: 14px; }

.etiqueta {
  color: var(--azul);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.firma { text-align: center; margin-top: 16px; }
.vacio { color: var(--suave); }

.pie {
  color: var(--suave);
  text-align: center;
  padding: 0 0 28px;
  font-size: 14px;
}

.pie p { margin: 0.15rem 0; }

@media (max-width: 720px) {
  .tabla-movil table,
  .tabla-movil thead,
  .tabla-movil tbody,
  .tabla-movil tr,
  .tabla-movil th,
  .tabla-movil td { display: block; }

  .tabla-movil thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .tabla-movil tr {
    margin-bottom: 10px;
    border: 1px solid #9bb0c3;
    border-radius: 8px;
    overflow: hidden;
  }

  .tabla-movil td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border-width: 0 0 1px;
  }

  .tabla-movil td::before {
    content: attr(data-etiqueta);
    font-weight: 700;
    color: var(--azul);
    flex: 0 0 42%;
  }

}

@media (min-width: 760px) {
  .franja { padding-inline: 1rem; }
  .menu-btn { display: none; }
  .menu { display: block; }
  .menu .envoltorio { flex-direction: row; justify-content: center; gap: 28px; }
  .menu a { border-bottom: 0; padding: 10px 0 14px; }
  .juzgados { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .estados { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modulos {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-areas:
      "numero cedula nombre"
      "traslado cui estado";
  }
  .ficha-datos { grid-template-columns: repeat(3, 1fr); }
  .datos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 12px; }
  .datos div { background: var(--hoja); border: 1px solid var(--linea); border-radius: 8px; padding: 12px 14px; }
  .datos dt { color: var(--suave); font-size: 13px; }
  .datos dd { margin: 4px 0 0; font-weight: 700; color: var(--azul); }
}

@media print {
  .franja,
  .menu,
  .boton { display: none !important; }
  .estado-card { break-inside: avoid; }
}
