/* NEX CHURCH AI — sistema visual: azul marino, blanco, dorado moderado, verde suave */
:root {
  --navy: #0f1f3d;
  --navy-2: #1a2f57;
  --gold: #b8913a;
  --gold-soft: #f6efdd;
  --green: #3f8f68;
  --green-soft: #e3f2ea;
  --red: #b4443c;
  --red-soft: #fbe9e7;
  --blue-soft: #e6eefb;
  --blue: #2c5aa0;
  --bg: #f5f6f9;
  --surface: #ffffff;
  --surface-2: #f0f2f6;
  --text: #16203a;
  --muted: #5d6680;
  --border: #dde1ea;
  --focus: #c9a24a;
  --link: #2c5aa0;
  --shadow: 0 1px 2px rgba(15, 31, 61, .06), 0 4px 16px rgba(15, 31, 61, .05);
  --radius: 14px;
  --sidebar: var(--navy);
  --sidebar-text: #d7deec;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1426; --surface: #13203a; --surface-2: #1a2a49; --text: #e8ecf5; --muted: #9aa5bf; --border: #26375a;
    --gold-soft: #3a311c; --green-soft: #17352a; --red-soft: #3d1f1d; --blue-soft: #1b2b4b; --sidebar: #08101f; --link: #9cc0ff; --blue: #9cc0ff;
    --shadow: 0 1px 2px rgba(0,0,0,.3); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1426; --surface: #13203a; --surface-2: #1a2a49; --text: #e8ecf5; --muted: #9aa5bf; --border: #26375a;
  --gold-soft: #3a311c; --green-soft: #17352a; --red-soft: #3d1f1d; --blue-soft: #1b2b4b; --sidebar: #08101f; --link: #9cc0ff; --blue: #9cc0ff;
  --shadow: 0 1px 2px rgba(0,0,0,.3); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; }
h1 { font-size: 1.6rem; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; margin: 0 0 .8rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.block { display: block; }
.icon { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.boot { display: grid; place-items: center; height: 100vh; color: var(--muted); letter-spacing: .2em; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 42px; padding: 0 1rem; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--gold); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--navy); border-color: var(--navy); color: #fff; }
:root[data-theme="dark"] .btn-primary { background: var(--gold); border-color: var(--gold); color: #10182b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-primary { background: var(--gold); border-color: var(--gold); color: #10182b; } }
.btn-primary:hover { filter: brightness(1.12); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-sm { min-height: 34px; padding: 0 .75rem; font-size: .88rem; }
.btn-block { width: 100%; }
.btn-icon { background: none; border: 0; color: inherit; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; cursor: pointer; }
.btn-icon:hover { background: var(--surface-2); }

/* ---------- Estructura ---------- */
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.demo-banner { background: var(--gold); color: #1b1407; text-align: center; font-weight: 700; font-size: .8rem; letter-spacing: .06em; padding: .35rem; }
.topbar { display: none; }
.body { display: flex; flex: 1; min-height: 0; }
.sidebar {
  width: 260px; flex: none; background: var(--sidebar); color: var(--sidebar-text);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 1rem .75rem;
}
.brand { display: flex; align-items: center; gap: .7rem; color: #fff; padding: .4rem .5rem 1.2rem; }
.brand strong { display: block; font-size: .95rem; letter-spacing: .04em; }
.brand small { display: block; color: #9eabc6; font-size: .75rem; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-mark { width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(135deg, var(--gold), #e2c47c); color: var(--navy); display: grid; place-items: center; font-weight: 800; font-size: 1.15rem; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: .7rem; padding: .55rem .7rem; border-radius: 10px; color: var(--sidebar-text);
  font: inherit; font-size: .93rem; background: none; border: 0; cursor: pointer; text-align: left; width: 100%;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: rgba(201,162,74,.16); color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
.nav-soon { opacity: .55; }
.phase { margin-left: auto; white-space: nowrap; font-size: .68rem; border: 1px solid rgba(255,255,255,.25); border-radius: 99px; padding: 0 .45rem; }
.sidebar-foot { border-top: 1px solid rgba(255,255,255,.08); padding-top: .6rem; margin-top: .6rem; }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--gold); color: var(--navy); display: grid; place-items: center; font-weight: 700; font-size: .8rem; }
.main { flex: 1; min-width: 0; outline: none; }
.page { max-width: 1180px; margin: 0 auto; padding: 2rem 2rem 4rem; }
.loading { padding: 3rem; text-align: center; color: var(--muted); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.head-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.pillars { margin: .25rem 0 0; color: var(--gold); font-weight: 600; letter-spacing: .02em; }
.intro { max-width: 70ch; margin-top: -.6rem; }
.section-title { margin-top: 2rem; }
.bottom-nav, .scrim { display: none; }

/* ---------- Tarjetas ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem 1.3rem; box-shadow: var(--shadow); }
.card + .card { margin-top: 1rem; }
.empty { text-align: center; color: var(--muted); padding: 2.5rem 1.5rem; }
.soon h2 { color: var(--text); }
.narrow { max-width: 480px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; }
.grid-2 .card + .card { margin-top: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.cards .card + .card { margin-top: 0; }
.leader h2 { margin-bottom: .1rem; }
.leader-stats { display: flex; gap: 1.2rem; margin: 1rem 0; }
.leader-stats dt { font-size: .78rem; color: var(--muted); }
.leader-stats dd { margin: 0; font-size: 1.5rem; font-weight: 700; }

/* ---------- Indicadores ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.2rem; color: var(--text); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: .2rem; }
.stat:hover { border-color: var(--gold); }
.stat-value { font-size: 2rem; font-weight: 750; line-height: 1.1; }
.stat-label { color: var(--muted); font-size: .88rem; }
.stat-warn .stat-value { color: var(--gold); }
.alert { display: flex; align-items: center; gap: .6rem; padding: .85rem 1rem; border-radius: 12px; margin: 0 0 1rem; font-weight: 600; }
.alert-gold { background: var(--gold-soft); color: var(--text); border: 1px solid var(--gold); }
.alert-blue { background: var(--blue-soft); }
.alert-red { background: var(--red-soft); color: var(--text); }
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.bars a { display: grid; grid-template-columns: 190px 1fr 32px; align-items: center; gap: .7rem; color: var(--text); font-size: .9rem; }
.bar-track { height: 9px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--green); border-radius: 99px; min-width: 2px; }
.bar-n { text-align: right; font-weight: 700; }
.list { list-style: none; margin: 0; padding: 0; }
.list-row { display: flex; justify-content: space-between; align-items: center; gap: .8rem; padding: .6rem 0; border-bottom: 1px solid var(--border); color: var(--text); }
.list li:last-child .list-row, .list li.list-row:last-child { border-bottom: 0; }
.due { color: var(--red); font-weight: 600; }
.pipeline { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .4rem; margin-bottom: 1rem; }
.pipe { flex: none; display: flex; flex-direction: column; min-width: 130px; padding: .7rem .9rem; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); color: var(--text); font-size: .82rem; }
.pipe:hover { border-color: var(--gold); }
.pipe-n { font-size: 1.4rem; font-weight: 750; }

/* ---------- Insignias ---------- */
.badge { display: inline-block; font-size: .74rem; font-weight: 650; padding: .12rem .55rem; border-radius: 99px; background: var(--surface-2); color: var(--muted); margin: .15rem .3rem .15rem 0; vertical-align: middle; }
.badge-status { background: var(--green-soft); color: var(--green); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-blue { background: var(--blue-soft); color: var(--blue); }
.badge-green { background: var(--green-soft); color: var(--green); }
.badges { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; margin-top: .35rem; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--border); margin-right: .45rem; }
.dot-green { background: var(--green); }
.consents { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .35rem; }

/* ---------- Tabla ---------- */
.table-wrap { padding: 0; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: .8rem 1rem; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.table td { padding: .8rem 1rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: var(--surface-2); }
.table-compact td { font-size: .87rem; padding: .55rem .8rem; }
.changes code { font-size: .8rem; background: var(--surface-2); padding: 0 .3rem; border-radius: 4px; }
.row-actions { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: flex-end; }
.pager { display: flex; justify-content: center; align-items: center; gap: 1rem; margin-top: 1rem; }

/* ---------- Filtros y formularios ---------- */
.filters { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: 1rem; }
.search { flex: 1 1 260px; display: flex; align-items: center; gap: .5rem; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 0 .7rem; color: var(--muted); }
.search input { border: 0; background: none; padding: 0; min-height: 42px; outline: none; }
input, select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: .55rem .75rem; min-height: 42px;
}
textarea { resize: vertical; min-height: 84px; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); outline: 2px solid color-mix(in srgb, var(--gold) 35%, transparent); }
.filters select { width: auto; }
.check { display: inline-flex; align-items: center; gap: .5rem; cursor: pointer; min-height: 42px; }
.check input { width: 20px; height: 20px; min-height: 0; accent-color: var(--green); }
.check-row { display: flex; flex-wrap: wrap; gap: .2rem 1.2rem; }
.field { display: flex; flex-direction: column; gap: .3rem; }
.field label, .label { font-size: .85rem; font-weight: 600; }
.field-full { grid-column: 1 / -1; }
.req { color: var(--red); }
.help { color: var(--muted); font-size: .78rem; }
.field-error { color: var(--red); font-size: .8rem; min-height: 0; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--red); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .9rem 1rem; }
.form-section { margin: 0 0 1rem; }
.form-section legend { font-weight: 700; padding: 0 .4rem; color: var(--gold); }
fieldset.card { border: 1px solid var(--border); }
.form-actions { display: flex; justify-content: flex-end; gap: .6rem; }
.person-form .form-actions { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 35%); padding: 1.2rem 0 .6rem; }
.stack { display: flex; flex-direction: column; gap: .9rem; }
.status-row { display: grid; grid-template-columns: 1fr 1fr auto auto; gap: .8rem; align-items: end; padding-bottom: .9rem; border-bottom: 1px solid var(--border); }
.status-row:last-child { border-bottom: 0; padding-bottom: 0; }
.secret { display: block; font-size: 1.15rem; letter-spacing: .08em; background: var(--surface-2); padding: .8rem; border-radius: 10px; text-align: center; word-break: break-all; user-select: all; }
.clock-panel { background: var(--surface-2); border-radius: 10px; padding: .6rem .8rem; }
.clock-panel p { margin: .15rem 0; }
.clock-warn { margin-top: .5rem; padding: .6rem .7rem; border-radius: 8px; background: #fdecec; color: #8a1c1c; border: 1px solid #f1b5b5; }
.clock-warn[hidden] { display: none; }

/* ---------- Ficha ---------- */
.back { display: inline-block; margin-bottom: .8rem; color: var(--muted); }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: .6rem; padding: .45rem 0; border-bottom: 1px solid var(--border); }
.kv:last-child { border-bottom: 0; }
.kv dt { color: var(--muted); font-size: .88rem; }
.kv dd { margin: 0; white-space: pre-wrap; word-break: break-word; }
dl { margin: 0; }
.tabs { display: flex; gap: .3rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; }
.tab { padding: .6rem 1rem; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab.active { color: var(--text); border-color: var(--gold); }
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: .35rem; z-index: 20; min-width: 230px; }
.menu button { display: block; width: 100%; text-align: left; background: none; border: 0; color: var(--text); font: inherit; padding: .6rem .8rem; border-radius: 8px; cursor: pointer; }
.menu button:hover { background: var(--surface-2); }
.timeline { list-style: none; margin: 0; padding: 1rem 1.3rem; }
.tl { position: relative; display: grid; grid-template-columns: 22px 1fr; gap: .5rem; padding: 0 0 1.1rem; }
.tl::before { content: ''; position: absolute; left: 5px; top: 14px; bottom: 0; width: 2px; background: var(--border); }
.tl:last-child::before { display: none; }
.tl-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--muted); margin-top: 5px; }
.tl-decision .tl-dot { background: var(--gold); }
.tl-activity .tl-dot { background: var(--green); }
.tl-consent .tl-dot { background: var(--blue); }
.tl-detail { margin: .15rem 0; white-space: pre-wrap; }
.tl small { display: block; }

/* ---------- Modal y avisos ---------- */
.overlay { position: fixed; inset: 0; background: rgba(8, 14, 30, .55); display: grid; place-items: center; z-index: 50; padding: 1rem; }
.modal { background: var(--surface); border-radius: 18px; width: min(520px, 100%); max-height: 92vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal-wide { width: min(760px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.2rem .4rem; }
.modal-head h2 { margin: 0; }
.modal-body { padding: .6rem 1.2rem; overflow-y: auto; }
.modal-actions { display: flex; justify-content: flex-end; gap: .6rem; padding: .9rem 1.2rem 1.1rem; }
.toasts { position: fixed; right: 1rem; bottom: 1rem; display: grid; gap: .5rem; z-index: 60; }
.toast { background: var(--navy); color: #fff; padding: .75rem 1rem; border-radius: 12px; box-shadow: var(--shadow); max-width: 380px; transition: opacity .4s; border-left: 4px solid var(--green); }
.toast-error { border-left-color: var(--red); }
.toast.hide { opacity: 0; }

/* ---------- Acceso ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; background: radial-gradient(ellipse at top, #1d3363, var(--navy) 60%); }
.auth-card { width: min(420px, 100%); background: var(--surface); border-radius: 20px; padding: 2rem; box-shadow: 0 25px 70px rgba(0,0,0,.35); }
.auth-card h1 { font-size: 1.35rem; margin: 1.2rem 0 .4rem; }
.brand-lg { padding: 0; color: var(--text); }
.brand-lg small { color: var(--muted); max-width: none; }
.small-link { word-break: break-all; }
.platform { padding-top: 2rem; }


/* ---------- Fase 2: discipulado y asistencia ---------- */
.section-title.first { margin-top: .5rem; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; margin-top: 2rem; margin-bottom: .8rem; }
.section-head .section-title { margin: 0; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .6rem; }
.card-head h2, .card-head h3 { margin: 0 0 .2rem; }
h3 { font-size: 1rem; margin: 0 0 .5rem; }
.center { align-items: center; }
.group-card { color: var(--text); display: flex; flex-direction: column; gap: .4rem; }
a.group-card:hover { border-color: var(--gold); }
.mini-kv { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem .9rem; margin: .3rem 0; }
.mini-kv.wide { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.mini-kv dt { font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.mini-kv dd { margin: 0; font-weight: 600; font-size: .92rem; }
.badge-gold { background: var(--gold-soft); color: #8a6a22; }
:root[data-theme="dark"] .badge-gold { color: #e2c47c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .badge-gold { color: #e2c47c; } }
.note { display: flex; gap: .5rem; align-items: flex-start; background: var(--surface-2); border-radius: 12px; padding: .7rem .9rem; color: var(--muted); font-size: .88rem; margin: 1rem 0; }
.note .icon { margin-top: 2px; color: var(--gold); }
.progress { display: inline-flex; align-items: center; gap: .5rem; min-width: 120px; }
.progress-track { flex: 1; height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; min-width: 60px; }
.progress-fill { display: block; height: 100%; background: var(--green); border-radius: 99px; }
.progress-n { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.stat .progress { margin-top: .3rem; }
.lesson { line-height: 1.65; }
.lesson-meta { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; color: var(--muted); margin-bottom: 1rem; }
.lesson-meta span { display: inline-flex; align-items: center; gap: .35rem; }
.lesson-meta strong { color: var(--gold); }
.lesson-block { margin: 0 0 1.2rem; }
.lesson-block h3 { color: var(--gold); font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; }
.lesson-block p { margin: 0; }
.lesson-sections { padding-left: 1.2rem; display: grid; gap: .6rem; }
.pre { white-space: pre-wrap; }
.repeat-row { display: grid; gap: .5rem; }
.repeat-row.inline { grid-template-columns: 1fr auto; align-items: center; }
.card-inner { border: 1px dashed var(--border); border-radius: 12px; padding: .7rem; }
.resource-add { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.resource-add input[type="text"], .resource-add input:not([type]) { flex: 1 1 180px; width: auto; }
.file-input { padding: .45rem; }
.search-results { max-height: 220px; overflow-y: auto; }
.pick { width: 100%; background: none; border: 0; font: inherit; text-align: left; cursor: pointer; padding: .55rem .3rem; }
.pick:hover { background: var(--surface-2); }
.select-sm { min-height: 34px; padding: .2rem .5rem; font-size: .88rem; width: auto; }
.inline-label { display: inline-flex; align-items: center; gap: .4rem; font-size: .85rem; color: var(--muted); }
.inline-label input { width: auto; }
.home-disc { margin-top: 1rem; }
.home-agenda { margin: 0 0 1rem; }
.tl-enrollment .tl-dot { background: var(--navy-2); }
/* checklist de asistencia */
.att-summary { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .8rem; }
.chip { background: var(--surface); border: 1px solid var(--border); border-radius: 99px; padding: .2rem .7rem; font-size: .82rem; }
.chip-presente { border-color: var(--green); }
.chip-ausente { border-color: var(--red); }
.chip-tarde { border-color: var(--gold); }
.chip-justificada { border-color: var(--blue); }
.att-list { list-style: none; margin: 0; padding: 0; }
.att-row { display: grid; grid-template-columns: minmax(180px, 1fr) auto; gap: .6rem 1rem; align-items: center; padding: .7rem 0; border-bottom: 1px solid var(--border); }
.att-row:last-child { border-bottom: 0; }
.att-btns { display: flex; flex-wrap: wrap; gap: .35rem; }
.att-btn { min-height: 44px; padding: 0 .8rem; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: .86rem; font-weight: 600; cursor: pointer; }
.att-btn:hover { border-color: var(--gold); }
.att-btn.on.att-presente { background: var(--green); border-color: var(--green); color: #fff; }
.att-btn.on.att-tarde { background: var(--gold); border-color: var(--gold); color: #1b1407; }
.att-btn.on.att-ausente { background: var(--red); border-color: var(--red); color: #fff; }
.att-btn.on.att-justificada { background: var(--blue); border-color: var(--blue); color: #fff; }
:root[data-theme="dark"] .att-btn.on.att-justificada { color: #0b1426; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .att-btn.on.att-justificada { color: #0b1426; } }
.att-btn.on.att-no_registrado { background: var(--surface-2); border-color: var(--muted); }
.sticky-actions { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 35%); padding: 1.2rem 0 .6rem; }
.stat-presente .stat-value { color: var(--green); }
.stat-ausente .stat-value { color: var(--red); }
.stat-tarde .stat-value { color: var(--gold); }
.stat-justificada .stat-value { color: var(--blue); }
.session-photo { max-width: 100%; max-height: 420px; border-radius: 12px; object-fit: contain; background: var(--surface-2); }
@media print {
  .sidebar, .bottom-nav, .topbar, .filters, .head-actions, .back, .tabs, .demo-banner, .toasts { display: none !important; }
  .page { padding: 0; max-width: none; }
  .card { box-shadow: none; }
}


/* ---------- Fase 3: seguimiento ---------- */
button.stat { font: inherit; text-align: left; cursor: pointer; }
.section-head.first { margin-top: .2rem; }
.agenda-list { list-style: none; margin: 0 0 .5rem; padding: 0; display: grid; gap: .6rem; }
.agenda-item { display: grid; grid-template-columns: 40px 1fr; gap: .8rem; padding: .9rem 1rem; }
.card + .agenda-item, .agenda-list .card + .card { margin-top: 0; }
.agenda-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--gold); }
.kind-visita .agenda-icon { color: var(--green); }
.kind-mensaje .agenda-icon { color: var(--blue); }
.kind-revision_pastoral .agenda-icon { color: var(--red); }
.agenda-title { font-size: 1rem; }
.agenda-main p { margin: .25rem 0; }
.agenda-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .6rem; }
.agenda-actions .btn { text-decoration: none; }
.cards-wide { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.template-card { display: flex; flex-direction: column; gap: .5rem; }
.template-body { background: var(--surface-2); border-radius: 10px; padding: .6rem .7rem; margin: 0; }
.seq-steps { list-style: none; margin: .6rem 0 0; padding: 0; display: grid; gap: .35rem; }
.seq-steps li { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; font-size: .92rem; }
.seq-steps .icon { color: var(--gold); }
.seq-day { min-width: 64px; font-weight: 700; font-size: .8rem; color: var(--muted); }
.seq-steps.compact .seq-day { min-width: 92px; }
.seq-steps .st-realizada { opacity: .7; }
.seq-row { display: grid; grid-template-columns: 70px 1fr 1fr 2fr auto; gap: .4rem; align-items: center; }
.inline-form { display: flex; gap: .5rem; align-items: center; }
.inline-form input { max-width: 110px; }
.mt { margin-top: 1rem; }
.bell-count { margin-left: auto; background: var(--gold); color: var(--navy); border-radius: 99px; font-size: .72rem; font-weight: 800; padding: 0 .45rem; min-width: 20px; text-align: center; }
.topbar-bell { margin-left: auto; position: relative; color: #fff; }
.topbar-bell .bell-count { position: absolute; top: 2px; right: 0; margin: 0; }
.dot-gold { background: var(--gold); }
.notif-list .pick.unread strong { color: var(--text); }
.notif-list .pick { color: var(--muted); }


/* ---------- Fase 4: células y calendario ---------- */
.cal-nav { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .8rem; }
.cal-nav select { width: auto; margin-left: auto; }
.cal-month { margin: 0 .4rem; min-width: 170px; text-align: center; }
.cal-card { padding: .5rem; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-head { text-align: center; font-size: .75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; padding: .3rem 0; }
.cal-cell { min-height: 92px; border: 1px solid var(--border); border-radius: 10px; padding: .3rem; display: flex; flex-direction: column; gap: 3px; background: var(--surface); overflow: hidden; }
.cal-cell.empty-cell { border: 0; background: transparent; }
.cal-cell.is-today { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.cal-day { font-size: .8rem; font-weight: 700; color: var(--muted); }
.is-today .cal-day { color: var(--gold); }
.cal-ev { display: block; font-size: .72rem; line-height: 1.25; padding: .15rem .35rem; border-radius: 6px; background: var(--blue-soft); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 3px solid var(--blue); }
.cal-ev.cat-culto { background: var(--gold-soft); border-left-color: var(--gold); }
.cal-ev.cat-bautismo, .cal-ev.cat-evangelismo { background: var(--green-soft); border-left-color: var(--green); }
.cal-ev.cat-vigilia, .cal-ev.cat-oracion, .cal-ev.cat-ayuno { background: var(--surface-2); border-left-color: var(--navy-2); }
.cal-ev.is-cancelled, .strike { text-decoration: line-through; opacity: .6; }
.right { text-align: right; }
.prayer-item { display: flex; flex-direction: column; gap: .3rem; }
.prayer-item p { margin: 0; }

/* ---------- Celulares ---------- */
@media (max-width: 860px) {
  body { font-size: 16px; }
  .topbar { display: flex; align-items: center; gap: .5rem; background: var(--navy); color: #fff; padding: .4rem .6rem; position: sticky; top: 0; z-index: 30; }
  .brand-mini { font-weight: 700; letter-spacing: .05em; font-size: .92rem; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 40; transform: translateX(-100%); transition: transform .2s; height: 100%; }
  .nav-open .sidebar { transform: none; }
  .nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 35; }
  .page { padding: 1.2rem 1rem 6.5rem; }
  h1 { font-size: 1.35rem; }
  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--border);
    padding: .35rem .3rem calc(.35rem + env(safe-area-inset-bottom)); justify-content: space-around; align-items: center;
  }
  .bottom-nav a, .bottom-nav button { display: flex; flex-direction: column; align-items: center; gap: 2px; font: inherit; font-size: .7rem; color: var(--muted); background: none; border: 0; min-width: 64px; min-height: 52px; justify-content: center; cursor: pointer; }
  .bottom-nav a.active { color: var(--text); }
  .bottom-nav .bottom-add { background: var(--gold); color: var(--navy); border-radius: 50%; width: 54px; height: 54px; min-width: 54px; margin-top: -22px; box-shadow: 0 6px 18px rgba(0,0,0,.2); }
  .btn { min-height: 48px; }
  input, select, textarea { min-height: 48px; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { border-bottom: 1px solid var(--border); padding: .6rem .9rem; }
  .table td { border: 0; padding: .2rem 0; }
  .table td[data-label]::before { content: attr(data-label) ': '; color: var(--muted); font-size: .78rem; }
  .table td:first-child::before { content: none; }
  .row-actions { justify-content: flex-start; }
  .bars a { grid-template-columns: 1fr 70px 28px; }
  .kv { grid-template-columns: 1fr; gap: .1rem; }
  .status-row { grid-template-columns: 1fr; }
  .filters > * { flex: 1 1 100%; }
  .filters select { width: 100%; }
  .head-actions { width: 100%; }
  .head-actions > * { flex: 1; }
  .toasts { left: 1rem; bottom: 5.5rem; }
  .att-row { grid-template-columns: 1fr; }
  .cal-cell { min-height: 54px; padding: .2rem; }
  .cal-ev { font-size: 0; padding: 0; height: 6px; border-left-width: 0; border-radius: 3px; }
  .cal-nav select { width: 100%; margin-left: 0; }
  .cal-month { min-width: 0; flex: 1; }
  .seq-row { grid-template-columns: 70px 1fr; }
  .seq-row input[data-k=title] { grid-column: 1 / -1; }
  .agenda-item { grid-template-columns: 1fr; }
  .agenda-icon { display: none; }
  .stats { grid-template-columns: 1fr 1fr; gap: .6rem; }
  .stat-value { font-size: 1.6rem; }
  .att-btns { display: grid; grid-template-columns: 1fr 1fr; }
  .att-btn { min-height: 52px; font-size: .95rem; }
  .att-btn.att-no_registrado { grid-column: 1 / -1; }
  .mini-kv { grid-template-columns: 1fr 1fr; }
  .sticky-actions { bottom: 4.8rem; }
  .section-head .head-actions { width: auto; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Fase 4 — Ministerios (y corrección: listas dentro de tarjetas conservan el margen interior) */
.card.list, .card.att-list { padding: .4rem 1.3rem; }
.stats.stats-compact { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.stats.stats-compact .stat { padding: .8rem 1rem; }
.stats.stats-compact .stat-value { font-size: 1.6rem; }
.mn-btns .att-btn.att-no_registrado { grid-column: auto; }

/* Fase 4 — Informes y familias */
.report-section { margin-bottom: 1rem; }
.report-section h2 { margin-top: 0; }
.report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem 2rem; margin-top: .6rem; }
.report-grid h3 { font-size: .95rem; margin: .2rem 0 .5rem; }
.bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.bars li { display: grid; grid-template-columns: minmax(90px, 35%) 1fr 2.5rem; gap: .6rem; align-items: center; font-size: .88rem; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.bar-track { background: var(--surface-2); border-radius: 6px; height: 12px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--gold); border-radius: 6px; min-width: 2px; }
.bar-value { text-align: right; font-weight: 650; }
.filters-inline { display: inline-flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.filters-inline input { width: auto; }
.quick-register { border: 1px dashed var(--gold); border-radius: 10px; padding: .8rem; margin-top: .4rem; gap: .5rem; }
.quick-register label { display: flex; flex-direction: column; gap: .2rem; font-size: .82rem; color: var(--muted); }

/* Fase 4 — Finanzas */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.amount { text-align: right; font-variant-numeric: tabular-nums; font-weight: 650; white-space: nowrap; }
.amount-in { color: var(--green); }
.amount-out { color: var(--red); }
.bars-dual li { grid-template-columns: minmax(80px, 20%) 1fr 7rem; }
.bar-stack { display: flex; flex-direction: column; gap: 3px; }
.bar-stack .bar-track { height: 9px; }
.bar-fill.bar-in, .legend-in { background: var(--green); }
.bar-fill.bar-out, .legend-out { background: var(--red); }
.legend { display: inline-block; width: .8rem; height: .8rem; border-radius: 3px; margin: 0 .3rem -1px .6rem; }
a.stat { color: var(--text); text-decoration: none; }
a.stat:hover { border-color: var(--gold); }
.printable { max-width: 760px; }
.print-head { border-bottom: 2px solid var(--gold); margin-bottom: 1rem; padding-bottom: .6rem; }
.print-head h1 { margin: 0 0 .3rem; }
.print-amount { font-size: 1.4rem; }
.printable tfoot th { text-align: left; }
.printable tfoot th.amount { text-align: right; }
@media print {
  .no-print { display: none !important; }
  .main { margin: 0 !important; padding: 0 !important; }
  .printable { border: 0; max-width: none; }
}
.bars-money li { grid-template-columns: minmax(90px, 30%) 1fr 7rem; }

/* Fase 5 — NEX PASTORAL AI */
.ai-tool h3 { display: flex; align-items: center; gap: .4rem; }
.ai-text { line-height: 1.6; background: var(--surface-2); border-radius: 10px; padding: 1rem 1.1rem; margin: .6rem 0; overflow-wrap: anywhere; }
.ai-provider legend { font-weight: 700; padding: 0 .3rem; }
.ai-provider { border: 1px solid var(--border); }
.steps { margin: 0; padding-left: 1.3rem; display: flex; flex-direction: column; gap: .3rem; }
.steps a { overflow-wrap: anywhere; }
.steps code { background: var(--surface-2); padding: .1rem .4rem; border-radius: 6px; }
.ai-text h3 { margin: .9rem 0 .4rem; font-size: 1.1rem; } .ai-text h4 { margin: .8rem 0 .3rem; font-size: 1rem; }
.ai-text p { margin: .35rem 0; } .ai-text ul, .ai-text ol { margin: .3rem 0 .5rem; padding-left: 1.4rem; } .ai-text > :first-child { margin-top: 0; }

/* Fase 5 — Flyers */
.flyer-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 1.2rem; align-items: start; }
.flyer-preview { position: sticky; top: 1rem; }
.flyer-canvas { display: block; width: auto; height: auto; max-width: 100%; max-height: 78vh; margin: 0 auto; border-radius: 8px; }
.flyer-full { display: block; width: auto; height: auto; max-width: 100%; max-height: 80vh; margin: 0 auto; padding: .5rem; }
.seg { display: flex; flex-wrap: wrap; gap: .4rem; }
.swatches { display: flex; flex-wrap: wrap; gap: .5rem; }
.swatch { width: 52px; height: 52px; border-radius: 12px; border: 3px solid transparent; cursor: pointer; box-shadow: var(--shadow); }
.swatch.on { border-color: var(--gold); outline: 2px solid var(--surface); outline-offset: -5px; }
.flyer-cards .flyer-thumb { width: 100%; height: 220px; object-fit: cover; border-radius: 10px; background: var(--surface-2); }
.ai-flyer { border-color: var(--gold); }
@media (max-width: 900px) {
  .flyer-layout { grid-template-columns: 1fr; }
  .flyer-preview { position: static; order: -1; }
  .flyer-canvas { max-height: 60vh; }
}

/* ---------- Inicio dinámico (v0.10) ---------- */
.home-hero { position: relative; overflow: hidden; border-radius: 18px; padding: 1.6rem 1.8rem 1.3rem; margin-bottom: 1.2rem; color: #fff;
  background: radial-gradient(circle at 85% 20%, rgba(201,164,76,.35), transparent 45%), linear-gradient(120deg, #0f1f3d 0%, #1a2f57 55%, #2a4580 100%); box-shadow: 0 8px 28px rgba(15,31,61,.25); }
.home-hero::after { content: ''; position: absolute; right: -40px; bottom: -60px; width: 260px; height: 260px; border-radius: 50%; border: 40px solid rgba(255,255,255,.04); pointer-events: none; }
.home-hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.home-hero h1 { margin: .1rem 0 .2rem; font-size: 1.9rem; color: #fff; }
.home-hero-date { margin: 0; color: #e2c27a; font-size: .85rem; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; }
.home-hero-sub { margin: 0; color: #c9d3ea; }
.btn-gold { background: linear-gradient(135deg, #e2c27a, #b8913a); border-color: #b8913a; color: #10182b; font-weight: 700; }
.btn-gold:hover { filter: brightness(1.07); }
.hero-steps { display: flex; align-items: center; gap: .4rem; margin-top: 1.2rem; flex-wrap: wrap; position: relative; z-index: 1; }
.hero-step { display: flex; align-items: center; gap: .6rem; padding: .55rem .9rem .55rem .55rem; border-radius: 14px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); color: #fff; flex: 1 1 150px; transition: background .15s, transform .15s; }
a.hero-step:hover { background: rgba(255,255,255,.14); transform: translateY(-1px); }
.hero-step-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(226,194,122,.18); color: #e2c27a; flex: none; }
.hero-step-text { display: flex; flex-direction: column; line-height: 1.15; }
.hero-step-text small { color: #c9d3ea; font-size: .8rem; }
.hero-arrow { color: #e2c27a; font-size: 1.4rem; opacity: .8; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .9rem; margin-bottom: 1rem; }
.kpi { display: flex; flex-direction: column; gap: .55rem; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; color: var(--text); box-shadow: var(--shadow); transition: transform .15s, border-color .15s; }
.kpi:hover { transform: translateY(-2px); border-color: var(--gold); }
.kpi-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.kpi-body { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.kpi-value { font-size: 1.9rem; font-weight: 800; line-height: 1.05; }
.kpi-label { font-size: .86rem; font-weight: 650; }
.kpi-sub { color: var(--muted); font-size: .78rem; }
.kpi-trend { font-size: .75rem; font-weight: 700; margin-top: .15rem; }
.kpi-trend.up { color: var(--green); } .kpi-trend.down { color: var(--red); } .kpi-trend.flat { color: var(--muted); }
.kpi-gold .kpi-icon, .task-icon.kpi-gold { background: #f8eccd; color: #9a7a2c; }
.kpi-purple .kpi-icon, .task-icon.kpi-purple { background: #ece6fb; color: #6a4fc0; }
.kpi-blue .kpi-icon, .task-icon.kpi-blue { background: #e3ecfb; color: #2c5aa0; }
.kpi-green .kpi-icon, .task-icon.kpi-green { background: #e0f3e8; color: #2f7d55; }
.kpi-teal .kpi-icon { background: #dff3f3; color: #1f7f86; }
.kpi-red .kpi-icon, .task-icon.kpi-red { background: #fbe4e2; color: #b4443c; }
.kpi-gray .kpi-icon { background: var(--surface-2); color: var(--muted); }
.kpi-gold .kpi-value { color: #9a7a2c; }

.home-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.home-grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.home-grid .card + .card, .home-overview .card + .card { margin-top: 0; }
.home-overview > .card { margin-bottom: 1rem; }
.card-head p { margin: 0; }

.cols { display: flex; align-items: flex-end; gap: .4rem; height: 190px; padding-top: 1.2rem; border-bottom: 1px solid var(--border); margin-top: .6rem; }
.col { flex: 1; display: flex; flex-direction: column; align-items: stretch; height: 100%; min-width: 0; }
.col-bars { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 3px; }
.col-bar { position: relative; flex: 1; max-width: 34px; min-height: 2px; border-radius: 6px 6px 0 0; transition: height .5s ease; }
.col-bar em { position: absolute; top: -1.15rem; left: 50%; transform: translateX(-50%); font-style: normal; font-size: .72rem; font-weight: 700; color: var(--text); }
.col-label { text-align: center; font-size: .72rem; color: var(--muted); padding: .35rem 0 .1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.col-now .col-label { color: var(--text); font-weight: 750; }
.bar-souls { background: linear-gradient(180deg, #e2c27a, #b8913a); }
.col:not(.col-now) .bar-souls { opacity: .55; }
.bar-present { background: #4f7fd8; } .bar-absent { background: #c9d3ea; }
.legend { display: flex; gap: 1rem; font-size: .78rem; color: var(--muted); margin: .3rem 0 .9rem; }
.pm-meta { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-top: .15rem; }
.lg { display: inline-flex; align-items: center; }
.lg::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }
.lg-present::before { background: #4f7fd8; } .lg-absent::before { background: #c9d3ea; }
.empty-chart { padding: 2.2rem 1rem; text-align: center; background: var(--surface-2); border-radius: 10px; margin-top: .8rem; }

.people-mini, .tasks-mini, .students-mini { list-style: none; margin: .4rem 0 0; padding: 0; display: flex; flex-direction: column; }
.people-mini a, .students-mini a { display: flex; align-items: center; gap: .7rem; padding: .55rem 0; color: var(--text); border-bottom: 1px solid var(--border); }
.people-mini li:last-child a, .students-mini li:last-child a, .tasks-mini li:last-child a { border-bottom: 0; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 750; font-size: .85rem; flex: none; }
.av-evangelizar { background: #fbe4e2; color: #b4443c; } .av-restaurar { background: #f8eccd; color: #9a7a2c; }
.av-discipular { background: #e3ecfb; color: #2c5aa0; } .av-other { background: var(--surface-2); color: var(--muted); }
.pm-text, .sm-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.pm-text strong, .sm-top strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip { font-size: .72rem; font-weight: 700; padding: .22rem .6rem; border-radius: 999px; white-space: nowrap; }
.chip-evangelizar { background: #fbe4e2; color: #9b3a33; } .chip-restaurar { background: #f8eccd; color: #84661f; }
.chip-discipular { background: #e0f3e8; color: #2f7d55; } .chip-other { background: var(--surface-2); color: var(--muted); }
.tasks-mini a { display: flex; align-items: center; gap: .7rem; padding: .6rem 0; color: var(--text); border-bottom: 1px solid var(--border); }
.task-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.task-n { font-size: 1.15rem; min-width: 1.6rem; }
.sm-top { display: flex; justify-content: space-between; gap: .5rem; }
.mini-track { display: block; height: 7px; border-radius: 99px; background: var(--surface-2); margin-top: .3rem; overflow: hidden; }
.mini-fill { display: block; height: 100%; border-radius: 99px; }
.mini-fill.good { background: #3f8f68; } .mini-fill.mid { background: #4f7fd8; } .mini-fill.low { background: #e2b33c; }
.home-ai { background: linear-gradient(135deg, var(--surface), var(--blue-soft)); }
.home-ai h2 { display: flex; align-items: center; gap: .4rem; }
.ai-quick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .6rem; margin-top: .7rem; }
.ai-quick { display: flex; align-items: center; gap: .5rem; padding: .7rem .9rem; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 600; font-size: .9rem; }
.ai-quick:hover { border-color: var(--gold); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .kpi-icon, :root:not([data-theme="light"]) .task-icon, :root:not([data-theme="light"]) .avatar, :root:not([data-theme="light"]) .chip { filter: saturate(.9) brightness(.85); }
  :root:not([data-theme="light"]) .kpi-gold .kpi-value { color: #e2c27a; }
}
@media (max-width: 640px) {
  .home-hero { padding: 1.2rem; } .home-hero h1 { font-size: 1.45rem; }
  .hero-arrow { display: none; } .hero-step { flex: 1 1 45%; }
  .kpis { grid-template-columns: 1fr 1fr; gap: .6rem; } .kpi { padding: .75rem; flex-direction: column; gap: .4rem; } .kpi-value { font-size: 1.5rem; }
  .home-grid, .home-grid-3 { grid-template-columns: 1fr; }
  .cols { height: 150px; } .col-label { font-size: .62rem; }
}

/* ---------- Ruta de crecimiento y bautismo (v0.11) ---------- */
.journey-card { margin-bottom: 1rem; }
.jr-count { font-size: .8rem; font-weight: 700; color: #9a7a2c; background: var(--gold-soft); padding: .3rem .7rem; border-radius: 999px; white-space: nowrap; }
.next-step { display: flex; gap: .9rem; align-items: flex-start; padding: .9rem 1rem; border-radius: 12px; margin: .8rem 0 1rem; background: linear-gradient(135deg, #fff8e6, var(--surface)); border: 1px solid #ecd9a6; }
.next-step-empty { background: var(--surface-2); border-color: var(--border); }
.next-step-due { border-color: #e7a59f; background: linear-gradient(135deg, #fdecea, var(--surface)); }
.next-step-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: #f8eccd; color: #9a7a2c; flex: none; }
.next-step-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.next-step-label { text-transform: uppercase; letter-spacing: .05em; font-weight: 750; color: #9a7a2c; font-size: .72rem; }
.next-step-reason { margin: .3rem 0 0; }
.jr-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .9rem; }
.jr-col { border: 1px solid var(--border); border-radius: 12px; padding: .8rem .9rem; background: var(--surface); }
.jr-col h3 { display: flex; align-items: center; gap: .35rem; margin: 0 0 .5rem; font-size: .95rem; }
.jr-evangelizar h3 { color: #b4443c; } .jr-restaurar h3 { color: #9a7a2c; } .jr-discipular h3 { color: #2c5aa0; } .jr-enviar h3 { color: #2f7d55; }
.jr-col ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .15rem; }
.jr-stage { display: flex; align-items: flex-start; gap: .55rem; padding: .4rem 0; border-bottom: 1px dashed var(--border); font-size: .88rem; }
.jr-stage:last-child { border-bottom: 0; }
.jr-dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border); display: grid; place-items: center; font-size: .72rem; font-weight: 800; flex: none; margin-top: 1px; color: #fff; }
.jr-stage.done .jr-dot { background: #3f8f68; border-color: #3f8f68; }
.jr-stage.progress .jr-dot { border-color: #e2b33c; background: #fff4d6; }
.jr-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.jr-stage.done .jr-text > span:first-child { font-weight: 650; }
.btn-xs { padding: .15rem .5rem; min-height: 28px; font-size: .75rem; }
.baptism-block { margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.baptism-block h3 { display: flex; align-items: center; gap: .35rem; margin: 0 0 .5rem; color: #2c5aa0; }
.bp-stepper { list-style: none; display: flex; gap: .3rem; padding: 0; margin: .6rem 0; flex-wrap: wrap; }
.bp-stepper li { flex: 1 1 90px; display: flex; flex-direction: column; align-items: center; gap: .25rem; position: relative; text-align: center; color: var(--muted); }
.bp-stepper li:not(:last-child)::after { content: ''; position: absolute; top: 14px; left: calc(50% + 16px); right: calc(-50% + 16px); height: 2px; background: var(--border); }
.bp-stepper li.done:not(:last-child)::after { background: #4f7fd8; }
.bp-dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: .78rem; font-weight: 800; border: 2px solid var(--border); background: var(--surface); }
.bp-stepper li.done .bp-dot { background: #4f7fd8; border-color: #4f7fd8; color: #fff; }
.bp-stepper li.now .bp-dot { border-color: #4f7fd8; color: #2c5aa0; box-shadow: 0 0 0 4px rgba(79,127,216,.15); }
.bp-stepper li.now small, .bp-stepper li.done small { color: var(--text); font-weight: 650; }
.bp-stepper.paused { opacity: .75; }
.bp-details { margin: .4rem 0; }
.bp-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; }
.bp-list .card + .card { margin-top: 0; }
.kpi-on { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,164,76,.25); }
.stage-row { grid-template-columns: 1.3fr 1fr auto auto; }
@media (max-width: 640px) { .stage-row { grid-template-columns: 1fr; } .bp-stepper li:not(:last-child)::after { display: none; } }
.journey-card .card-head { flex-wrap: wrap; }
@media (max-width: 640px) { .next-step { flex-wrap: wrap; } .next-step > .btn { width: 100%; } .jr-count { order: 2; } }

/* Partes de cada etapa (v0.16) */
.jr-parts { margin-top: .35rem; font-size: .82rem; }
.jr-parts summary { cursor: pointer; color: #2c5aa0; font-weight: 650; padding: .2rem 0; min-height: 28px; }
.jr-parts-title { margin: .5rem 0 .2rem; font-weight: 750; font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: #9a7a2c; }
.jr-parts ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .3rem; }
.jr-parts label { display: flex; gap: .45rem; align-items: flex-start; cursor: pointer; line-height: 1.3; }
.jr-parts input[type=checkbox] { margin-top: .15rem; width: 16px; height: 16px; flex: none; accent-color: #3f8f68; }
.jr-parts li.ok > label > span { color: var(--muted); }
.jr-parts-hint { margin: .5rem 0 .2rem; padding: .45rem .6rem; border-radius: 8px; background: #e8f4ee; color: #2f7d55; font-weight: 600; }

/* ---------- Mentoría y formación (v0.12) ---------- */
.mentoring-card { margin-bottom: 1rem; }
.mentor-list { list-style: none; margin: .6rem 0; padding: 0; display: flex; flex-direction: column; gap: .2rem; }
.mentor-list li { display: flex; align-items: center; gap: .7rem; padding: .55rem 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.mentor-list li:last-child { border-bottom: 0; }
.mentor-actions { display: flex; gap: .4rem; margin-left: auto; }
.meeting-list { list-style: none; margin: .3rem 0; padding: 0; }
.meeting-list li { padding: .45rem 0; border-bottom: 1px dashed var(--border); }
.private-note { margin: .2rem 0 0; white-space: pre-wrap; }
.gifts-block { margin-top: 1rem; padding-top: .9rem; border-top: 1px solid var(--border); }
.gifts-block h3, .formation-block h3 { margin: 0; }
.formation-block { margin-top: 1rem; padding: 1rem; border-radius: 12px; background: linear-gradient(135deg, #f6f1ff, var(--surface)); border: 1px solid #ddd2f6; }
.formation-block h4 { margin: .2rem 0; }
.review-list { display: flex; flex-direction: column; gap: .7rem; margin-top: .4rem; }
.review { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: .8rem .9rem; }
.review p { margin: .35rem 0; }
.badge-purple { background: #ece6fb; color: #5b3fb0; }
.mt { margin-top: .9rem; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .formation-block { background: var(--surface-2); border-color: var(--border); } }
.sent-card { margin-bottom: 1rem; }
.sent-item { border: 1px solid var(--border); border-radius: 12px; padding: .9rem 1rem; margin-top: .8rem; background: linear-gradient(135deg, #eef8f2, var(--surface)); }
.sent-item.ended { background: var(--surface-2); opacity: .85; }
.sent-item h4 { margin: .6rem 0 .2rem; }
.gaps-card { border-left: 4px solid var(--gold); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sent-item { background: var(--surface-2); } }
.imp-steps { margin: .4rem 0 .8rem 1.1rem; padding: 0; display: flex; flex-direction: column; gap: .35rem; }
.imp-result { border-left: 4px solid #3f8f68; }
.gaps-card { margin-bottom: 1rem; }
