:root {
  --brand: #1450b8;
  --brand-ink: #ffffff;
  --brand-soft: color-mix(in srgb, var(--brand) 12%, white);
  --bg: #f3f6fb;
  --surface: #ffffff;
  --ink: #14203a;
  --muted: #5f6b80;
  --line: #dfe5ee;
  --sand: #38c6f4;
  --ok: #2f8a4f;
  --ok-soft: #e3f3e7;
  --warn: #b7791f;
  --warn-soft: #fbf0d9;
  --bad: #b83a35;
  --bad-soft: #fbe5e3;
  --info: #2c6aa0;
  --info-soft: #e2eef8;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(7, 24, 79, .05), 0 6px 20px rgba(7, 24, 79, .05);
  --display: 'Fraunces', Georgia, serif;
  --body: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --nav-h: 66px;
}

* { box-sizing: border-box; }
:where(svg) { width: 18px; height: 18px; flex: none; vertical-align: middle; }
html, body { margin: 0; }
body {
  font-family: var(--body); color: var(--ink); background: var(--bg);
  font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--brand); text-decoration: none; }
h1, h2, h3 { font-family: var(--display); font-weight: 650; letter-spacing: -.01em; margin: 0; line-height: 1.15; }
h1 { font-size: 27px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; font-family: var(--body); font-weight: 700; letter-spacing: 0; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.top { align-items: flex-start; }
.between { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }
.stack-sm > * + * { margin-top: 6px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }

/* ---------- Splash / spinner ---------- */
.splash { min-height: 100vh; display: grid; place-items: center; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--brand); animation: spin .8s linear infinite; }
.spinner.sm { width: 20px; height: 20px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-block { padding: 40px; display: grid; place-items: center; }

/* ---------- Shell ---------- */
.shell { min-height: 100vh; display: flex; }
.sidebar { display: none; }
.main { flex: 1; min-width: 0; padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 18px); }
.topbar {
  position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  padding: calc(env(safe-area-inset-top) + 12px) 16px 10px; display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid transparent;
}
.topbar .logo { width: 38px; height: 38px; border-radius: 11px; object-fit: cover; flex: none; }
.logo-fallback { width: 38px; height: 38px; border-radius: 11px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-family: var(--display); font-weight: 650; font-size: 18px; flex: none; }
.topbar .t1 { font-weight: 700; font-size: 15px; line-height: 1.2; }
.topbar .t2 { font-size: 12.5px; color: var(--muted); }
.camp-switch { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; max-width: 52vw; display: flex; align-items: center; gap: 6px; cursor: pointer; }
.camp-switch span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.content { padding: 6px 16px 16px; max-width: 1080px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 8px 0 16px; }
.page-head .eyebrow { font-size: 12px; font-weight: 700; color: var(--brand); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 4px; }

.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface);
  border-top: 1px solid var(--line); display: flex; padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.bottomnav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; color: var(--muted); font-size: 11px; font-weight: 600; border-radius: 12px; }
.bottomnav a.active { color: var(--brand); }
.bottomnav a.active svg { background: var(--brand-soft); }
.bottomnav svg { width: 46px; height: 28px; padding: 4px 13px; border-radius: 999px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #e0392f; display: inline-block; box-shadow: 0 0 0 0 rgba(224, 57, 47, .6); animation: pulse 1.6s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(224, 57, 47, 0); } 100% { box-shadow: 0 0 0 0 rgba(224, 57, 47, 0); } }

@media (min-width: 900px) {
  .bottomnav { display: none; }
  .main { padding-bottom: 30px; }
  .sidebar {
    display: flex; flex-direction: column; width: 248px; flex: none; position: sticky; top: 0; height: 100vh;
    padding: 20px 14px; border-right: 1px solid var(--line); background: var(--surface); overflow-y: auto;
  }
  .sidebar .brand { display: flex; gap: 10px; align-items: center; padding: 0 8px 18px; }
  .sidebar .brand .logo, .sidebar .brand .logo-fallback { width: 40px; height: 40px; border-radius: 12px; object-fit: cover; }
  .sidebar nav a { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 11px; color: var(--ink); font-weight: 600; font-size: 14px; }
  .sidebar nav a svg { width: 20px; height: 20px; color: var(--muted); }
  .sidebar nav a:hover { background: var(--bg); }
  .sidebar nav a.active { background: var(--brand-soft); color: var(--brand); }
  .sidebar nav a.active svg { color: var(--brand); }
  .sidebar .navlabel { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; padding: 16px 10px 6px; }
  .sidebar .foot { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid var(--line); }
  .topbar .only-mobile { display: none; }
  .content { padding: 10px 28px 28px; }
}

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.card.tight { padding: 12px 14px; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.grid { display: grid; gap: 12px; }
.grid.two { grid-template-columns: 1fr; }
.grid.stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 680px) { .grid.two { grid-template-columns: 1fr 1fr; } .grid.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.stat .v { font-family: var(--display); font-size: 28px; font-weight: 650; line-height: 1; margin-top: 6px; }
.stat .l { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.stat .s { font-size: 12px; color: var(--muted); margin-top: 6px; }
.stat.brand { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.stat.brand .l, .stat.brand .s { color: color-mix(in srgb, var(--brand-ink) 78%, transparent); }

.hero {
  border-radius: 22px; padding: 20px; color: var(--brand-ink); position: relative; overflow: hidden;
  background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--sand) 55%, var(--brand)) 0%, var(--brand) 58%);
}
.hero h1, .hero h2 { color: inherit; }
.hero .lema { opacity: .88; font-size: 14px; margin-top: 6px; font-style: italic; font-family: var(--display); }
.hero .meta { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 14px; font-size: 13px; opacity: .95; }
.hero .meta span { display: inline-flex; align-items: center; gap: 6px; }
.hero .meta svg { width: 15px; height: 15px; }
.hero::after { content: ''; position: absolute; right: -40px; bottom: -60px; width: 200px; height: 200px; border-radius: 50%; border: 28px solid rgba(255, 255, 255, .07); }

.bar { height: 8px; border-radius: 99px; background: var(--bg); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--brand); }
.bar.warn > i { background: var(--warn); }
.bar.bad > i { background: var(--bad); }

/* ---------- Lists ---------- */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.item { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-top: 1px solid var(--line); cursor: default; }
.item:first-child { border-top: 0; }
.item.click { cursor: pointer; }
.item.click:hover { background: color-mix(in srgb, var(--bg) 55%, white); }
.item .title { font-weight: 650; }
.item .sub { font-size: 13px; color: var(--muted); }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; background: var(--brand-soft); color: var(--brand); }
.avatar.F { background: #f8e4ea; color: #a23a5b; }
.avatar.M { background: #e1ecf7; color: #2c5f93; }
.empty { text-align: center; padding: 34px 20px; color: var(--muted); }
.empty svg { width: 38px; height: 38px; color: var(--line); margin-bottom: 8px; }

.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 650; background: var(--bg); color: var(--muted); white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.info { background: var(--info-soft); color: var(--info); }
.chip.brand { background: var(--brand-soft); color: var(--brand); }
.chip.live { background: #fde3e1; color: #c0322a; }

.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; margin-bottom: 14px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { border: 1px solid var(--line); background: var(--surface); padding: 7px 14px; border-radius: 999px; font-weight: 600; font-size: 13.5px; white-space: nowrap; cursor: pointer; }
.tab.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.tab .n { opacity: .6; margin-left: 4px; }

/* ---------- Timeline / schedule ---------- */
.day-head { display: flex; align-items: baseline; gap: 10px; margin: 18px 2px 10px; }
.day-head h2 { font-size: 19px; }
.day-head h2::first-letter { text-transform: uppercase; }
.sched { position: relative; }
.slot { display: grid; grid-template-columns: 70px 1fr; gap: 12px; padding: 0 0 12px; position: relative; }
.slot .hr { text-align: right; font-weight: 700; font-size: 12.5px; padding-top: 13px; white-space: nowrap; }
.slot .hr small { display: block; font-weight: 500; color: var(--muted); font-size: 11.5px; }
.slot .box { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--c, var(--brand)); border-radius: 12px; padding: 11px 13px; }
.slot.now .box { box-shadow: 0 0 0 2px var(--brand); }
.slot.past { opacity: .55; }
.tipo-charla { --c: #2c6aa0; } .tipo-adoracion { --c: #8a4fb5; } .tipo-devocional { --c: #c08a2e; }
.tipo-comida { --c: #d0672f; } .tipo-recreacion { --c: #2f8a4f; } .tipo-logistica { --c: #66706a; } .tipo-general { --c: var(--brand); }

.timeline { position: relative; padding-left: 28px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl { position: relative; padding-bottom: 14px; }
.tl::before { content: ''; position: absolute; left: -27px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 3px solid var(--c, var(--brand)); }
.tl:first-child::before { background: var(--c, var(--brand)); }
.tl .when { font-size: 12px; color: var(--muted); }
.ev-abordo_bus { --c: var(--info); } .ev-llego_campamento { --c: var(--ok); } .ev-novedad { --c: var(--sand); }
.ev-salud { --c: var(--bad); } .ev-salio_campamento { --c: var(--warn); } .ev-entregado { --c: #6b5bb5; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 12px; padding: 10px 16px; font-weight: 650; font-size: 14.5px; cursor: pointer; background: var(--brand); color: var(--brand-ink); transition: transform .06s, filter .15s; text-decoration: none; }
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: default; }
.btn svg { width: 18px; height: 18px; }
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn.soft { background: var(--brand-soft); color: var(--brand); }
.btn.danger { background: var(--bad-soft); color: var(--bad); }
.btn.sm { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn.block { width: 100%; }
.iconbtn { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; color: var(--ink); flex: none; }
.iconbtn svg { width: 19px; height: 19px; }
.fab { position: fixed; right: 18px; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px); z-index: 25; width: 56px; height: 56px; border-radius: 18px; border: 0; background: var(--brand); color: var(--brand-ink); box-shadow: 0 8px 24px color-mix(in srgb, var(--brand) 40%, transparent); display: grid; place-items: center; cursor: pointer; }
.fab svg { width: 26px; height: 26px; }
@media (min-width: 900px) { .fab { display: none; } }
.desk-only { display: none; }
@media (min-width: 900px) { .desk-only { display: inline-flex; } }

/* ---------- Forms ---------- */
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { grid-column: span 2; display: flex; flex-direction: column; gap: 5px; }
.field.half { grid-column: span 1; }
.field label { font-size: 13px; font-weight: 650; color: var(--muted); }
.field .hint { font-size: 12px; color: var(--muted); }
.input, .field input:not([type=checkbox]), .field select, .field textarea {
  width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 11px; padding: 11px 12px; font-size: 15px; outline: none;
}
.field textarea { min-height: 84px; resize: vertical; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.check { display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px; cursor: pointer; background: var(--surface); }
.check input { width: 20px; height: 20px; accent-color: var(--brand); margin: 1px 0 0; flex: none; }
.check span { font-size: 14px; }
.section-label { grid-column: span 2; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--brand); margin-top: 8px; }
.search { position: relative; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.search input { padding-left: 38px; }
.form-error { background: var(--bad-soft); color: var(--bad); padding: 10px 12px; border-radius: 10px; font-size: 14px; font-weight: 600; }

/* ---------- Modal ---------- */
.overlay { position: fixed; inset: 0; z-index: 60; background: rgba(20, 26, 23, .45); display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.sheet { background: var(--bg); width: 100%; max-width: 600px; max-height: 92vh; border-radius: 22px 22px 0 0; display: flex; flex-direction: column; animation: up .2s cubic-bezier(.2, .8, .2, 1); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 10px; }
.sheet-body { padding: 4px 18px 18px; overflow-y: auto; }
.sheet-foot { padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: flex; gap: 10px; background: var(--surface); border-radius: 0 0 22px 22px; }
.sheet-foot .btn { flex: 1; }
@media (min-width: 680px) { .overlay { align-items: center; } .sheet { border-radius: 22px; } }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }

.toast-wrap { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 24px); z-index: 80; display: flex; flex-direction: column; gap: 8px; width: max-content; max-width: 92vw; }
.toast { background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 12px; font-weight: 600; font-size: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); animation: up .2s; }
.toast.bad { background: var(--bad); }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background:
  radial-gradient(90% 60% at 100% 0%, color-mix(in srgb, var(--sand) 30%, transparent), transparent 60%),
  radial-gradient(80% 60% at 0% 100%, color-mix(in srgb, var(--brand) 18%, transparent), transparent 60%), var(--bg); }
.auth-card { width: 100%; max-width: 410px; }
.auth-card .card { padding: 24px 22px; }
.auth-brand { text-align: center; margin-bottom: 22px; }
.auth-brand .wordmark { width: 100%; max-width: 300px; height: auto; margin: 0 auto 6px; display: block; }
.auth-brand img, .auth-brand .logo-fallback { width: 64px; height: 64px; border-radius: 18px; margin: 0 auto 12px; object-fit: cover; font-size: 28px; }
.auth-foot { text-align: center; margin-top: 18px; font-size: 12px; color: var(--muted); }

/* ---------- Live ---------- */
.video { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #0e1311; border-radius: 18px; overflow: hidden; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video .off { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: #c9d1cc; padding: 20px; }
.video .off svg { width: 42px; height: 42px; opacity: .5; margin-bottom: 8px; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; word-break: break-word; }
.alert { padding: 11px 13px; border-radius: 12px; font-size: 14px; display: flex; gap: 10px; align-items: flex-start; }
.alert.warn { background: var(--warn-soft); color: #7a4f10; }
.alert.bad { background: var(--bad-soft); color: #7d211d; }
.alert.info { background: var(--info-soft); color: #1d4a72; }
.alert svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }
.pre { white-space: pre-line; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 650; padding: 8px 10px; border-bottom: 1px solid var(--line); }
table.t td { padding: 10px; border-bottom: 1px solid var(--line); }
select.inline { border: 1px solid var(--line); background: var(--surface); border-radius: 9px; padding: 6px 8px; font-size: 13px; max-width: 150px; }
