/* Línea gráfica Gobernación de Santa Cruz — paleta tomada de salud.santacruz.gob.bo */
:root {
  --verde-950: #062315;
  --verde-900: #0d361e;
  --verde-800: #114526;
  --verde-700: #17592e;
  --verde-600: #1f6e3a;
  --verde-500: #3f8b4f;
  --verde-400: #5fa86d;
  --verde-200: #b8ddbd;
  --verde-100: #dbeedd;
  --verde-50: #f0f8f1;

  --emerald-700: #047857;
  --emerald-800: #065f46;
  --emerald-100: #d1fae5;
  --emerald-50: #ecfdf5;

  --sky-700: #0369a1;
  --sky-50: #f0f9ff;

  --slate-950: #0c1410;
  --slate-900: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50: #f8fafc;

  --texto: var(--slate-950);
  --gris: var(--slate-600);
  --gris-claro: var(--slate-100);
  --borde: var(--slate-200);
  --ok: var(--emerald-700);
  --err: #b3261e;

  --radio-tarjeta: 1.5rem;
  --radio-boton: 1rem;
  --radio: 12px;
  --sombra: 0 10px 30px rgba(15, 23, 42, 0.08);
  --sombra-alta: 0 18px 45px rgba(15, 23, 42, 0.14);
  --fuente: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--fuente);
  color: var(--texto);
  background: var(--slate-50);
  line-height: 1.55;
}

a { color: var(--verde-700); }

.topbar {
  background: var(--verde-800);
  color: #fff;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  padding: 0.55rem 1.25rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.topbar strong { color: var(--verde-200); font-weight: 600; }
.topbar a { color: #fff; }

header.principal {
  background:
    radial-gradient(1200px 320px at 12% -40%, rgba(95, 168, 109, 0.18), transparent 60%),
    radial-gradient(900px 280px at 92% -30%, rgba(3, 105, 161, 0.10), transparent 55%),
    var(--verde-50);
  color: var(--texto);
  padding: 2.2rem 1.25rem 2.6rem;
  border-bottom: 1px solid var(--verde-200);
}

header.principal .contenedor { max-width: 1080px; margin: 0 auto; }

.logo-institucional {
  height: 64px;
  width: auto;
  display: block;
  margin-bottom: 1.1rem;
}

.eyebrow {
  display: inline-block;
  background: #fff;
  border: 1px solid var(--verde-200);
  color: var(--verde-700);
  border-radius: 999px;
  padding: 0.25rem 0.85rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 1rem;
}

header.principal h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.45rem, 3.2vw, 2.15rem);
  line-height: 1.25;
  font-weight: 800;
  color: var(--slate-950);
  letter-spacing: -0.01em;
}

header.principal p.sub {
  margin: 0 0 1.5rem;
  max-width: 780px;
  color: var(--slate-600);
  font-size: 1.02rem;
}

header.principal p.sub strong, header.principal p.sub .destacado { color: var(--verde-700); }

.botones { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.boton {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 0;
  border-radius: var(--radio-boton);
  padding: 0.8rem 1.35rem;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}

.boton:hover { transform: translateY(-1px); box-shadow: var(--sombra); }

.boton-primario { background: var(--emerald-700); color: #fff; }
.boton-primario:hover { background: var(--emerald-800); }

.boton-secundario {
  background: #fff;
  color: var(--verde-800);
  border: 1.5px solid var(--verde-200);
}
.boton-secundario:hover { border-color: var(--verde-400); background: var(--verde-50); }

.boton-contorno {
  background: transparent;
  color: var(--verde-700);
  border: 1.5px solid var(--verde-400);
}
.boton-contorno:hover { background: var(--verde-50); border-color: var(--verde-600); }

.boton-verde { background: var(--verde-700); color: #fff; }
.boton-verde:hover { background: var(--verde-800); }

.boton-chico { padding: 0.45rem 0.9rem; font-size: 0.85rem; }

.contenedor { max-width: 1080px; margin: 0 auto; padding: 0 1.25rem; }

.tarjetas-fechas {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.9rem;
  margin: -1.6rem auto 2rem;
  position: relative;
}

.tarjeta {
  background: #fff;
  border: 1px solid var(--borde);
  border-radius: var(--radio-tarjeta);
  padding: 1.05rem 1.15rem;
  box-shadow: var(--sombra);
}

.tarjeta h3 { margin: 0 0 0.35rem; font-size: 0.92rem; color: var(--verde-700); font-weight: 700; }
.tarjeta p { margin: 0; font-size: 0.88rem; color: var(--gris); }

.seccion {
  background: #fff;
  border: 1px solid var(--borde);
  border-radius: var(--radio-tarjeta);
  padding: 1.5rem 1.6rem;
  margin-bottom: 1.15rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.seccion h2 {
  margin: 0 0 0.9rem;
  font-size: 1.12rem;
  color: var(--verde-800);
  font-weight: 800;
  border-left: 4px solid var(--verde-500);
  padding-left: 0.7rem;
}

.seccion h3 { font-size: 1rem; color: var(--verde-700); margin: 1.15rem 0 0.5rem; font-weight: 700; }

.seccion p { margin: 0.55rem 0; }

.seccion ul, .seccion ol { margin: 0.5rem 0 0.6rem 1.25rem; padding: 0; }
.seccion li { margin-bottom: 0.45rem; }

table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.85rem 0;
  font-size: 0.88rem;
  background: #fff;
}

th, td {
  border: 1px solid var(--borde);
  padding: 0.6rem 0.7rem;
  text-align: left;
  vertical-align: top;
}

th { background: var(--verde-50); color: var(--verde-800); font-weight: 700; }

tr:nth-child(even) td { background: var(--slate-50); }

.notas {
  background: var(--verde-50);
  border: 1px solid var(--verde-200);
  border-radius: var(--radio);
  padding: 0.9rem 1.15rem;
  margin-top: 1rem;
  font-size: 0.9rem;
}

.notas ul { margin: 0.35rem 0 0 1.15rem; padding: 0; }

/* ---------- formulario ---------- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 0.95rem;
}

.campo { display: flex; flex-direction: column; gap: 0.32rem; }
.campo.col-3 { grid-column: span 3; }
.campo.col-4 { grid-column: span 4; }
.campo.col-6 { grid-column: span 6; }
.campo.col-8 { grid-column: span 8; }
.campo.col-12 { grid-column: span 12; }

@media (max-width: 760px) {
  .campo.col-3, .campo.col-4, .campo.col-6, .campo.col-8 { grid-column: span 12; }
}

.campo label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--verde-800);
}

.campo label .req { color: var(--err); }

.campo input, .campo select, .campo textarea {
  border: 1.5px solid var(--slate-300);
  border-radius: var(--radio);
  padding: 0.62rem 0.75rem;
  font-size: 0.93rem;
  font-family: inherit;
  background: #fff;
  color: var(--texto);
}

.campo input:focus, .campo select:focus, .campo textarea:focus {
  outline: none;
  border-color: var(--verde-500);
  box-shadow: 0 0 0 3px rgba(63, 139, 79, 0.18);
}

.pista { font-size: 0.78rem; color: var(--gris); }

.filas-tabla input {
  width: 100%;
  border: 1.5px solid var(--slate-300);
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  font-size: 0.86rem;
}

.filas-tabla input:focus {
  outline: none;
  border-color: var(--verde-500);
  box-shadow: 0 0 0 2px rgba(63, 139, 79, 0.16);
}

.checkline {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--verde-200);
  border-radius: var(--radio);
  background: var(--verde-50);
}

.checkline input[type="checkbox"] { margin-top: 0.25rem; width: 1.05rem; height: 1.05rem; accent-color: var(--verde-600); }
.checkline .texto-check { font-size: 0.88rem; }
.checkline .doc { display: block; color: var(--gris); font-size: 0.8rem; margin-top: 0.25rem; }

.bloque-requisito {
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  padding: 0.95rem 1.05rem;
  margin-bottom: 0.8rem;
  background: #fff;
}

.bloque-requisito .fila-sup {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
}

.bloque-requisito .desc { flex: 1 1 380px; font-size: 0.9rem; }
.bloque-requisito .desc small { display: block; color: var(--gris); margin-top: 0.25rem; }

.subtabla { overflow-x: auto; }

.btn-agregar {
  background: var(--verde-50);
  border: 1.5px dashed var(--verde-400);
  color: var(--verde-700);
  border-radius: var(--radio);
  padding: 0.55rem 0.95rem;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.86rem;
}

.btn-agregar:hover { border-color: var(--verde-600); background: var(--verde-100); }

.alerta {
  border-radius: var(--radio);
  padding: 0.85rem 1rem;
  margin: 0.9rem 0;
  font-size: 0.92rem;
  display: none;
}

.alerta.visible { display: block; }
.alerta.ok { background: var(--emerald-50); color: var(--emerald-700); border: 1px solid var(--emerald-100); }
.alerta.err { background: #fdecea; color: var(--err); border: 1px solid #f3c2be; }

.foto-preview {
  width: 128px;
  height: 171px; /* 3x4 */
  object-fit: cover;
  border: 2px dashed var(--verde-200);
  border-radius: var(--radio);
  background: var(--verde-50);
}

/* ---------- modal ---------- */
.modal-fondo {
  position: fixed;
  inset: 0;
  background: rgba(6, 35, 21, 0.55);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
  z-index: 60;
  overflow-y: auto;
}

.modal-fondo.abierto { display: flex; }

.modal {
  background: #fff;
  border-radius: var(--radio-tarjeta);
  max-width: 920px;
  width: 100%;
  padding: 1.6rem 1.8rem 2rem;
  box-shadow: var(--sombra-alta);
  position: relative;
}

.modal .cerrar {
  position: absolute;
  top: 0.85rem;
  right: 1rem;
  background: var(--slate-100);
  border: 0;
  border-radius: 999px;
  width: 2.1rem;
  height: 2.1rem;
  font-size: 1.15rem;
  cursor: pointer;
  color: var(--verde-800);
}

.modal .cerrar:hover { background: var(--verde-100); }

.modal h2 { margin-top: 0; color: var(--verde-800); }

/* ---------- admin ---------- */
.login-caja {
  max-width: 420px;
  margin: 3.5rem auto;
  background: #fff;
  border: 1px solid var(--borde);
  border-radius: var(--radio-tarjeta);
  padding: 1.8rem;
  box-shadow: var(--sombra);
}

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 0.15rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.badge-azul { background: var(--sky-50); color: var(--sky-700); }
.badge-verde { background: var(--emerald-50); color: var(--emerald-700); }

.mini { font-size: 0.82rem; color: var(--gris); }

footer {
  margin-top: 2.5rem;
  padding: 1.6rem 1.25rem 2.2rem;
  color: var(--slate-500);
  font-size: 0.85rem;
  text-align: center;
  border-top: 1px solid var(--slate-200);
  background: #fff;
}

footer a { color: var(--verde-700); }

.indice-secciones {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0 1.25rem;
}

.indice-secciones a {
  background: #fff;
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
  text-decoration: none;
  color: var(--verde-700);
  border: 1px solid var(--verde-200);
  font-weight: 600;
}

.indice-secciones a:hover { background: var(--verde-50); border-color: var(--verde-400); }

@media print {
  .topbar, .botones, .btn-agregar, .modal-fondo, footer nav, .no-imprimir { display: none !important; }
  body { background: #fff; }
  .seccion, .tarjeta { box-shadow: none; border-color: #ccc; break-inside: avoid; }
}
