:root {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #17343b;
  background: #eef4f3;
  color-scheme: light;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, select, input, textarea { font: inherit; }
a { color: #075d67; }

.cabecera {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.5rem max(1rem, calc((100vw - 1180px) / 2));
  color: white;
  background: #123f49;
}
.cabecera h1 { margin: .15rem 0; font-size: clamp(1.45rem, 3vw, 2.1rem); }
.cabecera p { margin: .25rem 0; max-width: 52rem; }
.marca, .etiqueta {
  margin: 0;
  color: #26727b;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .08em;
}
.cabecera .marca { color: #9ee3d1; }
.cabecera-acciones { display: flex; flex-wrap: wrap; gap: .6rem; }
.cabecera-acciones a, .cabecera-acciones button {
  display: inline-flex;
  align-items: center;
  min-height: 2.6rem;
  padding: .65rem .9rem;
  color: white;
  text-decoration: none;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 7px;
}

.contenedor { width: min(1180px, calc(100% - 2rem)); margin: 1.5rem auto 3rem; }
.panel {
  margin-bottom: 1rem;
  padding: 1.25rem;
  background: white;
  border: 1px solid #d5e2e0;
  border-radius: 12px;
  box-shadow: 0 8px 26px rgba(18, 63, 73, .06);
}
.panel h2, .panel h3 { margin: .25rem 0 .75rem; }
.panel-cabecera, .solicitud-cabecera {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.filtros-panel { display: grid; grid-template-columns: minmax(13rem, .65fr) 1.35fr; gap: 1.5rem; }
.filtros { display: grid; grid-template-columns: repeat(2, minmax(10rem, 1fr)) auto; gap: .8rem; align-items: end; }
label { display: grid; gap: .35rem; font-weight: 700; }
select, input, textarea {
  min-height: 2.7rem;
  padding: .5rem .65rem;
  color: #17343b;
  background: #fbfdfc;
  border: 1px solid #9fbab5;
  border-radius: 7px;
}
.filtros-acciones, .acciones { display: flex; flex-wrap: wrap; gap: .55rem; }
button {
  min-height: 2.55rem;
  padding: .6rem .85rem;
  color: white;
  font-weight: 700;
  background: #075d67;
  border: 1px solid #075d67;
  border-radius: 7px;
  cursor: pointer;
}
button:hover { background: #064b53; }
button:disabled { opacity: .55; cursor: wait; }
.boton-secundario { color: #075d67; background: white; border-color: #7aa3a7; }
.boton-secundario:hover { background: #edf7f5; }
button:focus-visible, a:focus-visible, select:focus-visible,
input:focus-visible, textarea:focus-visible { outline: 3px solid #d58519; outline-offset: 2px; }

.mensaje { min-height: 1.5rem; padding: .7rem 1rem; color: #284d53; }
.mensaje.exito { color: #11613d; background: #e9f8ef; border-radius: 8px; }
.mensaje.error { color: #8d2828; background: #fff0f0; border-radius: 8px; }

.solicitudes { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem; }
.solicitud, .solicitud-vacia { padding: 1rem; border: 1px solid #d9e5e3; border-radius: 10px; }
.solicitud h3 { margin: 0; }
.solicitud-referencia, .solicitud-resumen { margin: .35rem 0; color: #49656a; overflow-wrap: anywhere; }
.solicitud-estados { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .35rem; }
.insignia { display: inline-flex; padding: .3rem .55rem; font-size: .76rem; font-weight: 800; border-radius: 999px; background: #e9f1f1; }
.correo-correo_enviado { color: #12613c; background: #def5e8; }
.correo-correo_fallido { color: #962f2f; background: #ffe5e5; }
.correo-pendiente { color: #80520b; background: #fff1cf; }
.estado-nueva { color: #125174; background: #deeffa; }
.estado-contactada { color: #594394; background: #eee8ff; }

.detalle-bloque + .detalle-bloque { margin-top: 1.3rem; padding-top: 1rem; border-top: 1px solid #dce6e4; }
.datos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; margin: 0; }
.dato { min-width: 0; padding: .7rem; background: #f6faf9; border-radius: 8px; }
.dato dt { color: #557176; font-size: .78rem; font-weight: 800; text-transform: uppercase; }
.dato dd { margin: .25rem 0 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.documentos { padding-left: 1.25rem; }
.documentos li { margin: .45rem 0; }
.enlace #enlace { padding: .75rem; overflow-wrap: anywhere; background: #f2f8f6; border-radius: 8px; }

.flujo-accion {
  padding: 1rem;
  background: #f8fbfa;
  border: 1px solid #dce8e5;
  border-radius: 10px;
}
.ayuda-accion { color: #49656a; }
.formulario-accion { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; align-items: end; }
.formulario-accion .campo-accion:has(textarea) { grid-column: 1 / -1; }
.formulario-accion button { justify-self: start; }
.boton-advertencia { color: #7c3a0b; background: #fff5e7; border-color: #c77b36; }
.boton-advertencia:hover { background: #ffead1; }
.checklist-admin { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.documento-admin { display: grid; gap: .6rem; align-content: start; padding: .9rem; border: 1px solid #d9e5e3; border-radius: 9px; }
.documento-admin h4, .documento-admin p { margin: 0; }
.documento-observado { border-color: #d79657; background: #fffaf2; }
.documento-aprobado { border-color: #7fbd98; background: #f2fbf5; }
.documento-faltante { border-style: dashed; color: #5e7478; }
.observacion { color: #7c3a0b; }
.documentos-historicos, .historial-eventos { color: #49656a; }
.documentos-historicos li, .historial-eventos li { margin: .4rem 0; }
.expediente-resumen { margin-top: 1rem; }
.documentos-checklist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
.documento-estado { display: grid; gap: .25rem; padding: .75rem; border: 1px solid #d9e5e3; border-radius: 8px; }
.documento-estado p { margin: .25rem 0 0; color: #7c3a0b; }
.carga-documentos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
#formulario { display: grid; gap: 1rem; padding: 1.15rem; background: white; border: 1px solid #d5e2e0; border-radius: 12px; }
#formulario[hidden] { display: none; }
#formulario fieldset { display: grid; gap: .6rem; border: 1px solid #d5e2e0; border-radius: 8px; }
#formulario input[type="file"] { width: 100%; min-height: auto; background: #f7faf9; }

@media (max-width: 820px) {
  .cabecera, .panel-cabecera, .solicitud-cabecera { align-items: stretch; flex-direction: column; }
  .filtros-panel { grid-template-columns: 1fr; }
  .filtros { grid-template-columns: 1fr 1fr; }
  .filtros-acciones { grid-column: 1 / -1; }
  .solicitud-estados { justify-content: flex-start; }
  .datos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .checklist-admin, .carga-documentos { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .contenedor { width: min(100% - 1rem, 1180px); margin-top: .5rem; }
  .cabecera { padding: 1rem; }
  .filtros, .datos, .formulario-accion, .documentos-checklist { grid-template-columns: 1fr; }
  .formulario-accion .campo-accion:has(textarea) { grid-column: auto; }
  .filtros-acciones { grid-column: auto; }
  .filtros-acciones button, .acciones button { width: 100%; }
}
