:root {
  --azul: #12305a;
  --azul-2: #1d4b8a;
  --amarillo: #f2b705;
  --gris-0: #f6f7f9;
  --gris-1: #e5e7eb;
  --gris-3: #9ca3af;
  --gris-5: #4b5563;
  --texto: #1f2937;
  --verde: #15803d;
  --rojo: #b91c1c;
  --naranjo: #b45309;
  --radio: 8px;
  --sombra: 0 2px 10px rgba(0, 0, 0, .08);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--texto);
  background: #fff;
  line-height: 1.5;
}
a { color: var(--azul-2); }
h1, h2, h3 { line-height: 1.2; color: var(--azul); }
.oculto { display: none !important; }
.contenedor { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

/* Encabezado */
.encabezado {
  position: sticky; top: 0; z-index: 50;
  background: var(--azul); color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
}
.encabezado .contenedor { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.marca { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.15rem; display: flex; align-items: center; gap: 10px; }
.marca .logo { width: 34px; height: 34px; border-radius: 6px; background: var(--amarillo); color: var(--azul); display: grid; place-items: center; font-weight: 800; }
.nav { display: flex; align-items: center; gap: 16px; }
.nav a.link { color: #dbe4f3; text-decoration: none; font-size: .95rem; }
.nav a.link:hover { color: #fff; }
@media (max-width: 720px) { .nav a.link { display: none; } }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: var(--radio);
  padding: 9px 16px; font-size: .95rem; font-weight: 600; cursor: pointer;
  background: var(--azul-2); color: #fff; text-decoration: none; font-family: inherit;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .6; cursor: default; }
.btn-amarillo { background: var(--amarillo); color: var(--azul); }
.btn-sec { background: #fff; color: var(--azul-2); border-color: var(--gris-1); }
.btn-verde { background: var(--verde); }
.btn-rojo { background: var(--rojo); }
.btn-chico { padding: 5px 10px; font-size: .85rem; }

/* Portada */
.hero { position: relative; overflow: hidden; background: linear-gradient(135deg, var(--azul) 0%, var(--azul-2) 100%); color: #fff; padding: 56px 0 64px; }
.hero-foto { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 70% center; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(90deg, rgba(12, 32, 62, .94) 0%, rgba(18, 48, 90, .82) 40%, rgba(18, 48, 90, .35) 75%, rgba(18, 48, 90, .15) 100%);
}
.hero .contenedor { position: relative; z-index: 2; width: 100%; }
.hero h1, .hero p { text-shadow: 0 1px 3px rgba(0, 0, 0, .35); }
@media (min-width: 721px) {
  .hero { display: flex; align-items: center; min-height: min(520px, calc(100vh - 60px)); }
}
@media (max-width: 720px) {
  .hero { padding: 40px 0 44px; }
  .hero::before { background: linear-gradient(180deg, rgba(12, 32, 62, .88) 0%, rgba(18, 48, 90, .78) 100%); }
}
.hero h1 { color: #fff; font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0 0 12px; }
.hero p { font-size: 1.1rem; max-width: 620px; color: #dbe4f3; margin: 0 0 24px; }
.hero .acciones { display: flex; flex-wrap: wrap; gap: 12px; }
.seccion { padding: 48px 0; }
.seccion.gris { background: var(--gris-0); }
.seccion h2 { margin-top: 0; font-size: 1.6rem; }
.grilla { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.tarjeta { background: #fff; border: 1px solid var(--gris-1); border-radius: var(--radio); padding: 20px; box-shadow: var(--sombra); }
.tarjeta h3 { margin-top: 0; }
.foto { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radio); border: 1px solid var(--gris-1); box-shadow: var(--sombra); background: var(--gris-1); }
.dos-col { display: grid; gap: 28px; grid-template-columns: 1fr 1fr; align-items: center; }
.dos-col .pasos { margin: 0; grid-template-columns: 1fr; }
.fotos-convenio { display: grid; gap: 12px; grid-template-columns: 2fr 1fr; align-items: center; }
@media (max-width: 820px) { .dos-col { grid-template-columns: 1fr; gap: 20px; } }
.pasos { counter-reset: paso; list-style: none; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.pasos li { counter-increment: paso; background: #fff; border: 1px solid var(--gris-1); border-radius: var(--radio); padding: 16px 16px 16px 56px; position: relative; }
.pasos li::before { content: counter(paso); position: absolute; left: 14px; top: 14px; width: 30px; height: 30px; border-radius: 50%; background: var(--amarillo); color: var(--azul); font-weight: 800; display: grid; place-items: center; }
.contacto-lista { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.contacto-lista li { display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.contacto-lista strong { min-width: 90px; }
.etiqueta-ejemplo { font-size: .72rem; background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; border-radius: 999px; padding: 1px 8px; font-weight: 600; }
.pie { background: var(--azul); color: #cbd5e1; padding: 20px 0; font-size: .9rem; }
.pie a { color: #fff; }

/* Formularios */
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 4px; color: var(--gris-5); }
.campo { margin-bottom: 14px; }
.opcional { font-weight: 400; color: var(--gris-3); }
input, select, textarea {
  width: 100%; padding: 9px 11px; font-size: 1rem; font-family: inherit;
  border: 1px solid #cbd5e1; border-radius: 6px; background: #fff; color: var(--texto);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--azul-2); outline-offset: 0; border-color: var(--azul-2); }
textarea { min-height: 80px; resize: vertical; }
.fila { display: grid; gap: 0 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.check input { width: auto; }
.mensaje { padding: 10px 12px; border-radius: 6px; margin: 10px 0; font-size: .95rem; }
.mensaje.error { background: #fee2e2; color: var(--rojo); border: 1px solid #fecaca; }
.mensaje.ok { background: #dcfce7; color: var(--verde); border: 1px solid #bbf7d0; }
.ayuda { font-size: .85rem; color: var(--gris-5); }

/* Modal */
.modal-fondo { position: fixed; inset: 0; background: rgba(15, 23, 42, .55); display: grid; place-items: center; z-index: 100; padding: 16px; }
.modal { background: #fff; border-radius: 10px; width: 100%; max-width: 440px; max-height: 92vh; overflow: auto; padding: 22px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.modal h2 { margin: 0 0 6px; }
.modal-acciones { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; flex-wrap: wrap; }

/* Paneles internos */
.panel-cab { background: var(--gris-0); border-bottom: 1px solid var(--gris-1); padding: 14px 0; }
.panel-cab .contenedor { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.panel-cab h1 { font-size: 1.3rem; margin: 0; }
.caja { background: #fff; border: 1px solid var(--gris-1); border-radius: var(--radio); padding: 20px; margin: 20px 0; box-shadow: var(--sombra); }
.caja h2 { margin-top: 0; font-size: 1.25rem; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 2px solid var(--gris-1); margin-top: 16px; }
.tabs button { background: none; border: none; padding: 10px 14px; font-size: .95rem; font-weight: 600; color: var(--gris-5); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; font-family: inherit; }
.tabs button.activo { color: var(--azul); border-bottom-color: var(--amarillo); }
.contador { background: var(--rojo); color: #fff; border-radius: 999px; padding: 0 7px; font-size: .78rem; margin-left: 4px; }

/* Tablas */
.tabla-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--gris-1); vertical-align: top; }
th { background: var(--gris-0); color: var(--gris-5); font-weight: 600; white-space: nowrap; }
td.num, th.num { text-align: right; white-space: nowrap; }
tfoot td { font-weight: 700; background: var(--gris-0); }
.largo { max-width: 260px; white-space: pre-wrap; word-break: break-word; }

/* Estados */
.estado { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.estado-Pendiente { background: #fef3c7; color: #92400e; }
.estado-Tomada { background: #dbeafe; color: #1e40af; }
.estado-Realizada { background: #dcfce7; color: #166534; }
.estado-Rechazada { background: #fee2e2; color: #991b1b; }
.inactivo { color: var(--gris-3); }

/* Tarjetas de solicitudes */
.solicitudes { display: grid; gap: 12px; }
.sol { border: 1px solid var(--gris-1); border-left: 5px solid var(--gris-3); border-radius: var(--radio); padding: 14px; background: #fff; }
.sol.Pendiente { border-left-color: var(--amarillo); }
.sol.Tomada { border-left-color: var(--azul-2); }
.sol.Realizada { border-left-color: var(--verde); }
.sol.Rechazada { border-left-color: var(--rojo); }
.sol.nueva { animation: parpadeo 1s ease-in-out 4; }
@keyframes parpadeo { 50% { background: #fef9c3; } }
.sol-cab { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 6px; }
.sol-cab strong { font-size: 1.02rem; }
.sol dl { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; margin: 6px 0; font-size: .92rem; }
.sol dt { color: var(--gris-5); }
.sol dd { margin: 0; white-space: pre-wrap; word-break: break-word; }
.sol .respuesta { background: var(--gris-0); border-radius: 6px; padding: 8px 10px; margin-top: 8px; font-size: .92rem; }
.sol .acciones { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
@media (max-width: 520px) { .sol dl { grid-template-columns: 1fr; } .sol dt { margin-top: 4px; } }

.aviso-nuevas { background: var(--rojo); color: #fff; padding: 10px 14px; border-radius: var(--radio); margin-top: 16px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.barra { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.barra .campo { margin-bottom: 0; min-width: 160px; flex: 1; }
.resumen { display: flex; gap: 24px; flex-wrap: wrap; margin: 12px 0; font-size: 1.05rem; }
.vacio { color: var(--gris-5); padding: 16px 0; }
