/* ============================================================================
   Tema "Claro" — capa de estilo de la app de la iglesia (sobre main.css)
   Limpio y claro: fondo suave, superficies blancas, un color principal.
   Respeta los temas de color de ⚙️ Configuración (--primary, --primary-light…
   los fija aplicarTema()) y el modo oscuro (variables --surface-* de main.css).
   ============================================================================ */

:root {
  --t-radius-xl: 24px;
  --t-radius:    18px;
  --t-radius-sm: 12px;
  --t-radius-xs: 8px;
  --t-shadow-xs: 0 1px 2px rgba(15, 23, 42, .05);
  --t-shadow:    0 1px 2px rgba(15, 23, 42, .04), 0 6px 16px -8px rgba(15, 23, 42, .12);
  --t-shadow-md: 0 4px 10px -4px rgba(15, 23, 42, .12), 0 18px 36px -16px rgba(15, 23, 42, .22);
  --t-shadow-lg: 0 24px 60px -20px rgba(15, 23, 42, .35);
  --t-ring:      0 0 0 3px color-mix(in srgb, var(--primary) 28%, transparent);
  --t-ease:      cubic-bezier(.16, 1, .3, 1);
  --t-bg:        #eef1f6;
  --t-side:      linear-gradient(180deg, color-mix(in srgb, var(--primary-dark) 86%, #0b1120), color-mix(in srgb, var(--primary-dark) 58%, #0b1120));
  --t-side-tx:   rgba(255, 255, 255, .82);
  --t-side-mute: rgba(255, 255, 255, .55);
  --t-side-line: rgba(255, 255, 255, .12);
  --t-text:      var(--surface-900);
  --t-muted:     var(--surface-600);
  --t-line:      var(--surface-200);
  --t-ok:        #16a34a;  --t-ok-bg:   #dcfce7;  --t-ok-tx:   #166534;
  --t-bad:       #dc2626;  --t-bad-bg:  #fee2e2;  --t-bad-tx:  #991b1b;
  --t-warn:      #d97706;  --t-warn-bg: #fef3c7;  --t-warn-tx: #92400e;
  --sidebar-w:   248px;
}
html[data-theme="dark"] {
  --t-bg: #0b1120;
  --t-shadow-xs: 0 1px 2px rgba(0, 0, 0, .4);
  --t-shadow:    0 1px 2px rgba(0, 0, 0, .35), 0 8px 20px -10px rgba(0, 0, 0, .6);
  --t-shadow-md: 0 10px 30px -10px rgba(0, 0, 0, .7);
  --t-shadow-lg: 0 30px 70px -20px rgba(0, 0, 0, .8);
  --t-ok-bg:   rgba(22, 163, 74, .18);  --t-ok-tx:   #86efac;
  --t-bad-bg:  rgba(220, 38, 38, .18);  --t-bad-tx:  #fca5a5;
  --t-warn-bg: rgba(217, 119, 6, .18);  --t-warn-tx: #fcd34d;
}

/* ── Base ─────────────────────────────────────────────────────────────────── */
html { -webkit-text-size-adjust: 100%; }
body, input, select, textarea, button {
  font-family: 'Inter', -apple-system, 'Segoe UI', system-ui, Roboto, sans-serif;
  font-feature-settings: 'cv11', 'ss01';
}
body { background: var(--t-bg); color: var(--t-text); font-size: 14px; line-height: 1.5; }
::selection { background: color-mix(in srgb, var(--primary) 22%, transparent); }
input, textarea { caret-color: var(--primary); }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--surface-600) 45%, transparent); border-radius: 8px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--surface-600) 70%, transparent); background-clip: content-box; }
*::-webkit-scrollbar-track { background: transparent; }
:focus-visible { outline: none; box-shadow: var(--t-ring); border-radius: var(--t-radius-xs); }
strong, b { font-weight: 650; }
.num, .card-value, .monto-ingreso, .monto-egreso, .tabla td:has(> strong:only-child), .topbar-saldo { font-variant-numeric: tabular-nums; }

/* Íconos que reemplazan a los emojis en títulos, botones e insignias */
.ico-emoji { width: 1.15em; height: 1.15em; margin-right: .1em; vertical-align: -.2em; flex-shrink: 0; }
h2 > .ico-emoji, h3 > .ico-emoji { color: var(--primary); }
.btn-primary > .ico-emoji, .btn-danger > .ico-emoji, .btn-wa > .ico-emoji, .btn-hero > .ico-emoji { color: inherit; }
.badge > .ico-emoji { width: 1em; height: 1em; margin-right: .15em; }
.ico-punto { display: inline-block; width: .6em; height: .6em; border-radius: 50%; margin-right: .4em; vertical-align: .05em; }
/* Íconos SVG en línea (menú, barra, tarjetas) */
.ico { width: 1.25em; height: 1.25em; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; }

/* ── Barra lateral (oscura, flotante, con el color del tema) ─────────────── */
.sidebar {
  width: var(--sidebar-w);
  margin: 16px 0 16px 16px; height: calc(100vh - 32px);
  background: var(--t-side); color: var(--t-side-tx);
  border: none; border-radius: var(--t-radius-xl);
  box-shadow: 0 18px 40px -18px color-mix(in srgb, var(--primary-dark) 55%, transparent);
  overflow: hidden;
}
.sidebar-logo {
  padding: 22px 18px 18px !important;
  background: transparent !important;
  border-bottom: 1px solid var(--t-side-line);
  display: grid; grid-template-columns: 44px 1fr; column-gap: 12px; row-gap: 1px; align-items: center; text-align: left;
}
.sidebar-logos { margin: 0 !important; grid-row: 1 / 3; }
.sidebar-logo h1 { grid-column: 2; align-self: end; }
.sidebar-logo p  { grid-column: 2; align-self: start; }
.sidebar-logos img { height: 44px !important; width: 44px; object-fit: contain; border-radius: 12px; background: #fff; padding: 5px; }
.sidebar-logo h1 { font-size: 14px !important; line-height: 1.25; font-weight: 700; color: #fff !important; letter-spacing: -.01em; }
.sidebar-logo h1 br { display: none; }
.sidebar-logo p  { font-size: 12px !important; color: var(--t-side-mute) !important; margin-top: 2px; }

.nav { padding: 12px 12px 16px; gap: 0; overflow-y: auto; }
.nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .25); background-clip: content-box; }
.nav-grupo { margin-top: 12px; }
.nav-grupo:first-child { margin-top: 2px; }
.nav-grupo-header {
  padding: 6px 12px; margin: 0;
  font-size: 11px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase;
  color: var(--t-side-mute); border-radius: var(--t-radius-xs);
}
.nav-grupo-header:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-grupo-header .chevron { display: inline-flex; color: var(--t-side-mute); transition: transform .2s var(--t-ease); }
.nav-grupo-header .chevron .ico { width: 14px; height: 14px; }
.nav-grupo.colapsado .nav-grupo-items { display: none; }
.nav-grupo.colapsado .nav-grupo-header .chevron { transform: rotate(-90deg); }
.nav-grupo-items { display: flex; flex-direction: column; gap: 2px; }
.nav-grupo-items .nav-link { padding-left: 12px; font-size: 14px; }
.nav-link {
  display: flex; align-items: center; gap: 11px;
  color: var(--t-side-tx); font-weight: 500; font-size: 14px;
  padding: 10px 12px; border-radius: var(--t-radius-sm);
  margin: 0; border: none; cursor: pointer; position: relative;
  transition: background .15s, color .15s, box-shadow .15s;
}
.nav-link .icon { display: inline-flex; width: 22px; justify-content: center; color: var(--t-side-mute); font-size: 16px; transition: color .15s; }
.nav-link .icon .ico { width: 19px; height: 19px; }
.nav-link:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav-link:hover .icon { color: #fff; }
.nav-link.active { background: #fff; color: var(--primary-dark); font-weight: 650; box-shadow: 0 6px 16px -6px rgba(0, 0, 0, .35); }
.nav-link.active .icon { color: var(--primary); }
html[data-theme="dark"] .nav-link.active { background: #fff; color: var(--primary-dark); }
html[data-theme="dark"] .nav-link.active .icon { color: var(--primary); }

.sidebar-user { border-top: 1px solid var(--t-side-line); padding: 14px; display: flex; align-items: center; gap: 10px; background: transparent; }
.user-avatar { width: 38px; height: 38px; border-radius: 12px; font-weight: 700; font-size: 15px; box-shadow: none; display: flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0; border: 1px solid rgba(255, 255, 255, .25); }
.user-info { min-width: 0; }
.user-nombre { color: #fff !important; font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-rol { color: var(--t-side-mute) !important; font-size: 12px; }

/* ── Barra superior ───────────────────────────────────────────────────────── */
.topbar {
  height: 72px; padding: 0 32px;
  background: color-mix(in srgb, var(--t-bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: none;
  box-shadow: none; display: flex; align-items: center; gap: 14px;
  position: sticky; top: 0; z-index: 50;
}
.topbar-titulo { font-size: 16px; font-weight: 700; color: var(--t-text); letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-info { color: var(--t-muted); font-weight: 450; font-size: 13px; white-space: nowrap; }
.topbar-info::first-letter { text-transform: uppercase; }
.topbar-sep { width: 1px; height: 22px; background: var(--t-line); }
.topbar-acciones { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.topbar-saldo {
  background: var(--primary-light); color: var(--primary-dark);
  padding: 7px 13px; border-radius: 999px; font-weight: 650; font-size: 13px; white-space: nowrap;
}
.topbar-saldo:empty { display: none; }
html[data-theme="dark"] .topbar-saldo { background: color-mix(in srgb, var(--primary) 22%, transparent); color: #e0e7ff; }
.btn-logout, .btn-icono {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 42px; min-width: 42px; padding: 0 12px;
  background: var(--surface-0); border: 1px solid transparent; color: var(--surface-700);
  border-radius: 999px; font-weight: 600; font-size: 13.5px; cursor: pointer; box-shadow: var(--t-shadow-xs);
  transition: background .15s, border-color .15s, color .15s;
}
.btn-logout:hover, .btn-icono:hover { background: var(--surface-50); border-color: var(--surface-300); color: var(--t-text); }
.btn-icono .ico { width: 18px; height: 18px; }
.btn-logout .ico { width: 17px; height: 17px; }

#contenido { padding: 6px 32px 44px; }

/* ── Encabezado de página ────────────────────────────────────────────────── */
.page-header { margin-bottom: 20px; gap: 14px; align-items: center; flex-wrap: wrap; }
.header-actions > input[type="text"], .header-actions > input[type="search"] { flex: 0 1 260px !important; width: auto !important; }
.page-header h2 { font-size: 26px; font-weight: 750; letter-spacing: -.02em; color: var(--t-text); line-height: 1.2; text-wrap: balance; }
.page-header h2 a { text-decoration: none; }
.fecha-hoy { color: var(--t-muted); font-weight: 450; }
.header-actions { gap: 8px; }
.header-actions input, .header-actions select { height: 40px; width: auto; min-width: 180px; }
.header-actions input[type="date"], .header-actions input[type="number"] { min-width: 0; }
.topbar:has(.topbar-info:empty) .topbar-sep { display: none; }

/* ── Tarjetas de resumen ─────────────────────────────────────────────────── */
.cards-grid { gap: 14px; margin-bottom: 20px; }
.card {
  display: flex; align-items: center; gap: 16px;
  background: var(--surface-0); border: 1px solid transparent;
  border-radius: var(--t-radius); box-shadow: var(--t-shadow);
  padding: 18px 20px;
  transition: box-shadow .2s var(--t-ease), transform .2s var(--t-ease), border-color .2s;
}
.card:hover { box-shadow: var(--t-shadow-md); transform: translateY(-1px); border-color: transparent; }
/* Sin franjas gruesas de color: la tarjeta se distingue por el ícono y el dato. */
.card-saldo, .card-ingreso, .card-egreso, .card-mes { border-top: 1px solid transparent; }
.card[style*="border-left"], .panel[style*="border-left"] { border-left-width: 1px !important; border-left-color: var(--t-line) !important; }
.card-icon {
  width: 48px; height: 48px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px; font-size: 22px;
  background: var(--primary-light); color: var(--primary-dark);
}
.card-icon .ico { width: 22px; height: 22px; }
.card-saldo   .card-icon { background: var(--primary-light); color: var(--primary-dark); }
.card-ingreso .card-icon { background: var(--t-ok-bg);  color: var(--t-ok-tx); }
.card-egreso  .card-icon { background: var(--t-bad-bg); color: var(--t-bad-tx); }
.card-mes     .card-icon { background: var(--t-warn-bg); color: var(--t-warn-tx); }
html[data-theme="dark"] .card-icon { background: color-mix(in srgb, var(--primary) 20%, transparent); color: #c7d2fe; }
.card-data { min-width: 0; }
.card-label { color: var(--t-muted); font-size: 12px; font-weight: 550; text-transform: none; letter-spacing: 0; }
.card-value { color: var(--t-text); font-weight: 750; font-size: 24px; line-height: 1.15; margin-top: 3px; letter-spacing: -.02em; }
.card-sub   { color: var(--t-muted); font-size: 12.5px; margin-top: 3px; }
a.card-sub, .card-sub[onclick] { color: var(--primary) !important; font-weight: 550; }

/* ── Paneles y tarjetas de formulario ───────────────────────────────────── */
.panel, .form-card {
  background: var(--surface-0); border: 1px solid transparent;
  border-radius: var(--t-radius); box-shadow: var(--t-shadow);
  padding: 22px 24px; margin-bottom: 18px;
}
html[data-theme="dark"] .panel, html[data-theme="dark"] .form-card, html[data-theme="dark"] .card { border-color: var(--surface-100); }
.panel h3, .form-card h3 {
  font-size: 15px; font-weight: 650; color: var(--t-text); letter-spacing: -.01em;
  margin: 0 0 14px; padding: 0; border: none;
}
.panel > h3:first-child, .form-card > h3:first-child { margin-top: -2px; }
.panel .panel, .form-card .form-card { box-shadow: none; }
.empty { color: var(--t-muted); text-align: center; padding: 34px 16px; font-size: 14px; background: var(--surface-50); border: 1px dashed var(--t-line); border-radius: var(--t-radius-sm); }
.cargando { color: var(--t-muted); padding: 40px; text-align: center; }

/* ── Botones ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 40px; padding: 0 16px;
  border-radius: var(--t-radius-sm); font-weight: 600; font-size: 14px; line-height: 1;
  border: 1px solid transparent; cursor: pointer;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .08s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: default; transform: none; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 1px 2px color-mix(in srgb, var(--primary) 45%, transparent); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-outline { background: var(--surface-0); border-color: var(--surface-300); color: var(--surface-700); }
.btn-outline:hover { background: var(--surface-50); border-color: var(--surface-600); color: var(--t-text); }
.btn-danger { background: var(--t-bad); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-block { width: 100%; }
.btn-sm {
  display: inline-flex; align-items: center; gap: 5px;
  height: 32px; padding: 0 10px; border-radius: var(--t-radius-xs);
  font-size: 13px; font-weight: 600; line-height: 1;
  border: 1px solid var(--t-line); background: var(--surface-0); color: var(--surface-700);
  cursor: pointer; transition: background .15s, border-color .15s;
}
.btn-sm:hover { background: var(--surface-50); border-color: var(--surface-300); }
.btn-sm.btn-danger { background: var(--t-bad-bg); color: var(--t-bad-tx); border-color: transparent; }
.btn-sm.btn-danger:hover { background: #fecaca; }
.btn-sm.btn-primary { background: var(--primary); color: #fff; border-color: transparent; }
.btn-sm.btn-primary:hover { background: var(--primary-hover); }
html[data-theme="dark"] .btn-outline, html[data-theme="dark"] .btn-sm { background: var(--surface-0); border-color: var(--surface-300); color: var(--surface-700); }
html[data-theme="dark"] .btn-sm.btn-danger:hover { background: rgba(220, 38, 38, .3); }

/* ── Tablas ──────────────────────────────────────────────────────────────── */
.tabla { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13.5px; }
.tabla thead th {
  background: transparent; color: var(--t-muted);
  font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  padding: 8px 12px 10px; border-bottom: 1px solid var(--t-line); text-align: left; white-space: nowrap;
}
.tabla tbody td { padding: 12px; border-bottom: 1px solid var(--surface-100); vertical-align: middle; }
.tabla tbody tr:last-child td { border-bottom: none; }
.tabla tbody tr { transition: background .12s; }
.tabla tbody tr:hover { background: var(--surface-50); }
.tabla tfoot td, .tabla .total-row td { font-weight: 650; background: var(--surface-50); border-top: 1px solid var(--t-line); }
.tabla .row-ingreso, .tabla .row-egreso { border-left: none; }
.tabla .row-ingreso td:first-child, .tabla .row-egreso td:first-child { position: relative; padding-left: 18px; }
.tabla .row-ingreso td:first-child::before, .tabla .row-egreso td:first-child::before {
  content: ''; position: absolute; left: 6px; top: 50%; width: 6px; height: 6px; border-radius: 50%; transform: translateY(-50%);
}
.tabla .row-ingreso td:first-child::before { background: var(--t-ok); }
.tabla .row-egreso  td:first-child::before { background: var(--t-bad); }
.monto-ingreso { color: var(--t-ok-tx); }
.monto-egreso  { color: var(--t-bad-tx); }
html[data-theme="dark"] .tabla tbody tr:hover { background: var(--surface-100); }
html[data-theme="dark"] .tabla tbody td { border-color: var(--surface-100); }

/* ── Insignias ───────────────────────────────────────────────────────────── */
.badge, .rol-badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; line-height: 1.5; white-space: nowrap;
  background: var(--surface-100); color: var(--surface-700);
}
.badge-ingreso { background: var(--t-ok-bg);  color: var(--t-ok-tx); }
.badge-egreso  { background: var(--t-bad-bg); color: var(--t-bad-tx); }

/* ── Formularios ─────────────────────────────────────────────────────────── */
.form-grid { gap: 14px 16px; }
.form-group { margin-bottom: 0; }
.form-group label { display: block; font-weight: 550; font-size: 13px; color: var(--surface-700); margin-bottom: 6px; text-transform: none; letter-spacing: 0; }
.form-group input, .form-group select, .form-group textarea,
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="time"], input[type="tel"], input[type="search"], select, textarea {
  width: 100%; height: 40px; border-radius: var(--t-radius-sm); border: 1px solid var(--surface-300);
  padding: 0 12px; font-size: 14px; background: var(--surface-0); color: var(--t-text);
  transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; min-height: 88px; padding: 10px 12px; line-height: 1.5; resize: vertical; }
select { padding-right: 34px; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat; background-position: right 11px center; }
input[type="checkbox"], input[type="radio"] { width: 17px; height: 17px; accent-color: var(--primary); cursor: pointer; }
input:hover, select:hover, textarea:hover { border-color: var(--surface-600); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--t-ring); }
input::placeholder, textarea::placeholder { color: var(--surface-600); opacity: .8; }
input[readonly] { background: var(--surface-50); }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.form-group small { color: var(--t-muted); display: block; margin-top: 5px; }

/* ── Modales ─────────────────────────────────────────────────────────────── */
.modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal.hidden { display: none; }
.modal-overlay { position: absolute; inset: 0; background: rgba(15, 23, 42, .45); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.modal-content {
  position: relative; width: 100%; max-width: 560px; max-height: calc(100vh - 40px);
  display: flex; flex-direction: column;
  background: var(--surface-0); border: 1px solid var(--t-line);
  border-radius: var(--t-radius-xl); box-shadow: var(--t-shadow-lg); overflow: hidden;
  animation: t-modal .32s var(--t-ease) both;
}
@keyframes t-modal { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
.modal-large { max-width: 860px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--t-line); }
.modal-header h3 { font-size: 17px; font-weight: 700; letter-spacing: -.01em; color: var(--t-text); margin: 0; }
.modal-header button {
  width: 34px; height: 34px; border-radius: var(--t-radius-xs); border: none; background: transparent;
  color: var(--t-muted); font-size: 18px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.modal-header button:hover { background: var(--surface-100); color: var(--t-text); }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-body .form-group { margin-bottom: 14px; }
.modal-body .form-grid .form-group { margin-bottom: 0; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--t-line); background: var(--surface-50); }
html[data-theme="dark"] .modal-footer { background: var(--surface-0); }

/* ── Login ───────────────────────────────────────────────────────────────── */
.login-screen { background: var(--t-bg); }
.login-card {
  width: 460px; padding: 48px 52px; box-shadow: none; border-right: 1px solid var(--t-line);
  background: var(--surface-0);
}
.login-logos { justify-content: flex-start; margin-bottom: 28px; }
.login-logos img { height: 48px !important; width: 48px; object-fit: contain; border-radius: 14px; background: var(--primary-light); padding: 6px; }
.login-titulo { font-size: 24px; font-weight: 750; letter-spacing: -.02em; text-align: left; margin-bottom: 4px; text-wrap: balance; }
.login-sub { text-align: left; font-size: 14px; color: var(--t-muted); margin-bottom: 28px; }
.login-divider { display: none; }
#login-form .form-group { margin-bottom: 16px; }
#login-form input { height: 46px; font-size: 15px; }
#login-form .btn-primary { height: 48px; font-size: 15px; margin-top: 6px; }
.login-error { border-radius: var(--t-radius-sm); border: none; background: var(--t-bad-bg); color: var(--t-bad-tx); font-weight: 500; }
.login-links { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; font-size: 13.5px; }
.login-links a { color: var(--primary); text-decoration: none; font-weight: 550; }
.login-links a:hover { text-decoration: underline; }
.login-version { margin-top: 40px; color: var(--surface-600); font-size: 12px; text-align: left; }
.login-foto { background: var(--grad, linear-gradient(135deg, var(--primary-dark), var(--primary))); }
.login-foto::after {
  background:
    radial-gradient(70% 60% at 85% 10%, rgba(255, 255, 255, .22), transparent 60%),
    radial-gradient(60% 50% at 10% 95%, rgba(0, 0, 0, .28), transparent 60%);
}
.login-foto-texto { bottom: 56px; left: 56px; right: 56px; text-shadow: 0 2px 14px rgba(0, 0, 0, .35); max-width: 560px; }
.login-foto-texto h2 { font-size: clamp(26px, 3.2vw, 40px); font-weight: 750; letter-spacing: -.02em; line-height: 1.1; margin-bottom: 12px; text-wrap: balance; }
.login-foto-texto p  { font-size: 16px; opacity: .92; line-height: 1.5; max-width: 46ch; }
.login-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.login-chips span { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .22); font-size: 13px; font-weight: 550; backdrop-filter: blur(6px); }
.login-chips .ico { width: 15px; height: 15px; }

/* ── Inicio: mosaico con degradado + indicadores + listas ─────────────────── */
.dash-top { display: grid; grid-template-columns: minmax(300px, 1.25fr) 1fr 1fr; grid-auto-rows: minmax(118px, auto); gap: 16px; margin-bottom: 18px; }
.hero {
  grid-row: 1 / 3; position: relative; overflow: hidden;
  border-radius: var(--t-radius); padding: 26px 28px; color: #fff;
  background: var(--grad, linear-gradient(135deg, var(--primary-dark), var(--primary)));
  box-shadow: 0 18px 40px -18px color-mix(in srgb, var(--primary-dark) 60%, transparent);
  display: flex; flex-direction: column; justify-content: space-between; gap: 18px; min-height: 252px;
}
.hero::before { content: ''; position: absolute; inset: 0; background: radial-gradient(70% 70% at 90% 0%, rgba(255, 255, 255, .22), transparent 60%), radial-gradient(50% 50% at 0% 100%, rgba(0, 0, 0, .22), transparent 60%); pointer-events: none; }
.hero > * { position: relative; }
.hero-saludo { font-size: 14px; font-weight: 500; opacity: .9; }
.hero-titulo { font-size: clamp(22px, 2.2vw, 30px); font-weight: 750; letter-spacing: -.02em; line-height: 1.12; margin-top: 4px; text-wrap: balance; }
.hero-fecha { font-size: 13.5px; opacity: .85; margin-top: 8px; }
.hero-prox { display: flex; align-items: center; gap: 14px; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .22); border-radius: 14px; padding: 12px 14px; backdrop-filter: blur(6px); }
.hero-prox .fecha-badge { background: #fff; border-color: #fff; }
.hero-prox .fecha-badge .m { color: var(--primary); }
.hero-prox .fecha-badge .d { color: var(--primary-dark); }
.hero-prox-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; opacity: .85; font-weight: 600; }
.hero-prox-tit { font-size: 16px; font-weight: 700; margin-top: 2px; line-height: 1.2; }
.hero-prox-sub { font-size: 13px; opacity: .88; margin-top: 2px; }
.hero-acciones { display: flex; gap: 8px; flex-wrap: wrap; }
.hero .btn-hero { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 999px; background: #fff; color: var(--primary-dark); font-weight: 650; font-size: 13.5px; border: none; cursor: pointer; }
.hero .btn-hero.ghost { background: rgba(255, 255, 255, .16); color: #fff; border: 1px solid rgba(255, 255, 255, .3); }
.hero .btn-hero:hover { filter: brightness(.96); }

.stat {
  background: var(--surface-0); border-radius: var(--t-radius); box-shadow: var(--t-shadow);
  padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; min-width: 0; cursor: default;
  transition: box-shadow .2s var(--t-ease), transform .2s var(--t-ease);
}
.stat[onclick] { cursor: pointer; }
.stat[onclick]:hover { box-shadow: var(--t-shadow-md); transform: translateY(-1px); }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stat-label { font-size: 13px; color: var(--t-muted); font-weight: 550; }
.stat-icon { width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--primary-light); color: var(--primary-dark); }
.stat-icon .ico { width: 17px; height: 17px; }
.stat-icon.ok   { background: var(--t-ok-bg);   color: var(--t-ok-tx); }
.stat-icon.bad  { background: var(--t-bad-bg);  color: var(--t-bad-tx); }
.stat-icon.warn { background: var(--t-warn-bg); color: var(--t-warn-tx); }
.stat-icon.violet { background: #ede9fe; color: #6d28d9; }
html[data-theme="dark"] .stat-icon:not(.ok):not(.bad):not(.warn):not(.violet) { background: color-mix(in srgb, var(--primary) 22%, transparent); color: #c7d2fe; }
html[data-theme="dark"] .stat-icon.violet { background: rgba(109, 40, 217, .25); color: #c4b5fd; }
.stat-value { font-size: 28px; font-weight: 750; letter-spacing: -.02em; line-height: 1.05; color: var(--t-text); font-variant-numeric: tabular-nums; }
.stat-value.txt { font-size: 18px; line-height: 1.2; }
.stat-sub { font-size: 12.5px; color: var(--t-muted); }
.stat-sub.ok { color: var(--t-ok-tx); font-weight: 550; }

.dash-cols { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 18px; align-items: start; }
.dash-cols > div { min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.panel-head h3 { margin: 0 !important; }
.panel-head a, .link { color: var(--primary); font-weight: 600; font-size: 13.5px; cursor: pointer; text-decoration: none; }
.panel-head a:hover, .link:hover { text-decoration: underline; }
.panel.flush { padding: 0; overflow: hidden; }
.panel.flush .panel-head { padding: 18px 22px 0; margin-bottom: 10px; }
.panel.flush .tabla thead th:first-child, .panel.flush .tabla tbody td:first-child { padding-left: 22px; }
.panel.flush .tabla thead th:last-child,  .panel.flush .tabla tbody td:last-child  { padding-right: 22px; }
.panel.flush .tabla thead th { background: var(--surface-50); border-bottom: 1px solid var(--t-line); padding-top: 10px; padding-bottom: 10px; }
.panel.flush .tabla tbody tr:last-child td { border-bottom: none; }
.panel.flush .empty { margin: 0 22px 20px; }

.ev-list { display: flex; flex-direction: column; }
.ev { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--surface-100); }
.ev:last-child { border-bottom: none; padding-bottom: 2px; }
.ev:first-child { padding-top: 2px; }
.fecha-badge {
  width: 48px; height: 48px; flex-shrink: 0; border-radius: 12px;
  background: var(--surface-50); border: 1px solid var(--t-line);
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1;
}
.fecha-badge .m { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--t-muted); }
.fecha-badge .d { font-size: 19px; font-weight: 750; color: var(--t-text); margin-top: 2px; font-variant-numeric: tabular-nums; }
.fecha-badge.hoy { background: var(--primary); border-color: var(--primary); }
.fecha-badge.hoy .m, .fecha-badge.hoy .d { color: #fff; }
.ev-info { min-width: 0; flex: 1; }
.ev-tit { font-weight: 650; font-size: 14px; color: var(--t-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-sub { font-size: 12.5px; color: var(--t-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-right { flex-shrink: 0; }
.btn-wa { display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 11px; border-radius: 999px; border: none; background: #25D366; color: #fff; font-weight: 650; font-size: 12.5px; cursor: pointer; }
.btn-wa:hover { filter: brightness(.95); }
.btn-wa .ico { width: 15px; height: 15px; }

/* ── Elección: lista de cargos con casillas ─────────────────────────────── */
.ele-cargos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.ele-chk { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--t-line); border-radius: var(--t-radius-sm); background: var(--surface-50); cursor: pointer; font-size: 14px; font-weight: 500; transition: background .15s, border-color .15s; }
.ele-chk:hover { border-color: var(--surface-300); }
.ele-chk:has(input:checked) { background: var(--primary-light); border-color: var(--primary); color: var(--primary-dark); font-weight: 600; }
html[data-theme="dark"] .ele-chk:has(input:checked) { background: color-mix(in srgb, var(--primary) 22%, transparent); color: #e0e7ff; }

/* ── Avisos y recuadros de ayuda en línea ────────────────────────────────── */
.aviso { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--t-radius-sm); font-size: 13.5px; background: var(--primary-light); color: var(--primary-dark); }
html[data-theme="dark"] .aviso { background: color-mix(in srgb, var(--primary) 18%, transparent); color: #e0e7ff; }

/* ── Movimiento ──────────────────────────────────────────────────────────── */
#contenido > * { animation: t-entra .36s var(--t-ease) both; }
@keyframes t-entra { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 980px) {
  .topbar { padding: 0 12px 0 6px; height: 58px; gap: 8px; }
  .topbar-info, .topbar-sep { display: none; }
  .topbar-menu-btn { width: 42px; height: 42px; border-radius: var(--t-radius-sm); }
  .sidebar { width: 288px; margin: 0; height: 100vh; border-radius: 0 var(--t-radius-xl) var(--t-radius-xl) 0; }
  .sidebar.abierto { box-shadow: var(--t-shadow-lg); }
  .topbar { padding: 0 12px 0 6px; height: 60px; }
  #contenido { padding: 4px 14px 32px; }
  .dash-top { grid-template-columns: 1fr 1fr; grid-auto-rows: auto; gap: 12px; }
  .hero { grid-column: 1 / -1; grid-row: auto; min-height: 0; padding: 20px; }
  .dash-cols { grid-template-columns: 1fr; gap: 14px; }
  .app-overlay.visible { background: rgba(15, 23, 42, .45); backdrop-filter: blur(2px); }
  .page-header { flex-direction: column; align-items: stretch; gap: 10px; }
  .page-header h2 { font-size: 20px; }
  .header-actions input, .header-actions select { flex: 1 1 160px; min-width: 0; }
  .card { padding: 16px; }
  .card-value { font-size: 21px; }
  .panel, .form-card { padding: 16px; border-radius: var(--t-radius-sm); }
  .modal { padding: 0; align-items: flex-end; }
  .modal-content { max-height: 92vh; border-radius: var(--t-radius-xl) var(--t-radius-xl) 0 0; border-bottom: none; }
  .modal-body { padding: 18px; }
  .modal-header, .modal-footer { padding-left: 18px; padding-right: 18px; }
  .btn-logout span.txt { display: none; }
  .login-screen { display: block; overflow-y: auto; }
  .login-card { width: 100%; min-height: 100%; padding: 40px 24px; border-right: none; justify-content: flex-start; padding-top: 14vh; }
  .login-foto { display: none; }
}
@media (max-width: 600px) {
  .btn, .btn-primary, .btn-outline { height: 42px; }
  .header-actions .btn { flex: 1 1 auto; }
  .topbar-saldo { display: none; }
  .dash-top { grid-template-columns: 1fr; }
  .stat-value { font-size: 24px; }
}

/* ── Impresión: sin cromo de la app ──────────────────────────────────────── */
@media print {
  body { background: #fff; }
  .sidebar, .topbar, .header-actions, .btn, .btn-sm, .btn-wa, .hero-acciones { display: none !important; }
  .panel, .form-card, .card { box-shadow: none; border-color: #ddd; break-inside: avoid; }
  #contenido > * { animation: none; }
}
