:root {
  color-scheme: light;
  --tinta: #1b2c43;
  --suave: #5f7086;
  --linea: #dce4ee;
  --fondo: #f4f7fb;
  --caja: #fff;
  --relleno: #f7f9fc;
  --acento: #245bd6;
  --acento-hover: #1c49b1;
  --acento-suave: #eaf0ff;
  --rojo: #b53e47;
  --sombra: 0 3px 12px rgb(25 45 78 / 4%);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-width: 320px;
  font: 15px/1.6 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--tinta);
  background: var(--fondo);
  -webkit-font-smoothing: antialiased;
}
#pagina { display: flex; flex-direction: column; min-height: 100vh; min-height: 100svh; }
a { color: var(--acento); text-underline-offset: 3px; }
a:hover { color: var(--acento-hover); }
p { margin: 12px 0 18px; }
h1, h2 { line-height: 1.3; overflow-wrap: break-word; }
h1 { margin: 0 0 16px; font-size: 30px; font-weight: 750; letter-spacing: -.025em; }
h2 { margin: 0 0 18px; font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
:focus-visible { outline: 2px solid var(--acento); outline-offset: 4px; }
h1[tabindex="-1"]:focus { outline: none; }

.aviso {
  padding: 7px 20px;
  background: #eaf0f7;
  color: #52647b;
  text-align: center;
  font-size: 12px;
}
.app {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px 32px;
  padding: 18px max(24px, calc((100% - 1136px) / 2));
  border-bottom: 1px solid var(--linea);
  background: var(--caja);
}
.marca {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--tinta);
  font-size: 18px;
  font-weight: 750;
  letter-spacing: -.025em;
  text-decoration: none;
}
.marca::before {
  content: "";
  width: 12px;
  height: 20px;
  border-radius: 4px;
  background: var(--acento);
  box-shadow: 5px 0 0 #b7cbfa;
}
.app nav { display: flex; flex-wrap: wrap; gap: 4px; }
.app nav a {
  padding: 9px 14px;
  border-radius: 8px;
  color: var(--suave);
  font-size: 14px;
  font-weight: 550;
  text-decoration: none;
}
.app nav a:hover { background: var(--relleno); color: var(--tinta); }
.app nav a[aria-current="page"] { color: var(--acento); background: var(--acento-suave); font-weight: 650; }
.contenido { flex: 1; width: 100%; max-width: 1200px; min-width: 0; margin: 0 auto; padding: 36px 32px 64px; }
footer {
  padding: 20px max(24px, calc((100% - 1136px) / 2));
  border-top: 1px solid var(--linea);
  background: var(--caja);
  color: var(--suave);
  font-size: 12px;
}

.intro { margin-bottom: 24px; padding: 40px 44px; border-radius: 16px; background: #172f52; color: #fff; }
.intro > p:first-child { margin: 0 0 18px; color: #b8d0ff; font-size: 11px; font-weight: 650; letter-spacing: .14em; }
.intro h1 { margin-bottom: 18px; font-size: clamp(30px, 3.5vw, 44px); line-height: 1.16; letter-spacing: -.035em; }
.intro > p:last-of-type { max-width: 65ch; margin-bottom: 26px; color: #d4e0f1; font-size: 16px; line-height: 1.75; }
.intro .boton.primario { border-color: #fff; background: #fff; color: #172f52; }
.intro .boton.primario:hover { border-color: #e2ebfa; background: #e2ebfa; color: #172f52; }
.modulos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.modulos .caja { display: flex; flex-direction: column; margin: 0; padding: 28px; }
.modulos h2 { margin-bottom: 4px; font-size: 18px; }
.modulos p { color: var(--suave); }
.modulos .caja > :last-child { margin-top: auto; margin-bottom: 0; padding-top: 10px; }
.modulos a { font-size: 14px; font-weight: 650; text-decoration: none; }
.modulos a:hover { text-decoration: underline; }

#vista[aria-busy="true"] { opacity: .6; transition: opacity .15s; }
.migas { margin-bottom: 16px; color: var(--suave); font-size: 13px; }
.migas a { color: var(--suave); text-decoration: none; }
.migas a:hover { color: var(--acento); text-decoration: underline; }
.cabecera { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px 24px; margin-bottom: 24px; }
.cabecera > h1, .cabecera h2 { margin-bottom: 0; }
.cabecera > div:first-child { min-width: 0; }
.datos { color: var(--suave); font-size: 14px; overflow-wrap: break-word; }
div.datos { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 0; }
.datos span { display: inline-block; max-width: 100%; font-size: 14px; }
.acciones, .pie { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.acciones { flex-shrink: 0; }
.pie { margin-top: 24px; }

.boton {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  max-width: 100%;
  padding: 10px 16px;
  border: 1px solid #ccd7e5;
  border-radius: 8px;
  background: var(--caja);
  color: #3e526d;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
a, button, input, select, textarea { transition: background-color .15s, border-color .15s, box-shadow .15s, color .15s; }
.boton:hover { border-color: #aabdd8; background: #f4f7fc; color: var(--tinta); }
.boton.primario { border-color: var(--acento); background: var(--acento); color: #fff; box-shadow: 0 2px 4px rgb(36 91 214 / 12%); }
.boton.primario:hover { border-color: var(--acento-hover); background: var(--acento-hover); color: #fff; }
.boton[data-testid$="-baja"] { border-color: #edcdd1; background: #fff; color: var(--rojo); }
.boton[data-testid$="-baja"]:hover { border-color: #dca9af; background: #fff1f2; }
.boton.deshabilitado, .boton:disabled {
  border-color: #e2e7ee;
  background: #f1f4f8;
  color: #8a97a8;
  box-shadow: none;
  cursor: not-allowed;
}
.boton.deshabilitado { pointer-events: none; }

.estado {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 12px;
  padding: 5px 10px;
  border-radius: 20px;
  background: #eaf0f6;
  color: #52677e;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0;
  vertical-align: middle;
  white-space: nowrap;
}
.estado::before { content: ""; width: 6px; height: 6px; flex-shrink: 0; border-radius: 50%; background: currentColor; }
.estado[data-estado="En progreso"], .estado[data-estado="En curso"] { background: #e8efff; color: #285abc; }
.estado[data-estado="Aprobada"], .estado[data-estado="Terminada"], .estado[data-estado="Finalizada"], .estado[data-estado="Finalizado"] { background: #e5f5ed; color: #246d4b; }
.estado[data-estado="Bloqueado"] { background: #fff2cf; color: #855d09; }
.estado[data-estado="Rechazada"], .estado[data-estado="Cancelado"], .estado[data-estado="Cancelada"] { background: #fcebed; color: #a73745; }
.caja { min-width: 0; margin-bottom: 24px; padding: 24px; border: 1px solid var(--linea); border-radius: 12px; background: var(--caja); box-shadow: var(--sombra); }
.pestanas { display: flex; flex-wrap: wrap; gap: 24px; margin-bottom: 20px; border-bottom: 1px solid var(--linea); }
.pestanas a { padding: 10px 2px 12px; border-bottom: 2px solid transparent; color: var(--suave); font-size: 14px; font-weight: 550; text-decoration: none; }
.pestanas a:hover { color: var(--acento); }
.pestanas a.activa, .pestanas a[aria-current="page"] { border-bottom-color: var(--acento); color: var(--acento); font-weight: 650; }
.tabla-scroll { max-width: 100%; overflow-x: auto; border: 1px solid var(--linea); border-radius: 8px; }
table { width: 100%; min-width: 480px; border-collapse: collapse; }
th, td { padding: 13px 16px; border-bottom: 1px solid var(--linea); text-align: left; }
th { background: var(--relleno); color: #566982; font-size: 11px; font-weight: 650; letter-spacing: .045em; text-transform: uppercase; white-space: nowrap; }
td { font-size: 14px; line-height: 1.55; overflow-wrap: break-word; }
td:first-child { font-variant-numeric: tabular-nums; }
td a { font-weight: 550; text-decoration: none; }
td a:hover { text-decoration: underline; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f7faff; }
td.numero, th.numero { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.paginacion { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; color: var(--suave); font-size: 14px; }
.vacio { padding: 28px 20px; border: 1px dashed #d3deec; border-radius: 8px; background: var(--relleno); color: var(--suave); font-size: 14px; text-align: center; }

.formulario { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 24px; }
.formulario > div, .columnas > div { min-width: 0; }
.formulario .ancho { grid-column: 1 / -1; }
.filtros { display: grid; grid-template-columns: repeat(2, minmax(0, 220px)); gap: 16px 24px; padding: 18px 24px; }
.ayuda { margin: 6px 0 0; color: var(--suave); font-size: 13px; }
.opciones { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 24px; margin: 0; padding: 0; border: 0; }
.opciones legend { margin-bottom: 8px; color: #43556e; font-size: 13px; font-weight: 600; }
.opcion { display: flex; align-items: center; gap: 10px; min-height: 44px; margin: 0; color: var(--tinta); font-size: 14px; font-weight: 500; }
.opcion input { width: 18px; min-height: 18px; height: 18px; margin: 0; flex-shrink: 0; accent-color: var(--acento); }
.formulario + .pie { padding-top: 24px; border-top: 1px solid var(--linea); }
label { display: block; margin-bottom: 7px; color: #43556e; font-size: 13px; font-weight: 600; }
input, select, textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #cbd6e5; border-radius: 8px; background: var(--caja); color: var(--tinta); font: inherit; font-size: 15px; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: #8290a2; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--acento); box-shadow: 0 0 0 3px rgb(36 91 214 / 12%); }
textarea { min-height: 120px; resize: vertical; }
input:disabled, select:disabled, textarea:disabled { border-color: var(--linea); background: #f1f4f8; color: #8491a3; cursor: not-allowed; }
.invalido, [aria-invalid="true"] { border-color: #d6747e; background: #fff8f8; }
.mensaje { margin-bottom: 24px; padding: 14px 16px; border: 1px solid #c4e3d4; border-radius: 8px; background: #eff9f3; color: #286345; font-size: 14px; }
.mensaje.error { border-color: #edc7cc; background: #fff2f3; color: #963746; }
.mensaje b { margin-right: 6px; }
.tiempos { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; margin-bottom: 24px; }
.tiempos .caja { margin: 0; padding: 20px 24px; }
.tiempos span { display: block; margin-bottom: 6px; color: var(--suave); font-size: 13px; }
.tiempos strong { color: var(--acento); font-size: 32px; font-weight: 700; line-height: 1.3; font-variant-numeric: tabular-nums; letter-spacing: -.035em; }
.columnas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.columnas > .caja, .columnas > div > .caja:last-child { margin-bottom: 0; }
.en-linea { display: flex; align-items: flex-end; gap: 10px; }
.en-linea > div { flex: 1; min-width: 0; }
.fondo-modal { position: fixed; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgb(18 34 58 / 55%); backdrop-filter: blur(3px); }
.dialogo { width: 100%; max-width: 560px; max-height: calc(100dvh - 32px); overflow-y: auto; padding: 32px; border: 1px solid var(--linea); border-radius: 16px; background: var(--caja); box-shadow: 0 24px 80px rgb(13 30 54 / 20%); }
.dialogo h2 { margin-bottom: 20px; font-size: 22px; }
.dialogo p, .dialogo .datos { margin: 0 0 16px; }
#servicios { margin-top: 24px; color: var(--suave); }
#servicios ul { padding: 0; list-style: none; }
#servicios li { margin-bottom: 10px; padding: 16px 20px; border: 1px solid var(--linea); border-radius: 8px; background: var(--caja); }

@media (max-width: 960px) {
  .columnas { grid-template-columns: 1fr; }
  .cabecera { flex-wrap: wrap; }
  .acciones { flex-shrink: 1; }
}
@media (max-width: 720px) {
  .app { gap: 12px; padding: 16px; }
  .app nav { width: 100%; max-width: 100%; flex-wrap: nowrap; overflow-x: auto; }
  .app nav { gap: 2px; }
  .app nav a { flex-shrink: 0; padding: 9px 7px; font-size: 12px; font-weight: 500; }
  .contenido { padding: 24px 16px 40px; }
  h1 { font-size: 25px; }
  h2 { font-size: 16px; }
  .intro { padding: 28px 24px; border-radius: 12px; }
  .intro h1 { font-size: 30px; }
  .intro > p:last-of-type { font-size: 15px; }
  .intro .boton { width: 100%; }
  .modulos { grid-template-columns: 1fr; gap: 16px; }
  .modulos .caja, .caja { padding: 20px; }
  .cabecera { flex-direction: column; gap: 16px; }
  .acciones { width: 100%; }
  .estado { margin-left: 8px; }
  .filtros, .opciones { grid-template-columns: 1fr; }
  .pestanas { gap: 20px; }
  .formulario { grid-template-columns: 1fr; gap: 18px; }
  .en-linea { flex-wrap: wrap; }
  .en-linea > div { flex-basis: 100%; }
  .en-linea > .boton { width: 100%; }
  .tiempos { gap: 12px; }
  .tiempos .caja { padding: 16px; }
  .tiempos strong { font-size: 28px; }
  .tiempos span { min-height: 40px; font-size: 12px; }
  .dialogo { padding: 24px; }
  footer { padding: 18px 16px; }
}
@media (max-width: 380px) {
  .app nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app nav a { text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  a, button, input, select, textarea { transition: none; }
}
