:root {
  --primary: #2f7a4a;        /* verde hoja */
  --primary-dark: #1f5a35;
  --primary-soft: #e4f1e8;   /* fondos suaves */
  --primary-line: #b9dcc4;   /* bordes y foco */
  --ink: #1a1f2b;
  --muted: #5d6475;
  --bg: #f5f6fa;
  --card: #ffffff;
  --line: #e3e6ee;
  --ok: #15803d;
  --ok-bg: #e8f7ee;
  --bad: #b91c1c;
  --bad-bg: #fdecec;
  --yellow: #f5b800;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(20, 28, 50, .08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', system-ui, sans-serif; color: var(--ink); background: var(--bg); line-height: 1.55; }
button, select, input { font: inherit; }
a { color: inherit; text-decoration: none; }

.container { width: min(1120px, 92%); margin: 0 auto; }
.narrow { width: min(760px, 92%); }
.center { text-align: center; justify-content: center; }
.muted { color: var(--muted); }

/* Topbar */
.topbar { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar__inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .55rem; font-size: 1.15rem; }
.brand strong { color: var(--primary); }
.brand__logo { width: 34px; height: 34px; border-radius: 9px; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 800; }
.nav { display: flex; gap: 1.4rem; font-weight: 500; font-size: .95rem; }
.nav a:hover { color: var(--primary); }

/* Buttons */
.btn { border: 0; border-radius: 10px; padding: .7rem 1.2rem; font-weight: 600; cursor: pointer; transition: .15s; }
.btn--lg { padding: .9rem 1.5rem; font-size: 1.02rem; }
.btn--block { width: 100%; margin-top: 1rem; }
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-dark); }
.btn--ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn--ghost:hover { border-color: var(--ink); }
.btn--danger { background: transparent; color: var(--bad); border: 1px solid var(--bad); margin-top: 1.5rem; }
.btn:disabled { opacity: .4; cursor: not-allowed; }

/* Views */
.view { display: none; padding-bottom: 4rem; }
.view.active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; } }

/* Hero */
.hero { background: linear-gradient(135deg, #fff 0%, #eaf5ed 100%); border-bottom: 1px solid var(--line); margin-bottom: 3rem; }
.hero__inner { display: grid; grid-template-columns: 1.15fr 1fr; gap: 3rem; align-items: center; padding: 4rem 0; }
.pill { display: inline-block; background: var(--primary-soft); color: var(--primary); font-weight: 600; font-size: .82rem; padding: .3rem .8rem; border-radius: 99px; margin-bottom: 1rem; }
.hero h1 { font-size: clamp(2rem, 4vw, 3rem); line-height: 1.12; font-weight: 800; letter-spacing: -.02em; }
.hl { color: var(--primary); }
.hero p { margin: 1rem 0 1.6rem; color: var(--muted); font-size: 1.08rem; max-width: 34rem; }
.hero__cta { display: flex; gap: .8rem; flex-wrap: wrap; }
.hero__stats { list-style: none; display: flex; gap: 2.2rem; margin-top: 2rem; }
.hero__stats strong { display: block; font-size: 1.8rem; font-weight: 800; }
.hero__stats span { color: var(--muted); font-size: .88rem; }

.mock { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem; border: 1px solid var(--line); transform: rotate(1.5deg); }
.mock__head { display: flex; justify-content: space-between; font-size: .85rem; color: var(--muted); }
.mock__time { color: var(--primary); font-weight: 700; }
.mock__bar { height: 6px; background: var(--line); border-radius: 9px; margin: .7rem 0 1rem; }
.mock__bar i { display: block; height: 100%; background: var(--primary); border-radius: 9px; }
.mock__q { font-weight: 600; margin-bottom: .8rem; }
.mock__opt { border: 1px solid var(--line); border-radius: 9px; padding: .55rem .8rem; margin-bottom: .45rem; font-size: .92rem; }
.mock__opt--ok { border-color: var(--ok); background: var(--ok-bg); color: var(--ok); font-weight: 600; }

/* Cards */
.section-title { font-size: 1.5rem; font-weight: 800; margin: 2rem 0 1.2rem; letter-spacing: -.01em; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1.2rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; cursor: pointer; transition: .2s; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: transparent; }
.card__icon { font-size: 2rem; margin-bottom: .6rem; }
.card h3 { font-size: 1.08rem; margin-bottom: .4rem; }
.card p { color: var(--muted); font-size: .92rem; margin-bottom: .9rem; }
.card__link { color: var(--primary); font-weight: 600; font-size: .92rem; }

.info { display: grid; grid-template-columns: 1.3fr 1fr; gap: 2rem; margin-top: 2rem; }
.checklist { list-style: none; }
.checklist li { padding: .55rem 0 .55rem 2rem; position: relative; border-bottom: 1px dashed var(--line); }
.checklist li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 800; }
.tips { background: #fff8e1; border: 1px solid #f7e2a1; border-radius: var(--radius); padding: 1.5rem; margin-top: 2rem; }
.tips h3 { margin-bottom: .5rem; }
.hist { margin-top: 1rem; font-size: .9rem; }
.hist li { list-style: none; display: flex; justify-content: space-between; padding: .3rem 0; border-top: 1px solid #f1dc9b; }

/* Panel / forms */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow); margin-top: 2.5rem; }
.panel h2 { font-size: 1.5rem; margin-bottom: .4rem; }
.field { display: block; margin-top: 1.4rem; }
.field span { display: block; font-weight: 600; margin-bottom: .4rem; }
.field select, .search { width: 100%; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.check { display: flex; gap: .6rem; align-items: center; margin-top: 1rem; cursor: pointer; }

/* Exam */
.exam-head { display: flex; justify-content: space-between; align-items: center; margin-top: 2rem; font-weight: 600; }
.timer { background: var(--ink); color: #fff; padding: .35rem .9rem; border-radius: 8px; font-variant-numeric: tabular-nums; }
.timer.warn { background: var(--bad); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .6; } }
.bar { height: 8px; background: var(--line); border-radius: 9px; margin-top: .8rem; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--primary); transition: width .3s; }
.question { margin-top: 1.2rem; }
.question h2 { font-size: 1.25rem; line-height: 1.4; margin-bottom: 1.3rem; }
.q-img:empty { display: none; }
.q-img { display: flex; justify-content: center; margin-bottom: 1.2rem; }
.q-img svg { width: 120px; height: 120px; }
.options { display: grid; gap: .6rem; }
.opt { text-align: left; background: #fff; border: 2px solid var(--line); border-radius: 10px; padding: .85rem 1rem; cursor: pointer; display: flex; gap: .8rem; align-items: flex-start; transition: .12s; }
.opt:hover:not(:disabled) { border-color: #b8bdcc; }
.opt__l { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--bg); display: grid; place-items: center; font-weight: 700; font-size: .85rem; }
.opt.sel { border-color: var(--ink); background: #f1f3f6; }
.opt.sel .opt__l { background: var(--ink); color: #fff; }
.opt.ok { border-color: var(--ok); background: var(--ok-bg); }
.opt.ok .opt__l { background: var(--ok); color: #fff; }
.opt.bad { border-color: var(--bad); background: var(--bad-bg); }
.opt.bad .opt__l { background: var(--bad); color: #fff; }
.opt:disabled { cursor: default; }
.feedback:empty { display: none; }
.feedback { margin-top: 1rem; padding: .9rem 1rem; border-radius: 10px; background: #eef3ff; font-size: .95rem; }
.exam-nav { display: flex; justify-content: space-between; margin-top: 1.2rem; }
.grid-nav { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: .4rem; margin-top: 1.8rem; }
.grid-nav button { aspect-ratio: 1; border: 1px solid var(--line); background: #fff; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: .85rem; }
.grid-nav button.done { background: var(--primary-soft); border-color: var(--primary-line); }
.grid-nav button.cur { outline: 2px solid var(--primary); }
.grid-nav button.ok { background: var(--ok-bg); border-color: var(--ok); }
.grid-nav button.bad { background: var(--bad-bg); border-color: var(--bad); }

/* Result */
.result { text-align: center; }
.res-badge { font-size: 3.5rem; }
.res-score { font-size: 2.6rem; font-weight: 800; margin: .3rem 0; }
.result .hero__cta { margin-top: 1.5rem; }
.review { background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--ok); border-radius: 10px; padding: 1rem 1.2rem; margin-bottom: .8rem; }
.review.bad { border-left-color: var(--bad); }
.review h4 { margin-bottom: .4rem; }
.review p { font-size: .93rem; }
.review .yours { color: var(--bad); }
.review .right { color: var(--ok); font-weight: 600; }
.review .why { color: var(--muted); margin-top: .3rem; }

/* Study */
.search { margin-bottom: 1.2rem; }
.study { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.2rem; margin-bottom: .7rem; }
.study summary { cursor: pointer; font-weight: 600; }
.study p { margin-top: .6rem; }
.study .right { color: var(--ok); font-weight: 600; }

/* Signs */
.signs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; margin-top: 1.5rem; }
.sign-group { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; }
.sign-group h3 { margin-bottom: .3rem; }
.sign-group > p { color: var(--muted); font-size: .92rem; margin-bottom: 1rem; }
.sign { display: flex; gap: 1rem; align-items: center; padding: .6rem 0; border-top: 1px solid var(--line); }
.sign svg { width: 56px; height: 56px; flex: none; }

/* Footer */
.footer { background: var(--ink); color: #c9cedb; padding: 2.5rem 0; font-size: .9rem; }
.footer strong { color: #fff; font-size: 1.05rem; }
.footer__inner { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.disclaimer { font-size: .82rem; opacity: .8; }

@media (max-width: 900px) {
  .hero__inner, .info, .footer__inner { grid-template-columns: 1fr; }
  .hero__card { display: none; }
  .cards, .signs { grid-template-columns: 1fr 1fr; }
  .nav { display: none; }
}
@media (max-width: 560px) {
  .cards, .signs { grid-template-columns: 1fr; }
  .panel { padding: 1.4rem; }
}

/* Categorías */
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.cat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; cursor: pointer; transition: .2s; }
.cat-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.cat-card__id { display: inline-block; font-weight: 800; font-size: 1.15rem; }
.cat-card__clase { float: right; font-size: .72rem; font-weight: 700; padding: .15rem .5rem; border-radius: 99px; background: var(--primary-soft); color: var(--primary); }
.cat-card__clase.b { background: #e3ecff; color: #1d4ed8; }
.cat-card p { color: var(--muted); font-size: .88rem; margin-top: .35rem; }
.cat-pick { display: flex; flex-wrap: wrap; gap: .5rem; }
.cat-pick button { border: 2px solid var(--line); background: #fff; border-radius: 9px; padding: .5rem .9rem; font-weight: 700; cursor: pointer; }
.cat-pick button.sel { border-color: var(--primary); background: var(--primary); color: #fff; }
.cat-pick .sep { flex-basis: 100%; height: 0; }
.cat-desc { margin-top: .6rem; font-size: .92rem; color: var(--muted); }
.cat-tag { background: var(--ink); color: #fff; font-size: .78rem; padding: .2rem .55rem; border-radius: 6px; margin-right: .4rem; }
.tema { display: inline-block; font-size: .72rem; font-weight: 600; color: var(--muted); background: var(--bg); padding: .1rem .5rem; border-radius: 99px; margin-left: .4rem; }
.study-tools { display: grid; grid-template-columns: 1fr 220px; gap: .7rem; }
@media (max-width: 560px) { .study-tools { grid-template-columns: 1fr; } }

/* Imágenes del balotario */
.q-img img, .q-imgs img { max-width: 100%; max-height: 260px; object-fit: contain; }
.q-imgs { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: center; }
.q-imgs--sm img { max-height: 160px; }
.study .q-imgs, .review .q-imgs { justify-content: flex-start; margin: .6rem 0; }
.opt__body { display: flex; flex-direction: column; gap: .4rem; }
.opt-imgs { display: flex; gap: .5rem; }
.opt-imgs img { max-height: 110px; max-width: 220px; object-fit: contain; border-radius: 6px; background: #fff; }
.tema--q { margin: 0 0 .6rem; }
.study-opts { list-style: none; margin-top: .7rem; display: grid; gap: .3rem; }
.study-opts li { padding: .35rem .6rem; border-radius: 8px; font-size: .94rem; }
.study-opts li.right { background: var(--ok-bg); color: var(--ok); font-weight: 600; }
.study-opts .opt-imgs { margin-top: .3rem; }
.study-tools { grid-template-columns: 1fr 190px 190px; }
.cat-card__meta { font-size: .78rem !important; color: var(--primary) !important; font-weight: 600; }
#study-more { margin-top: .6rem; }
@media (max-width: 700px) { .study-tools { grid-template-columns: 1fr; } }
.opt:disabled { color: var(--ink); opacity: 1; }

/* ---------- Acceso y administración ---------- */
.auth { max-width: 460px; margin: 3rem auto; }
.auth__alt { text-align: center; margin-top: 1.2rem; color: var(--muted); }
.auth__alt a, .footer a { color: var(--primary); font-weight: 600; }
.field input, .field select { width: 100%; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.field input:focus, .field select:focus, .search:focus { outline: 2px solid var(--primary-line); border-color: var(--primary); }
.alert { padding: .85rem 1rem; border-radius: 10px; margin: 1rem 0; font-size: .95rem; }
.alert--ok { background: var(--ok-bg); color: var(--ok); border: 1px solid #b7e4c7; }
.alert--error { background: var(--bad-bg); color: var(--bad); border: 1px solid #f5c2c2; }
.inline { display: inline; }
.link-btn { background: none; border: 0; color: var(--ink); font: inherit; font-weight: 500; cursor: pointer; padding: 0; }
.link-btn:hover { color: var(--primary); }
.nav { align-items: center; }
.user-chip { background: var(--bg); border: 1px solid var(--line); border-radius: 99px; padding: .25rem .8rem; font-size: .85rem; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav--user { display: flex; }

.tabs { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1rem; }
.tab { padding: .5rem 1rem; border-radius: 99px; border: 1px solid var(--line); background: #fff; font-weight: 600; font-size: .9rem; }
.tab--sel { background: var(--ink); color: #fff; border-color: var(--ink); }
.tabs__search { margin-left: auto; min-width: 260px; }
.tabs__search .search { margin: 0; }
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.tabla { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tabla th { text-align: left; background: var(--bg); padding: .7rem 1rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.tabla td { padding: .8rem 1rem; border-top: 1px solid var(--line); vertical-align: top; }
.nowrap { white-space: nowrap; }
.acciones { display: flex; flex-wrap: wrap; gap: .35rem; align-items: flex-start; }
.btn--sm { padding: .4rem .75rem; font-size: .82rem; border-radius: 8px; }
.btn--danger-sm { background: transparent; color: var(--bad); border: 1px solid #f0b4b4; }
.btn--danger-sm:hover { background: var(--bad-bg); }
.badge { display: inline-block; font-size: .78rem; font-weight: 700; padding: .2rem .6rem; border-radius: 99px; }
.badge--ok { background: var(--ok-bg); color: var(--ok); }
.badge--wait { background: #fff4d6; color: #8a5a00; }
.mini { position: relative; }
.mini summary { list-style: none; display: inline-block; }
.mini summary::-webkit-details-marker { display: none; }
.mini__form { position: absolute; z-index: 5; right: 0; top: 2.2rem; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 10px; padding: .6rem; display: flex; gap: .4rem; }
.mini__form input { padding: .45rem .6rem; border: 1px solid var(--line); border-radius: 8px; width: 180px; }
.crear summary { cursor: pointer; }
.crear__form { display: grid; grid-template-columns: repeat(4, 1fr) auto; gap: .8rem; align-items: end; }
.crear__form .field { margin-top: .8rem; }
@media (max-width: 900px) {
  .crear__form { grid-template-columns: 1fr; }
  .nav--user { display: flex; gap: .8rem; font-size: .88rem; }
  .tabs__search { margin-left: 0; width: 100%; }
}

/* ---------- Acceso / pago ---------- */
.acceso-banner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: .9rem 1.2rem; border-radius: var(--radius); margin-top: -1rem; border: 1px solid var(--line); background: #fff; }
.acceso-banner:empty { display: none; }
.acceso-banner--ok { background: var(--ok-bg); border-color: #b7e4c7; color: #14532d; }
.acceso-banner--free { background: #eef3ff; border-color: #c9d8ff; color: #1e3a8a; }
.acceso-banner--lock { background: #fff8e1; border-color: #f7e2a1; color: #713f12; }
.cfg-nota:empty, .cfg-error:empty { display: none; }
.cfg-nota { margin-top: 1rem; font-size: .92rem; background: #eef3ff; color: #1e3a8a; padding: .7rem .9rem; border-radius: 10px; }
.cfg-error { margin-top: .8rem; color: var(--bad); font-weight: 600; }

.modal { position: fixed; inset: 0; z-index: 100; background: rgba(15, 20, 35, .55); display: grid; place-items: center; padding: 1rem; animation: fade .15s ease; }
.modal[hidden] { display: none; }
.modal__box { position: relative; background: #fff; border-radius: 18px; padding: 2rem 1.8rem 1.6rem; width: min(480px, 100%); max-height: calc(100vh - 2rem); overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.25); text-align: center; }
.modal__box h2 { font-size: 1.35rem; margin: .3rem 0 .4rem; }
.modal__icon { font-size: 2.4rem; }
.modal__close { position: absolute; top: .6rem; right: .8rem; background: none; border: 0; font-size: 1.8rem; line-height: 1; color: var(--muted); cursor: pointer; }
.modal__acciones { display: flex; gap: .7rem; justify-content: center; margin-top: 1.3rem; }
.modal__nota { font-size: .82rem; color: var(--muted); margin-top: .9rem; }
.pago-precio { margin: 1.2rem auto; padding: 1rem; border-radius: 14px; background: linear-gradient(135deg, #742284, #9b2fae); color: #fff; }
.pago-precio span, .pago-precio small { display: block; font-size: .85rem; opacity: .9; }
.pago-precio strong { display: block; font-size: 2.2rem; font-weight: 800; line-height: 1.2; }
.pago-beneficios { list-style: none; text-align: left; margin: 0 0 1rem; font-size: .92rem; }
.pago-beneficios li { padding: .25rem 0 .25rem 1.6rem; position: relative; }
.pago-beneficios li::before { content: "✓"; position: absolute; left: .2rem; color: var(--ok); font-weight: 800; }
.pago-pasos { text-align: left; margin: 0 0 1.2rem 1.2rem; font-size: .92rem; display: grid; gap: .45rem; }
.yape-num { color: #742284; letter-spacing: .03em; }
.btn--wa { background: #25d366; color: #fff; display: flex; align-items: center; justify-content: center; gap: .55rem; text-decoration: none; }
.btn--wa:hover { background: #1ebe5b; }

/* admin */
.admin-ayuda { margin: -.6rem 0 1rem; }
.badge { background: var(--bg); color: var(--muted); }
.badge--bad { background: var(--bad-bg); color: var(--bad); }
.crear__form .check { margin-top: 0; padding-bottom: .8rem; }
.crear__form { grid-template-columns: repeat(4, 1fr) auto auto; }
.reenviar { margin-top: 1.2rem; text-align: left; }
.alert code { font-size: .85em; }

/* ficha de usuario (admin) */
.volver { margin: 1.2rem 0 -.6rem; }
.ficha { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; margin-bottom: 1.2rem; }
@media (max-width: 860px) { .ficha { grid-template-columns: 1fr; } }
.ficha .panel h3, section.panel h3 { margin: 0 0 .8rem; }
section.panel { margin-bottom: 1.2rem; }
.ficha__estado { margin-bottom: .6rem; }
.ficha__form { border-top: 1px solid var(--line); padding-top: 1rem; margin-top: 1rem; }
.ficha__form h4 { margin: 0 0 .6rem; font-size: 1rem; }
.ficha__form .field { margin-bottom: .7rem; }
.fila { display: flex; gap: .7rem; align-items: flex-end; flex-wrap: wrap; }
.fila .field { flex: 1; min-width: 120px; }
.fila .btn { margin-bottom: .7rem; }
.ficha__acciones { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }
.ficha__datos { display: grid; grid-template-columns: auto 1fr; gap: .3rem 1rem; margin: 1rem 0; font-size: .92rem; }
.ficha__datos dt { color: var(--muted); }
.ficha__datos dd { margin: 0; }
.resumen-pagos { display: flex; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.resumen-pagos div { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1.2rem; min-width: 180px; }
.resumen-pagos span, .resumen-pagos small { display: block; color: var(--muted); font-size: .85rem; }
.resumen-pagos strong { font-size: 1.5rem; }

/* ---------- Mi progreso ---------- */
:root { --dato: #2f6fdb; --dato-track: #e6eefc; --warn: #b45309; }
.prog-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.prog-head .section-title { margin-bottom: .2rem; }
.prog-cat { min-width: 200px; margin: 0; }
#view-progreso .panel { margin-bottom: 1.2rem; }
#view-progreso h3 { font-size: 1.05rem; margin-bottom: .3rem; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; margin-bottom: 1.2rem; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; display: flex; flex-direction: column; gap: .15rem; }
.kpi__label { font-size: .85rem; color: var(--muted); }
.kpi__valor { font-size: 1.9rem; font-weight: 700; line-height: 1.2; }
.kpi__sub { font-size: .85rem; color: var(--muted); }
.kpi__sub a, .vacio a { color: var(--primary); font-weight: 600; }
.prog-grid { display: grid; grid-template-columns: minmax(260px, 1fr) 2fr; gap: 1.2rem; }
@media (max-width: 860px) { .prog-grid { grid-template-columns: 1fr; } }
.prob__cifra { font-size: 3.6rem; font-weight: 700; line-height: 1.1; margin: .6rem 0 .2rem; }
.prob__cifra small { font-size: 1.6rem; font-weight: 600; color: var(--muted); }
.prob__cifra--vacia { color: var(--muted); }
.prob__nota { font-size: .88rem; margin-top: .8rem; }
.estado { font-weight: 600; margin-bottom: .7rem; }
.medidor { height: 12px; border-radius: 999px; overflow: hidden; }
.medidor:has(.medidor__fill--ok) { background: #dcf3e4; }
.medidor:has(.medidor__fill--warn) { background: #fdf0d5; }
.medidor:has(.medidor__fill--bad) { background: #fbe1e1; }
.medidor__fill { height: 100%; border-radius: 999px; min-width: 6px; }
.medidor__fill--ok { background: var(--ok); }
.medidor__fill--warn { background: #d97706; }
.medidor__fill--bad { background: var(--bad); }
.evol__sub { font-size: .85rem; margin-bottom: .6rem; }
.grafico { position: relative; }
.graf-svg { width: 100%; height: auto; display: block; overflow: visible; touch-action: pan-y; }
.graf-grid { stroke: var(--line); stroke-width: 1; }
.graf-meta { stroke: #8a91a2; stroke-width: 1.5; }
.graf-eje { font-size: 11px; fill: var(--muted); }
.graf-valor { font-size: 12px; font-weight: 700; fill: var(--ink); }
.graf-linea { fill: none; stroke: var(--dato); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.graf-punto { fill: var(--dato); stroke: #fff; stroke-width: 2; }
.graf-hit { fill: transparent; cursor: pointer; outline: none; }
.graf-hit:focus-visible { stroke: var(--ink); stroke-width: 1.5; }
.graf-cruz { stroke: #b8bfcc; stroke-width: 1; pointer-events: none; }
.graf-tip { position: absolute; pointer-events: none; background: var(--ink); color: #fff; font-size: .8rem; padding: .45rem .65rem; border-radius: 8px; white-space: nowrap; box-shadow: var(--shadow); }
.graf-tip span { color: #c9cedb; }
.tabla-datos { margin-top: .8rem; font-size: .88rem; }
.tabla-datos summary { cursor: pointer; color: var(--muted); }
.tabla-datos .tabla { margin-top: .6rem; }
.vacio { color: var(--muted); padding: 1.2rem 0; }
.temas { display: grid; gap: .9rem; margin-top: .6rem; }
.tema-fila { display: grid; grid-template-columns: minmax(180px, 2fr) 3fr 110px; gap: 1rem; align-items: center; }
.tema-fila__nombre { font-weight: 600; font-size: .93rem; }
.tema-fila__nombre small { display: block; font-weight: 400; color: var(--muted); font-size: .8rem; }
.tema-fila__valor { font-weight: 700; font-variant-numeric: tabular-nums; }
.tema-fila__aviso { display: block; font-size: .78rem; font-weight: 600; color: var(--warn); }
.barra { position: relative; height: 10px; background: var(--dato-track); border-radius: 999px; }
.barra__fill { height: 100%; background: var(--dato); border-radius: 999px; }
.barra__meta { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); border-radius: 1px; }
@media (max-width: 640px) {
  .tema-fila { grid-template-columns: 1fr auto; }
  .tema-fila .barra { grid-column: 1 / -1; grid-row: 2; }
}
.recs { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; margin-top: .6rem; }
.rec { border: 1px solid var(--line); border-radius: 12px; padding: 1rem; display: flex; flex-direction: column; gap: .5rem; }
.rec h4 { font-size: .98rem; }
.rec p { font-size: .88rem; flex: 1; }
.rec .btn { align-self: flex-start; }
.rec__nota { font-size: .82rem; margin-top: .8rem; }
