/* Dimacais Church · Casa Sobre la Roca Manizales.
   Mismo sistema visual de las apps Dimacais (Inventory, Presupuesto) con la paleta azul de Casa Roca. */
:root {
  --ink: #0a1b3d;
  --ink-2: #10264f;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e3e8f2;
  --bg: #f4f7fc;
  --surface: #ffffff;
  --surface-2: #eef3fb;
  --brand: #1d5fd8;
  --brand-ink: #1a4fb5;
  --brand-soft: #e2ecff;
  --sky: #38a3f5;
  --gold: #f5b83d;
  --ok: #10b981;
  --ok-soft: #d9f7ec;
  --warn: #f59e0b;
  --warn-soft: #fef3c7;
  --danger: #ef4444;
  --danger-soft: #fee2e2;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 24px 60px rgba(10, 27, 61, 0.22);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --grad: linear-gradient(135deg, #1d4ed8 0%, #2f80ed 55%, #38bdf8 100%);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --text: #e6ecf7;
    --muted: #93a2bd;
    --line: #22314f;
    --bg: #081328;
    --surface: #0f1d38;
    --surface-2: #162746;
    --brand-soft: rgba(56, 130, 246, 0.18);
    --brand-ink: #8ab8ff;
    --ok-soft: rgba(16, 185, 129, 0.16);
    --warn-soft: rgba(245, 158, 11, 0.16);
    --danger-soft: rgba(239, 68, 68, 0.16);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --text: #e6ecf7;
  --muted: #93a2bd;
  --line: #22314f;
  --bg: #081328;
  --surface: #0f1d38;
  --surface-2: #162746;
  --brand-soft: rgba(56, 130, 246, 0.18);
  --brand-ink: #8ab8ff;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.5; -webkit-font-smoothing: antialiased; }
body.no-scroll { overflow: hidden; }
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4 { line-height: 1.15; margin: 0; letter-spacing: -0.02em; }
h1 { font-size: 24px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
h2 { font-size: 16px; font-weight: 700; }
h3 { font-size: 14px; font-weight: 700; margin: 18px 0 8px; }
p { margin: 0 0 1em; }
small, .muted { color: var(--muted); }
.small { font-size: 13px; }
.right { text-align: right; }
.grow { flex: 1; min-width: 0; }
.cap::first-letter { text-transform: uppercase; }
.nowrap { white-space: nowrap; }
.warn-text { color: color-mix(in srgb, var(--warn) 80%, var(--text)); }
[hidden], .hidden { display: none !important; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--sky) 55%, transparent); outline-offset: 2px; border-radius: 6px; }

/* ---------------------------------------------------------------- */
/* Marca                                                             */
/* ---------------------------------------------------------------- */
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 16px; color: inherit; letter-spacing: -0.02em; line-height: 1.15; }
.logo:hover { text-decoration: none; }
.logo small { display: block; font-weight: 600; font-size: 12px; color: #9fb3d6; letter-spacing: 0; }
.logo-mark { width: 40px; height: 40px; border-radius: 12px; flex: 0 0 auto; display: grid; place-items: center; background: var(--grad); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 6px 16px rgba(29, 95, 216, 0.35); }
.logo-mark img { width: 30px; height: 30px; object-fit: contain; }

/* ---------------------------------------------------------------- */
/* App                                                               */
/* ---------------------------------------------------------------- */
.app { display: grid; grid-template-columns: 256px 1fr; min-height: 100vh; min-height: 100dvh; }
.sidebar { background: var(--ink); color: #c8d5ee; padding: 18px 14px; position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.sidebar .logo { color: #fff; padding: 4px 8px 16px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 12px; color: #c8d5ee; font-weight: 600; font-size: 14.5px; }
.nav-item:hover { background: rgba(255, 255, 255, 0.06); text-decoration: none; }
.nav-item.active { background: rgba(56, 163, 245, 0.18); color: #fff; }
.nav-item.active svg { color: var(--sky); }
.nav-item .dot { margin: 0 5px; }
.nav-item .count { margin-left: auto; background: var(--gold); color: #3b2a00; font-size: 11px; font-weight: 800; border-radius: 999px; padding: 1px 7px; }
.nav-sep { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: #6f82a8; padding: 14px 12px 4px; }
.sidebar-foot { margin-top: auto; padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, 0.05); font-size: 13px; }
.sidebar-foot b { color: #fff; display: block; }
.sidebar-foot .btn { color: #c8d5ee; border-color: rgba(255, 255, 255, 0.15); margin-top: 10px; }

.main { min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 28px; position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.topbar h1 { font-size: 24px; margin: 0; }
.topbar .logo-mark { display: none; width: 34px; height: 34px; border-radius: 10px; }
.topbar .logo-mark img { width: 25px; height: 25px; }
.topbar-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-title h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { display: flex; gap: 8px; align-items: center; }

.page { padding: 4px 28px 48px; max-width: 1240px; }
.page.narrow { max-width: 800px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; max-width: 760px; }
.page-head > p { flex: 1 1 320px; margin: 0; }
.back { display: inline-block; margin-bottom: 12px; font-weight: 600; font-size: 14px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.grid { display: grid; gap: 16px; margin-bottom: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1000px) { .grid.two { grid-template-columns: 1fr; } }
.stack { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }

.bottom-nav { display: none; }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar { padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top)); }
  .topbar h1 { font-size: 20px; }
  .topbar .logo-mark { display: grid; }
  .page { padding: 4px 16px calc(100px + var(--safe-bottom)); }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--line); padding: 6px 4px calc(6px + var(--safe-bottom));
  }
  .bottom-nav a, .bottom-nav button { display: flex; flex-direction: column; align-items: center; gap: 2px; font: 600 11px var(--font); color: var(--muted); background: none; border: 0; padding: 6px 0; cursor: pointer; text-decoration: none; position: relative; }
  .bottom-nav a.active, .bottom-nav button.active { color: var(--brand-ink); }
  .bottom-nav .fab { width: 54px; height: 54px; margin: -24px auto 0; border-radius: 18px; background: var(--grad); color: #fff; display: grid; place-items: center; box-shadow: 0 10px 24px rgba(29, 95, 216, 0.4); }
  .bottom-nav .count { position: absolute; top: 2px; right: calc(50% - 20px); background: var(--gold); color: #3b2a00; font-size: 10px; font-weight: 800; border-radius: 999px; padding: 0 5px; }
}

/* ---------------------------------------------------------------- */
/* Botones y formularios                                            */
/* ---------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 12px; padding: 11px 18px;
  font: 600 15px/1 var(--font); cursor: pointer; text-decoration: none !important;
  background: var(--surface-2); color: var(--text); transition: transform 0.12s, box-shadow 0.12s, background 0.12s;
  white-space: nowrap; min-height: 44px;
}
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--grad); color: #fff; box-shadow: 0 6px 18px rgba(29, 95, 216, 0.3); }
.btn.primary:hover { box-shadow: 0 10px 26px rgba(56, 163, 245, 0.35); }
.btn.dark { background: var(--ink); color: #fff; }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.ghost.danger { background: transparent; border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.btn.small { padding: 7px 12px; min-height: 34px; font-size: 13px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn:disabled, .btn[disabled] { opacity: 0.55; pointer-events: none; }
.icon-btn { background: none; border: 0; width: 36px; height: 36px; border-radius: 10px; cursor: pointer; color: var(--muted); display: inline-grid; place-items: center; flex: 0 0 auto; text-decoration: none !important; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.wa { color: #16a34a; }
.icon-btn.wa:hover { background: color-mix(in srgb, #16a34a 14%, transparent); }
.link { border: 0; background: none; color: var(--brand-ink); font: 600 14px var(--font); cursor: pointer; padding: 0; }
.link.danger { color: var(--danger); }

.form { display: flex; flex-direction: column; gap: 4px; }
.form h2 { margin: 2px 0 12px; }
.field { display: block; margin-bottom: 12px; min-width: 0; }
.field > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--muted); }
.field small { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
input, select, textarea {
  width: 100%; font: 16px var(--font); color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; min-height: 44px; min-width: 0;
}
textarea { min-height: 84px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--sky); box-shadow: 0 0 0 4px color-mix(in srgb, var(--sky) 18%, transparent); }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); }
input[type='checkbox'] { width: 20px; height: 20px; min-height: 0; accent-color: var(--brand); flex: 0 0 auto; }
input[type='color'] { padding: 3px; height: 44px; }
input[type='file'] { padding: 8px; }
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.check { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; cursor: pointer; font-size: 14px; }
.box { border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin: 0 0 12px; }
.box legend, .box summary { font-weight: 700; font-size: 13px; padding: 0 4px; cursor: pointer; }
details.box[open] summary { margin-bottom: 12px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.form-error { background: var(--danger-soft); color: var(--danger); padding: 10px 14px; border-radius: 12px; font-size: 14px; font-weight: 600; margin-bottom: 14px; }
.code-input { letter-spacing: 10px; text-align: center; font-size: 26px; font-weight: 800; }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar > p { margin: 0; flex: 1 1 240px; }
.toolbar .search { flex: 1 1 240px; position: relative; max-width: 420px; }
.toolbar .search input { padding-left: 40px; }
.toolbar .search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.toolbar select, .toolbar input[type='month'] { width: auto; }
/* Filtros tipo pastilla (como en Inventory) */
.tabs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; max-width: 100%; padding-bottom: 2px; }
.tabs button, .tabs a { flex: 0 0 auto; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 8px 14px; font: 600 13px var(--font); color: var(--muted); cursor: pointer; text-decoration: none !important; }
.tabs .on { background: var(--ink); color: #fff; border-color: var(--ink); }
:root[data-theme='dark'] .tabs .on { background: var(--brand); border-color: var(--brand); }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .tabs .on { background: var(--brand); border-color: var(--brand); } }
/* Pestanas de un ministerio: segmento */
.tabs.big { background: var(--surface-2); padding: 4px; border-radius: 14px; gap: 4px; margin-bottom: 18px; }
.tabs.big a { border: 0; background: none; border-radius: 10px; padding: 9px 14px; font-size: 14px; }
.tabs.big a.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12); }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.inline-form .picker { flex: 2 1 220px; }
.inline-form select { flex: 1 1 180px; width: auto; }
.picker { position: relative; }
.picker-list { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); max-height: 260px; overflow-y: auto; }
.picker-list button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 10px 12px; font: 500 15px var(--font); color: var(--text); cursor: pointer; }
.picker-list button small { display: block; font-size: 12px; }
.picker-list button:hover { background: var(--surface-2); }
.pad { padding: 10px 12px; }

/* ---------------------------------------------------------------- */
/* Tarjetas, listas y tablas                                         */
/* ---------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; min-width: 0; }
.grid > .card { margin-bottom: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-head.pad { padding: 16px 20px 6px; margin: 0; }
.card-head a, .card-head .link { font-size: 13px; font-weight: 600; }
details.card summary { cursor: pointer; font-weight: 600; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); min-width: 0; color: var(--text); text-decoration: none !important; }
.kpi span { font-weight: 600; font-size: 13px; color: var(--muted); }
.kpi b { display: block; font-size: clamp(22px, 2.6vw, 28px); letter-spacing: -0.02em; font-weight: 800; }
.kpi:first-child { background: var(--grad); color: #fff; border: 0; }
.kpi:first-child span { color: rgba(255, 255, 255, 0.85); }
a.kpi:hover { transform: translateY(-1px); }
.empty { text-align: center; padding: 28px 16px; color: var(--muted); }
.empty p { margin: 0 0 10px; }
.empty svg { margin: 0 auto 10px; color: var(--line); }
.hint { background: var(--brand-soft); border-radius: 12px; padding: 10px 12px; font-size: 14px; margin: 12px 0; display: flex; flex-direction: column; gap: 4px; }
.note { background: var(--surface-2); padding: 10px 12px; border-radius: 12px; white-space: pre-wrap; margin: 12px 0 0; }
.guide { white-space: pre-wrap; font-size: 14px; line-height: 1.65; }
.banner { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 14px 16px; border-radius: 14px; background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 45%, var(--line)); margin-bottom: 16px; font-size: 14px; }

.list { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--text); min-width: 0; text-decoration: none !important; }
.card.flush .row { padding: 12px 20px; }
.list > .row:last-child, .list > .row-wrap:last-child { border-bottom: 0; }
a.row:hover b, .row a.grow:hover b { color: var(--brand-ink); }
.row b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row small { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.row.dim { opacity: 0.55; }
.row a.grow { color: var(--text); text-decoration: none; }
.row-wrap { position: relative; border-bottom: 1px solid var(--line); }
.row-wrap .row { border-bottom: 0; padding-right: 100px; }
.row-actions { position: absolute; right: 14px; top: 12px; display: flex; gap: 4px; }
.emoji { font-size: 20px; width: 30px; text-align: center; flex: 0 0 auto; }
.date-box { width: 48px; text-align: center; background: var(--brand-soft); color: var(--brand-ink); border-radius: 12px; padding: 5px 0; flex-shrink: 0; }
.date-box b { font-size: 17px; }
.date-box small { color: inherit; text-transform: capitalize; font-size: 11px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip { --c: var(--brand); display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; background: color-mix(in srgb, var(--c) 14%, transparent); color: color-mix(in srgb, var(--c) 72%, var(--text)); }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.pill.hot { background: var(--gold); color: #3b2a00; }
.pill.ok { background: var(--ok-soft); color: #059669; }
.pill.warn { background: var(--warn-soft); color: #b45309; }
.pill.bad { background: var(--danger-soft); color: var(--danger); }
.pill.brand { background: var(--brand-soft); color: var(--brand-ink); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dot.big { width: 14px; height: 14px; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tr[data-href], .table tr.clickable { cursor: pointer; }
.table tr[data-href]:hover td, .table tr.clickable:hover td { background: var(--surface-2); }
.table tr.today td { background: var(--brand-soft); }

/* ---------------------------------------------------------------- */
/* Asistencia                                                        */
/* ---------------------------------------------------------------- */
.counters { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-bottom: 8px; }
.counter { --c: var(--brand); border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; background: var(--surface); }
.counter > span { font-size: 13px; font-weight: 700; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper button { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); font-size: 20px; cursor: pointer; color: var(--text); flex-shrink: 0; }
.stepper button:active { transform: scale(0.95); }
.stepper input { text-align: center; font-weight: 800; font-size: 18px; padding: 8px 4px; }
.total-box { background: var(--grad); color: #fff; border-radius: 16px; padding: 8px 20px; text-align: center; box-shadow: 0 6px 18px rgba(29, 95, 216, 0.3); }
.total-box small { display: block; color: rgba(255, 255, 255, 0.85); font-size: 12px; font-weight: 600; }
.total-box b { font-size: 28px; }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 190px; padding-top: 10px; overflow-x: auto; }
.bar { flex: 1; min-width: 40px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; color: var(--text); height: 100%; text-decoration: none !important; }
.bar-val { font-size: 12px; font-weight: 700; }
.bar-stack { width: 100%; max-width: 44px; display: flex; flex-direction: column; border-radius: 8px 8px 3px 3px; overflow: hidden; }
.bar-label { font-size: 11px; color: var(--muted); white-space: nowrap; }
.b-cong { background: var(--grad); }
.b-serv { background: var(--gold); }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin-top: 10px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }

/* ---------------------------------------------------------------- */
/* Personas, ministerios, discipulado y documentos                   */
/* ---------------------------------------------------------------- */
.profile { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.profile > .avatar { width: 64px; height: 64px; font-size: 22px; }
.profile h1 { font-size: 26px; }
.facts { display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; margin: 0; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.timeline { list-style: none; margin: 10px 0 0; padding: 0 0 0 18px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 16px 12px; }
.timeline li::before { content: ''; position: absolute; left: -25px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--brand); border: 2px solid var(--surface); }
.tl-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.timeline p { margin: 6px 0 0; white-space: pre-wrap; font-size: 14px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.mcard { --c: var(--brand); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); color: var(--text); display: flex; flex-direction: column; gap: 8px; position: relative; overflow: hidden; text-decoration: none !important; transition: transform 0.15s; }
.mcard::before { content: ''; position: absolute; inset: 0 0 auto; height: 4px; background: var(--c); }
.mcard:hover { transform: translateY(-3px); }
.mcard-top { display: flex; align-items: center; gap: 10px; }
.mcard-top h2 { flex: 1; font-size: 18px; }
.mcard p { margin: 0; font-size: 14px; }
.mcard-stats { display: flex; gap: 14px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.mcard-stats b { color: var(--text); }
.mhead { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 16px; }
.mhead p { margin: 6px 0 0; }
.access-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; margin-bottom: 12px; }
.access-grid label { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; font-weight: 600; }
.access-grid label > span { display: flex; align-items: center; gap: 8px; }
.access-grid select { width: 180px; min-height: 38px; padding: 7px 10px; font-size: 14px; }
.linkbox { background: var(--surface-2); padding: 10px 12px; border-radius: 12px; font-family: ui-monospace, monospace; font-size: 12px; word-break: break-all; margin-bottom: 4px; }

.board { display: grid; grid-template-columns: repeat(5, minmax(210px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.col { background: var(--surface-2); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 8px; min-height: 120px; }
.col h2 { font-size: 14px; margin-bottom: 4px; }
.tile { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 5px; color: var(--text); box-shadow: var(--shadow); text-decoration: none !important; }
.tile small { font-size: 12px; }
.tile .chip { align-self: flex-start; }
.tile-wa { position: absolute; right: 8px; top: 8px; cursor: pointer; color: #16a34a; }

.docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.doc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; }
.doc-head { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.doc h3 { margin: 4px 0 0; font-size: 17px; }
.doc-body { white-space: pre-wrap; margin: 0; font-size: 14px; color: var(--muted); }
.doc-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 6px; }
.file { font-weight: 600; font-size: 14px; display: inline-flex; gap: 6px; align-items: center; }
body.reader { background: var(--bg); }
.read { max-width: 680px; margin: 0 auto; padding: 32px 20px 60px; }
.read .logo { color: var(--text); margin-bottom: 28px; }
.read .logo small { color: var(--muted); }
.read h1 { font-size: 30px; margin: 10px 0 6px; }
.read-body { white-space: pre-wrap; font-size: 17px; line-height: 1.75; margin: 24px 0; }
.read footer { margin-top: 40px; }

/* ---------------------------------------------------------------- */
/* Modales (hoja inferior en el celular), avisos y carga            */
/* ---------------------------------------------------------------- */
.modal-back { position: fixed; inset: 0; background: rgba(10, 27, 61, 0.55); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade 0.15s; }
.modal { background: var(--surface); border-radius: 22px; width: min(620px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; box-shadow: var(--shadow-lg); animation: rise 0.18s; }
.modal.wide { width: min(780px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal-head h3 { margin: 0; font-size: 18px; }
.modal-body { padding: 20px 22px; }
.modal-body > p { margin: 0 0 12px; }
@media (max-width: 640px) {
  .modal-back { align-items: flex-end; padding: 0; }
  .modal, .modal.wide { border-radius: 22px 22px 0 0; width: 100%; max-height: 92dvh; padding-bottom: var(--safe-bottom); animation: sheet 0.22s; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px) scale(0.98); } }
@keyframes sheet { from { transform: translateY(100%); } }
.toast-wrap { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(24px + var(--safe-bottom)); z-index: 70; display: flex; flex-direction: column; gap: 8px; width: min(420px, calc(100% - 32px)); }
@media (max-width: 900px) { .toast-wrap { bottom: calc(92px + var(--safe-bottom)); } }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 14px; box-shadow: var(--shadow-lg); font-weight: 600; font-size: 14px; animation: rise 0.2s; transition: opacity 0.4s, transform 0.4s; }
.toast.error { background: var(--danger); }
.toast.out { opacity: 0; transform: translateY(8px); }
.loading { display: grid; place-items: center; min-height: 50vh; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--brand); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- */
/* Entrar, registrarse y verificar el correo                        */
/* ---------------------------------------------------------------- */
.auth { min-height: 100dvh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side {
  background: radial-gradient(800px 500px at 100% 0%, rgba(56, 163, 245, 0.45), transparent 60%), radial-gradient(700px 400px at 0% 100%, rgba(29, 78, 216, 0.55), transparent 60%), var(--ink);
  color: #fff; padding: 40px; display: flex; flex-direction: column; justify-content: space-between; gap: 24px; position: relative; overflow: hidden;
}
.auth-side .logo { color: #fff; }
.auth-side .watermark { position: absolute; right: -90px; bottom: -70px; width: 420px; opacity: 0.08; pointer-events: none; }
.auth-side .hero-mark { width: 120px; margin-bottom: 26px; }
.auth-side h2 { font-size: 34px; font-weight: 800; max-width: 440px; }
.auth-side p { color: #b6c6e3; max-width: 440px; font-size: 17px; }
.auth-form { display: grid; place-items: center; padding: 32px 16px; }
.auth-box { width: min(420px, 100%); }
.auth-box h1 { font-size: 28px; margin-bottom: 6px; }
.auth-box > p { margin-bottom: 20px; }
.auth-links { margin-top: 16px; text-align: center; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.mobile-logo { display: none; margin: 0 auto 22px; width: 132px; border-radius: 22px; overflow: hidden; box-shadow: var(--shadow); }
.mobile-logo img { width: 100%; }
@media (max-width: 860px) { .auth { grid-template-columns: 1fr; } .auth-side { display: none; } .mobile-logo { display: block; } }
.strength { height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; margin: -6px 0 14px; }
.strength i { display: block; height: 100%; width: 0; transition: width 0.2s, background 0.2s; }
.done-mark { width: 64px; height: 64px; border-radius: 20px; background: var(--brand-soft); color: var(--brand-ink); display: grid; place-items: center; margin-bottom: 16px; }

/* ---------------------------------------------------------------- */
/* Celular                                                           */
/* ---------------------------------------------------------------- */
@media (max-width: 560px) {
  .cols, .access-grid { grid-template-columns: 1fr; }
  .access-grid select { width: 180px; }
  .page-head > .btn, .page-head > .actions { width: 100%; }
  .page-head > .btn { justify-content: center; }
  .counters { grid-template-columns: 1fr 1fr; }
  .stepper button { width: 38px; height: 38px; }
  .facts { grid-template-columns: 92px 1fr; }
  .docs { grid-template-columns: 1fr; }
  .row-wrap .row { padding-right: 84px; }
  .profile h1 { font-size: 22px; }
}
