/* ============================================================
   Perfiles Joya · Checklist de cumplimiento
   ESTILO J (J-Mar) · EOSICA — préstamo a Hospital Joya
   ============================================================ */
:root {
  --navy-950: #10172B;
  --navy-900: #141C33;
  --navy-800: #1B2440;
  --navy-700: #2C3553;
  --navy-600: #3A4569;
  --ocean-600: #1F5C7E;
  --ocean-500: #2E7396;
  --cyan-400: #4FA8C4;
  --cyan-300: #7CC6DB;
  --cyan-100: #DCEFF6;
  --teal-600: #3E807D;
  --teal-500: #4E9D9A;
  --teal-400: #7FB6B4;
  --teal-100: #DDEEED;
  --teal-50: #EFF7F6;
  --coral-600: #D6553F;
  --coral-500: #EE6F58;
  --coral-100: #FCE8E3;
  --coral-50: #FEF3F0;
  --ink-900: #1C2536;
  --ink-700: #3C475F;
  --ink-500: #5D6981;
  --ink-400: #8290A6;
  --ink-300: #A9B4C6;
  --bg: #EDF3F6;
  --bg-deep: #E2EBF0;
  --card: #FFFFFF;
  --line: #DCE5EC;
  --line-soft: #E8EEF3;
  --shadow-sm: 0 1px 2px rgba(20, 28, 51, 0.06), 0 2px 8px rgba(20, 28, 51, 0.05);
  --shadow-md: 0 2px 6px rgba(20, 28, 51, 0.05), 0 12px 28px rgba(31, 92, 126, 0.10);
  --shadow-lg: 0 4px 10px rgba(20, 28, 51, 0.05), 0 24px 56px rgba(31, 92, 126, 0.14);
  --shadow-float: 0 12px 24px rgba(16, 23, 43, 0.22), 0 32px 80px rgba(16, 23, 43, 0.30);
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 24px;
  --wrap: 1840px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  letter-spacing: -0.002em;
  -webkit-font-smoothing: antialiased;
}

body {
  background: var(--bg);
  color: var(--ink-900);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.55;
}

button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input { font: inherit; }

.wrap { width: 96%; max-width: var(--wrap); margin: 0 auto; }
.wrap-narrow { width: 96%; max-width: 1280px; margin: 0 auto; }

/* ===== Hero navy ===== */
.hero-mar {
  position: relative;
  color: #fff;
  background:
    radial-gradient(1100px 540px at 86% -10%, rgba(79, 168, 196, 0.34), transparent 62%),
    radial-gradient(820px 460px at 8% 112%, rgba(127, 182, 180, 0.22), transparent 60%),
    linear-gradient(128deg, #10172B 0%, #182343 34%, #1E4063 66%, #2E7396 100%);
}
.trama-olas::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.05;
  pointer-events: none;
  background-image: repeating-radial-gradient(ellipse 180px 36px at 50% 120%, rgba(255, 255, 255, 0.9) 0 1px, transparent 1px 46px);
}
.hero-inner { position: relative; padding: 26px 0 118px; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 44px; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand img { height: 40px; display: block; }
.brand-pill {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #CFE7EF;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 8px 16px;
  border-radius: 999px;
  white-space: nowrap;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 12.5px;
  font-weight: 700;
  color: #9FD3DF;
  margin-bottom: 16px;
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, #7FB6B4, transparent);
}

.hero-h1 {
  font-size: clamp(30px, 3.6vw, 52px);
  font-weight: 300;
  letter-spacing: -0.025em;
  line-height: 1.12;
  max-width: 20ch;
}
.texto-marea {
  font-weight: 700;
  background: linear-gradient(92deg, #9FE0EC, #7FB6B4);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub {
  margin-top: 16px;
  font-size: 16px;
  color: #B9CFDC;
  max-width: 62ch;
  font-weight: 400;
}

/* Segmented control (sobre navy) */
.seg {
  margin-top: 30px;
  display: inline-flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.07);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 4px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.seg::-webkit-scrollbar { display: none; }
.seg button {
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: #C4D6E2;
  white-space: nowrap;
  transition: all 0.18s ease;
}
.seg button:hover { color: #fff; }
.seg button.on {
  background: linear-gradient(135deg, #7FB6B4, #4FA8C4);
  color: #0E2233;
  box-shadow: 0 4px 14px rgba(16, 23, 43, 0.35);
}

/* Stats glass */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 34px; }
.stat {
  position: relative;
  background: rgba(255, 255, 255, 0.075);
  border: 1px solid rgba(255, 255, 255, 0.13);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--r-lg);
  padding: 18px 20px 22px;
  transition: transform 0.18s ease;
  overflow: hidden;
}
.stat:hover { transform: translateY(-3px); }
.stat::after {
  content: "";
  position: absolute;
  left: 20px;
  bottom: 12px;
  width: 44px;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, #7FB6B4, #4FA8C4);
}
.stat.is-coral::after { background: linear-gradient(90deg, #EE6F58, #FFC9BC); }
.stat .num {
  font-size: 38px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.stat.is-coral .num { color: #FFC9BC; }
.stat .lbl { margin-top: 4px; font-size: 13px; font-weight: 600; color: #A9C4D2; }

/* ===== Ola separadora ===== */
.ola { position: absolute; left: 0; right: 0; bottom: -1px; height: 90px; pointer-events: none; }
.ola svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* ===== Cuerpo ===== */
.cuerpo { position: relative; padding: 0 0 90px; }
.overlap { margin-top: -46px; position: relative; z-index: 3; }

.card {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.card-xl {
  border-radius: var(--r-xl);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow-lg);
}

/* Toolbar */
.toolbar { padding: 18px 22px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.buscador { position: relative; flex: 1 1 260px; min-width: 220px; }
.buscador svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-400); }
.buscador input {
  width: 100%;
  padding: 11px 14px 11px 42px;
  border: 1.5px solid var(--line);
  background: var(--bg);
  border-radius: 12px;
  font-size: 14.5px;
  color: var(--ink-900);
  outline: none;
  transition: all 0.15s ease;
}
.buscador input:focus {
  border-color: var(--cyan-400);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(79, 168, 196, 0.14);
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-500);
  background: #fff;
  transition: all 0.15s ease;
}
.chip:hover { border-color: var(--cyan-400); color: var(--ocean-600); }
.chip.on { background: var(--navy-700); border-color: var(--navy-700); color: #fff; box-shadow: 0 4px 12px rgba(44, 53, 83, 0.30); }
.chip.chip-coral.on { background: var(--coral-500); border-color: var(--coral-500); }

.toolbar-sep { width: 1px; align-self: stretch; background: var(--line-soft); }

.btn-ghost {
  padding: 9px 16px;
  border-radius: 11px;
  border: 1.5px solid var(--line);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-500);
  background: #fff;
  transition: all 0.15s ease;
}
.btn-ghost:hover { border-color: var(--coral-500); color: var(--coral-600); }

/* Secciones */
.seccion { margin-top: 34px; }
.seccion-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 6px; }
.seccion-head h2 { font-size: 21px; font-weight: 700; letter-spacing: -0.015em; }
.seccion-head .cuenta { font-size: 13.5px; font-weight: 600; color: var(--ink-400); font-variant-numeric: tabular-nums; }
.seccion-desc { font-size: 14px; color: var(--ink-500); max-width: 86ch; margin-bottom: 14px; }
.barra { height: 6px; border-radius: 6px; background: var(--line-soft); overflow: hidden; margin: 10px 0 18px; }
.barra i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #7FB6B4, #4FA8C4); transition: width 0.35s ease; }

/* Grid de funciones */
.grid-fn { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(480px, 100%), 1fr)); gap: 16px; align-items: start; }

.fn-card { padding: 0; overflow: hidden; transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease; }
.fn-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: #CFE2EA; }
.fn-card.done { border-color: var(--teal-400); }
.fn-head { padding: 16px 18px 12px; display: flex; align-items: flex-start; gap: 12px; }
.fn-id {
  flex: none;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--ocean-600);
  background: var(--cyan-100);
  border-radius: 8px;
  padding: 5px 9px;
  margin-top: 1px;
}
.fn-card.done .fn-id { color: #226E63; background: var(--teal-100); }
.fn-titulo { font-size: 15.5px; font-weight: 700; letter-spacing: -0.01em; }
.fn-resumen { font-size: 13.5px; color: var(--ink-500); margin-top: 3px; }
.fn-mini { margin-left: auto; flex: none; font-size: 12.5px; font-weight: 700; color: var(--ink-400); font-variant-numeric: tabular-nums; }
.fn-card.done .fn-mini { color: var(--teal-600); }

.acts { border-top: 1px solid var(--line-soft); padding: 6px 8px 10px; }

.act {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  padding: 10px 10px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.12s ease;
  align-items: start;
}
.act:hover { background: var(--teal-50); }
.act input { position: absolute; opacity: 0; pointer-events: none; }
.cbx {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 2px solid var(--ink-300);
  background: #fff;
  display: grid;
  place-items: center;
  transition: all 0.15s ease;
  margin-top: 1px;
}
.cbx svg { opacity: 0; transform: scale(0.5); transition: all 0.15s ease; color: #0E2233; }
.act.ok .cbx {
  border-color: transparent;
  background: linear-gradient(135deg, #7FB6B4, #4FA8C4);
}
.act.ok .cbx svg { opacity: 1; transform: scale(1); }
.act-txt { font-size: 14px; font-weight: 500; color: var(--ink-700); }
.act.ok .act-txt { color: var(--ink-400); text-decoration: line-through; text-decoration-color: rgba(130, 144, 166, 0.55); }
.act-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 5px; }
.pill-frec {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 3px 10px;
  border-radius: 999px;
  background: #E5F1F8;
  color: #1D6A91;
}
.pill-frec::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #3193C2; }
.pill-frec.perm { background: #ECEFF3; color: var(--ink-500); }
.pill-frec.perm::before { background: var(--ink-400); }
.pill-frec.evento { background: var(--teal-100); color: #226E63; }
.pill-frec.evento::before { background: #34A08F; }
.act-evid { font-size: 12.5px; color: var(--ink-400); }
.act-evid b { font-weight: 700; color: var(--ink-500); }

/* Filas simples (conocimientos / habilidades / resultados) */
.grid-simple { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(420px, 100%), 1fr)); gap: 12px; }
.row-card { padding: 4px 8px; }
.row-card .act { align-items: start; }

/* ===== Flujos (línea de avance) ===== */
.leyenda { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; padding: 18px 22px; }
.leyenda .titulo { font-size: 15px; font-weight: 700; margin-right: 6px; }
.rol-tag { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink-700); }
.rol-dot { width: 14px; height: 14px; border-radius: 50%; }

.grupo-flujos { margin-top: 34px; }
.grid-flujos { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(560px, 100%), 1fr)); gap: 16px; align-items: start; }

.flujo { padding: 18px 20px 20px; transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease; }
.flujo:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: #CFE2EA; }
.flujo-head { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.flujo-head h3 { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.flujo-regla { font-size: 13px; color: var(--ink-500); margin-top: 4px; max-width: 70ch; }
.tag-decision {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--coral-100);
  color: var(--coral-600);
  margin-left: auto;
  white-space: nowrap;
}
.tag-decision::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--coral-500); }

.linea {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin-top: 16px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.nodo { flex: 1 1 0; min-width: 130px; position: relative; text-align: center; padding: 0 8px; }
.nodo-ava {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: 0 auto;
  color: #fff;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.03em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 4px 10px rgba(20, 28, 51, 0.18);
  position: relative;
  z-index: 2;
}
.nodo::before, .nodo::after {
  content: "";
  position: absolute;
  top: 19px;
  height: 2px;
  background: var(--line);
  width: 50%;
  z-index: 1;
}
.nodo::before { left: 0; }
.nodo::after { right: 0; }
.nodo:first-child::before { display: none; }
.nodo:last-child::after { display: none; }
.nodo:not(:first-child) .nodo-ava::before {
  content: "";
  position: absolute;
  left: -26px;
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-left: 7px solid var(--ink-300);
}
.nodo-verbo { margin-top: 8px; font-size: 13.5px; font-weight: 800; letter-spacing: -0.01em; }
.nodo-det { margin-top: 2px; font-size: 12px; color: var(--ink-500); line-height: 1.45; }

.rol-ch .nodo-ava, .rol-dot.rol-ch { background: linear-gradient(135deg, #7FB6B4, #4E9D9A); }
.rol-sdm .nodo-ava, .rol-dot.rol-sdm { background: linear-gradient(135deg, #4FA8C4, #2E7396); }
.rol-dm .nodo-ava, .rol-dot.rol-dm { background: linear-gradient(135deg, #3A4569, #141C33); }
.rol-otro .nodo-ava, .rol-dot.rol-otro { background: linear-gradient(135deg, #A9B4C6, #8290A6); }
.rol-ch .nodo-verbo { color: var(--teal-600); }
.rol-sdm .nodo-verbo { color: var(--ocean-600); }
.rol-dm .nodo-verbo { color: var(--navy-700); }
.rol-otro .nodo-verbo { color: var(--ink-500); }

.flujo-fuente { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line-soft); font-size: 12px; color: var(--ink-400); }

/* Escalamiento (niveles con umbral) */
.flujo-esc .nodo { min-width: 170px; }
.nivel-pill {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  background: #ECEFF3;
  color: var(--ink-500);
  margin-bottom: 6px;
}

/* ===== Footer ===== */
.footer-mar {
  position: relative;
  margin-top: 80px;
  color: #fff;
  background: linear-gradient(120deg, #10172B, #1B2E51 60%, #1F4A6B);
  padding: 100px 0 34px;
}
.ola-footer { position: absolute; left: 0; right: 0; top: -1px; height: 90px; transform: scaleY(-1); pointer-events: none; }
.ola-footer svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.footer-grid { display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; align-items: flex-start; }
.footer-grid img { height: 34px; }
.footer-txt { font-size: 13px; color: #A9C4D2; max-width: 52ch; }
.microfooter {
  margin-top: 40px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.3em;
  color: #7E97AC;
  text-align: center;
  text-transform: uppercase;
}

/* Vacío */
.vacio { padding: 46px 20px; text-align: center; color: var(--ink-400); font-size: 14.5px; }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%) translateY(80px);
  background: rgba(20, 28, 51, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: 999px;
  box-shadow: var(--shadow-float);
  opacity: 0;
  transition: all 0.25s ease;
  z-index: 60;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-inner { padding-bottom: 104px; }
  .topbar { margin-bottom: 30px; }
  .brand-pill { display: none; }
}
@media (max-width: 620px) {
  .linea { flex-direction: column; gap: 14px; }
  .nodo { text-align: left; display: grid; grid-template-columns: 38px 1fr; gap: 4px 14px; min-width: 0; padding: 0; }
  .nodo-ava { margin: 0; grid-row: 1 / 3; }
  .nodo::before, .nodo::after { display: none; }
  .nodo:not(:first-child) .nodo-ava::before { display: none; }
  .nodo-verbo { margin-top: 0; align-self: end; }
}
