/* ============================================================
   Eventos Link Advance — Estilos de aplicación
   ============================================================ */

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--page);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .font-title { font-family: var(--font-title); color: var(--text-strong); letter-spacing: -.01em; }
a { color: var(--primary); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
.mono { font-family: var(--font-mono); }
[hidden] { display: none !important; }

/* ---------- Utilidades ---------- */
.muted { color: var(--text-muted); }
.strong { color: var(--text-strong); font-weight: 700; }
.row { display: flex; align-items: center; gap: 12px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.grid { display: grid; gap: 20px; }
.text-center { text-align: center; }
.nowrap { white-space: nowrap; }

/* ============================================================
   BOTONES (pill)
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  padding: 10px 20px;
  font-weight: 600; font-size: 14px;
  background: var(--surface-2); color: var(--text);
  transition: background var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast), border-color var(--t-fast);
  white-space: nowrap;
}
.btn:hover { background: var(--border); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.btn .ico { width: 18px; height: 18px; }

.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-brand); }
.btn-primary:hover { background: var(--primary-hover); }

.btn-ghost { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { filter: brightness(.95); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(.95); }
.btn-warning { background: var(--warning); color: #4a3410; }

.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-icon { padding: 8px; border-radius: var(--r-pill); background: transparent; color: var(--text-muted); }
.btn-icon:hover { background: var(--surface-2); color: var(--primary); }
.btn-block { width: 100%; }

/* Botones de acción de fila */
.act-btn {
  width: 34px; height: 34px; border-radius: var(--r-pill);
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-muted);
  transition: all var(--t-fast);
}
.act-btn:hover { color: #fff; }
.act-btn.view:hover  { background: var(--blue-500); border-color: var(--blue-500); }
.act-btn.qr:hover    { background: var(--text-strong); border-color: var(--text-strong); }
.act-btn.cred:hover  { background: var(--blue-700); border-color: var(--blue-700); }
.act-btn.edit:hover  { background: var(--warning); border-color: var(--warning); color: #4a3410; }
.act-btn.del:hover   { background: var(--danger); border-color: var(--danger); }
.act-btn .ico { width: 17px; height: 17px; }

/* ============================================================
   CHIPS / BADGES
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 11px; border-radius: var(--r-pill);
  font-size: 12px; font-weight: 600; line-height: 1.6;
  background: var(--surface-2); color: var(--text);
  border: 1px solid transparent;
}
.badge-blue    { background: var(--blue-50);   color: var(--blue-700); }
.badge-success { background: var(--success-bg); color: #0f7a41; }
.badge-warning { background: var(--warning-bg); color: #9a6a08; }
.badge-danger  { background: var(--danger-bg);  color: #b5312d; }
.badge-muted   { background: var(--surface-2);  color: var(--text-muted); }
.badge-solid   { background: var(--primary);    color: #fff; }
.badge .ico { width: 13px; height: 13px; }

/* ============================================================
   TARJETAS
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-card);
}
.card-pad { padding: 22px 24px; }
.card-head {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 24px; border-bottom: 1px solid var(--border);
}
.card-head h3 { font-size: 16px; }

/* ============================================================
   INPUTS / FORM
   ============================================================ */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text-strong); }
.field label .req { color: var(--danger); }
.input, .select, textarea.input {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  padding: 10px 14px;
  font: inherit; font-size: 14px;
  background: var(--surface); color: var(--text);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.input:focus, .select:focus, textarea.input:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(80,137,196,.25);
}
.input::placeholder { color: var(--text-muted); }
textarea.input { resize: vertical; min-height: 72px; }
.input-icon { position: relative; }
.input-icon .ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--text-muted); }
.input-icon .input { padding-left: 42px; }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch .track {
  width: 42px; height: 24px; border-radius: var(--r-pill);
  background: var(--border-strong); position: relative; transition: background var(--t-fast); flex: none;
}
.switch .track::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%; background: #fff;
  transition: transform var(--t-fast); box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::after { transform: translateX(18px); }

.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 20px; }
.form-grid .col-2 { grid-column: span 2; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } .form-grid .col-2 { grid-column: span 1; } }

.form-section-title {
  font-family: var(--font-title); font-size: 14px; font-weight: 700;
  color: var(--primary); text-transform: uppercase; letter-spacing: .04em;
  margin: 8px 0 4px;
}

/* ============================================================
   LOGIN
   ============================================================ */
#login-view {
  min-height: 100vh; display: grid; grid-template-columns: 1fr 480px;
}
#login-hero {
  background: var(--brand-gradient); position: relative; overflow: hidden;
  display: flex; align-items: flex-end; padding: 48px; color: #fff;
}
#login-hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.14), transparent 55%);
}
#login-hero .hero-txt { position: relative; z-index: 1; max-width: 440px; }
#login-hero .hero-txt h1 { color: #fff; font-size: 34px; line-height: 1.15; }
#login-hero .hero-txt p { opacity: .9; margin-top: 12px; font-size: 16px; }
#login-hero .hero-badge {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 20px;
  background: rgba(255,255,255,.15); backdrop-filter: blur(6px);
  padding: 8px 16px; border-radius: var(--r-pill); font-weight: 700; font-family: var(--font-title);
}
#login-panel { display: flex; align-items: center; justify-content: center; padding: 40px; }
#login-panel .box { width: 100%; max-width: 360px; }
#login-panel h2 { font-size: 24px; }
#login-panel .sub { color: var(--text-muted); margin: 6px 0 28px; }
#login-panel .field { margin-bottom: 16px; }
#login-err { color: var(--danger); font-size: 13px; margin-top: 4px; min-height: 18px; }
@media (max-width: 860px) { #login-view { grid-template-columns: 1fr; } #login-hero { display: none; } }

/* ============================================================
   SHELL (sidebar + topbar)
   ============================================================ */
#app-view { display: none; min-height: 100vh; }
#app-view.active { display: block; }

.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--sidebar-bg), var(--sidebar-bg-2));
  color: var(--sidebar-text); display: flex; flex-direction: column;
  z-index: 40; transition: width var(--t);
}
.sidebar .brand {
  height: var(--topbar-h); display: flex; align-items: center; gap: 10px;
  padding: 0 20px; flex: none; border-bottom: 1px solid rgba(255,255,255,.06);
}
.sidebar .brand .logo {
  width: 34px; height: 34px; border-radius: 10px; background: var(--brand-gradient);
  display: grid; place-items: center; color: #fff; flex: none;
}
.sidebar .brand .logo .ico { width: 20px; height: 20px; }
.sidebar .brand b { font-family: var(--font-title); font-size: 18px; color: #fff; }
.sidebar .brand b span { color: var(--blue-300); }

.side-nav { flex: 1; overflow-y: auto; padding: 12px 12px 24px; }
.side-nav::-webkit-scrollbar { width: 6px; }
.side-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 6px; }

.nav-group { margin-bottom: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 10px 14px; border-radius: var(--r-md); border: none; background: transparent;
  color: var(--sidebar-text); font-size: 14px; font-weight: 600; text-align: left;
  transition: background var(--t-fast), color var(--t-fast);
}
.nav-item:hover { background: var(--sidebar-hover); color: #fff; }
.nav-item.active { background: var(--sidebar-active); color: #fff; box-shadow: var(--shadow-brand); }
.nav-item .ico { width: 19px; height: 19px; flex: none; }
.nav-item .chev { margin-left: auto; width: 16px; height: 16px; transition: transform var(--t-fast); }
.nav-group.open > .nav-item .chev { transform: rotate(90deg); }

.nav-sub { max-height: 0; overflow: hidden; transition: max-height var(--t); }
.nav-group.open .nav-sub { max-height: 400px; }
.nav-sub a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px 8px 44px; border-radius: var(--r-sm);
  color: var(--sidebar-muted); font-size: 13.5px; font-weight: 500;
}
.nav-sub a:hover { color: #fff; background: var(--sidebar-hover); }
.nav-sub a.active { color: #fff; font-weight: 600; }
.nav-sub a .ico { width: 16px; height: 16px; }

/* Topbar */
.topbar {
  position: fixed; top: 0; left: var(--sidebar-w); right: 0; height: var(--topbar-h);
  background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px; padding: 0 24px; z-index: 30;
  transition: left var(--t);
}
.topbar h1 { font-size: 18px; display: flex; align-items: center; gap: 10px; }
.topbar h1 .ico { width: 22px; height: 22px; color: var(--primary); }

.evento-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px;
  background: var(--blue-50); color: var(--blue-700); border-radius: var(--r-pill);
  font-weight: 600; font-size: 13px; border: 1px solid var(--blue-100);
}
.evento-pill .ico { width: 15px; height: 15px; }

.user-chip { display: flex; align-items: center; gap: 10px; }
.user-chip .who { text-align: right; line-height: 1.2; }
.user-chip .who b { font-size: 13.5px; display: block; }
.user-chip .who small { color: var(--text-muted); font-size: 12px; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; background: var(--brand-gradient);
  color: #fff; display: grid; place-items: center; font-weight: 700; font-family: var(--font-title);
}

/* Main */
.main {
  margin-left: var(--sidebar-w); padding-top: var(--topbar-h);
  min-height: 100vh; transition: margin-left var(--t);
}
.main-pad { padding: 28px; }

/* Sidebar colapsado */
body.side-collapsed .sidebar { width: var(--sidebar-w-collapsed); }
body.side-collapsed .sidebar .brand b,
body.side-collapsed .nav-item span:not(.ico-wrap),
body.side-collapsed .nav-item .chev,
body.side-collapsed .nav-sub { display: none; }
body.side-collapsed .topbar { left: var(--sidebar-w-collapsed); }
body.side-collapsed .main { margin-left: var(--sidebar-w-collapsed); }

/* Móvil */
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); transition: transform var(--t); }
  body.side-open .sidebar { transform: translateX(0); }
  .topbar, .main { left: 0; margin-left: 0; }
  .topbar { padding: 0 14px; }
}
.scrim { display: none; position: fixed; inset: 0; background: rgba(12,23,38,.5); z-index: 35; }
body.side-open .scrim { display: block; }
@media (min-width: 861px) { .scrim { display: none !important; } }

/* ============================================================
   HERO HOME
   ============================================================ */
.home-hero {
  border-radius: var(--r-2xl); overflow: hidden; position: relative;
  background: var(--brand-gradient); min-height: 460px;
  display: grid; place-items: center; padding: 40px; box-shadow: var(--shadow-pop);
}
.home-hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 30%, rgba(255,255,255,.12), transparent 60%);
}
.home-hero .card {
  position: relative; z-index: 1; padding: 44px 56px; text-align: center; max-width: 640px;
}
.home-hero .card .logo-big {
  width: 88px; height: 88px; margin: 0 auto 18px; border-radius: var(--r-xl);
  background: var(--brand-gradient); display: grid; place-items: center; color: #fff;
}
.home-hero .card .logo-big .ico { width: 46px; height: 46px; }
.home-hero .card h2 { font-size: 30px; line-height: 1.1; }
.home-hero .card .evento-name { color: var(--primary); font-family: var(--font-title); font-size: 22px; margin-top: 6px; }
.home-hero .card p { color: var(--text-muted); margin-top: 12px; }

/* ============================================================
   KPI / STAT CARDS
   ============================================================ */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 1100px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .stat-grid { grid-template-columns: 1fr; } }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl);
  box-shadow: var(--shadow-card); padding: 20px 22px; position: relative; overflow: hidden;
}
.stat::before { content: ''; position: absolute; top: 0; left: 0; width: 5px; height: 100%; background: var(--accent, var(--primary)); }
.stat .lbl { color: var(--text-muted); font-size: 13.5px; font-weight: 600; }
.stat .val { font-family: var(--font-title); font-size: 34px; font-weight: 800; color: var(--text-strong); margin-top: 4px; }
.stat .ico-badge {
  position: absolute; top: 18px; right: 18px; width: 44px; height: 44px; border-radius: var(--r-md);
  display: grid; place-items: center; background: var(--accent-bg, var(--blue-50)); color: var(--accent, var(--primary));
}
.stat .ico-badge .ico { width: 22px; height: 22px; }

/* ============================================================
   TABLA
   ============================================================ */
.toolbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.toolbar .search { flex: 1; min-width: 220px; max-width: 420px; }
.result-count { color: var(--text-muted); font-size: 13px; margin-bottom: 12px; }
.result-count b { color: var(--text-strong); }

.table-wrap { overflow-x: auto; border-radius: var(--r-xl); }
table.data { width: 100%; border-collapse: collapse; background: var(--surface); }
table.data th, table.data td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; }
table.data thead th {
  background: var(--surface-2); color: var(--text-muted); font-weight: 700; font-size: 12.5px;
  text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; position: sticky; top: 0;
}
table.data thead th.sortable { cursor: pointer; user-select: none; }
table.data thead th.sortable:hover { color: var(--primary); }
table.data thead th .sort-arw { opacity: .5; font-size: 11px; margin-left: 4px; }
table.data tbody tr:hover { background: var(--blue-50); }
table.data tbody tr:last-child td { border-bottom: none; }
.cell-name b { color: var(--text-strong); font-weight: 700; }
.cell-name small { color: var(--text-muted); display: block; font-size: 12.5px; }
.cell-actions { display: flex; gap: 6px; justify-content: flex-end; }
.info-icons { display: flex; gap: 6px; color: var(--text-muted); }
.info-icons .ico { width: 17px; height: 17px; }
.info-icons .on { color: var(--primary); }

/* Paginación */
.pager { display: flex; align-items: center; gap: 6px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.pager button {
  min-width: 36px; height: 36px; border-radius: var(--r-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-weight: 600; padding: 0 10px;
}
.pager button:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.pager button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pager button:disabled { opacity: .45; cursor: default; }
.pager .page-info { color: var(--text-muted); font-size: 13px; margin: 0 8px; }

/* ============================================================
   FILTROS (panel)
   ============================================================ */
.filter-panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl);
  box-shadow: var(--shadow-card); padding: 18px 22px; margin-bottom: 18px;
}
.filter-panel .fp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 900px) { .filter-panel .fp-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .filter-panel .fp-grid { grid-template-columns: 1fr; } }

/* ============================================================
   MULTI-SELECT (dropdown con checkboxes)
   ============================================================ */
.ms { position: relative; }
.ms-btn {
  width: 100%; display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--border-strong); border-radius: var(--r-md);
  padding: 10px 14px; background: var(--surface); font: inherit; font-size: 14px;
  color: var(--text); text-align: left; transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.ms-btn:hover { border-color: var(--primary); }
.ms-btn .ms-lbl { flex: 1; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-btn .ico { width: 16px; height: 16px; color: var(--text-muted); transition: transform var(--t-fast); }
.ms.has-sel .ms-btn { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(80,137,196,.15); }
.ms.has-sel .ms-btn .ms-lbl { color: var(--primary); font-weight: 600; }
.ms-panel {
  position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: var(--shadow-pop); max-height: 300px; overflow-y: auto; padding: 6px;
}
.ms-opt { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm); cursor: pointer; font-size: 14px; }
.ms-opt:hover { background: var(--blue-50); }
.ms-opt input { width: 16px; height: 16px; accent-color: var(--primary); flex: none; }
.ms-opt span:first-of-type { flex: 1; }
.ms-opt .ms-count { margin-left: auto; color: var(--text-muted); font-size: 12px; background: var(--surface-2); padding: 1px 9px; border-radius: var(--r-pill); }
.ms-empty { padding: 16px; text-align: center; color: var(--text-muted); font-size: 13px; }

/* ============================================================
   DELEGACIONES (acordeón por iglesia)
   ============================================================ */
.deleg-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); margin-bottom: 10px; box-shadow: var(--shadow-card); overflow: hidden; }
.deleg-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; cursor: pointer; }
.deleg-head:hover { background: var(--blue-50); }
.deleg-head .flag { font-size: 20px; }
.deleg-head b { color: var(--text-strong); }
.deleg-head .chev { margin-left: auto; transition: transform var(--t-fast); }
.deleg-item.open .deleg-head .chev { transform: rotate(90deg); }
.deleg-body { display: none; padding: 0 18px 14px; }
.deleg-item.open .deleg-body { display: block; }

/* ============================================================
   FOTOGRAFÍA (uploader, ficha, mini)
   ============================================================ */
.foto-uploader { display: flex; gap: 18px; align-items: center; }
.foto-preview {
  width: 104px; height: 104px; border-radius: var(--r-lg); background: var(--surface-2);
  border: 1px solid var(--border); display: grid; place-items: center; overflow: hidden;
  flex: none; color: var(--text-muted);
}
.foto-preview img { width: 100%; height: 100%; object-fit: cover; }
.foto-preview .ico, .foto-preview svg { width: 42px; height: 42px; }
.ficha-foto {
  width: 92px; height: 92px; border-radius: var(--r-lg); background: var(--surface-2);
  border: 1px solid var(--border); overflow: hidden; display: grid; place-items: center;
  flex: none; color: var(--text-muted);
}
.ficha-foto img { width: 100%; height: 100%; object-fit: cover; }
.ficha-foto .ico, .ficha-foto svg { width: 40px; height: 40px; }
.mini-foto {
  width: 38px; height: 38px; border-radius: 50%; background: var(--brand-gradient);
  color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12px;
  font-family: var(--font-title); overflow: hidden; flex: none;
}
.mini-foto img { width: 100%; height: 100%; object-fit: cover; }

/* ============================================================
   MODAL
   ============================================================ */
.modal-scrim {
  position: fixed; inset: 0; background: rgba(12,23,38,.55); z-index: 100;
  display: none; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto;
}
.modal-scrim.open { display: flex; }
.modal {
  background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-pop);
  width: 100%; max-width: 720px; animation: modalIn .25s var(--ease);
}
.modal.wide { max-width: 960px; }
.modal.sm { max-width: 440px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 18px; }
.modal-body { padding: 22px 24px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 18px 24px; border-top: 1px solid var(--border); }

/* Sub-lista repetible (alergias, enfermedades, acompañantes) */
.repeat-list { display: flex; flex-direction: column; gap: 8px; }
.repeat-row { display: flex; gap: 8px; align-items: center; }
.repeat-row .input { flex: 1; }
.chip-add { align-self: flex-start; }
.empty-note { color: var(--text-muted); font-size: 13px; text-align: center; padding: 18px; border: 1px dashed var(--border-strong); border-radius: var(--r-md); }

.acomp-card { border: 1px solid var(--border); border-radius: var(--r-lg); padding: 14px; background: var(--surface-2); }
.acomp-card + .acomp-card { margin-top: 10px; }

/* ============================================================
   TOAST
   ============================================================ */
#toasts { position: fixed; bottom: 24px; right: 24px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--primary);
  border-radius: var(--r-md); box-shadow: var(--shadow-pop); padding: 14px 18px; min-width: 260px; max-width: 380px;
  display: flex; align-items: center; gap: 10px; animation: toastIn .25s var(--ease); font-size: 14px;
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
.toast .ico { width: 20px; height: 20px; flex: none; }
.toast.success .ico { color: var(--success); }
.toast.error .ico { color: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* ============================================================
   LOADER / ESTADOS
   ============================================================ */
.spinner {
  width: 22px; height: 22px; border: 3px solid var(--border); border-top-color: var(--primary);
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.center-load { display: grid; place-items: center; gap: 12px; padding: 60px; color: var(--text-muted); }
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state .ico { width: 48px; height: 48px; color: var(--border-strong); margin-bottom: 12px; }
.empty-state h3 { color: var(--text-strong); margin-bottom: 6px; }

/* ============================================================
   ANALÍTICA
   ============================================================ */
.analytics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 900px) { .analytics-grid { grid-template-columns: 1fr; } }
.dist-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.dist-row:last-child { border-bottom: none; }
.dist-row .flag { font-size: 18px; }
.dist-row .n { margin-left: auto; font-weight: 700; color: var(--text-strong); }
.dist-bar { height: 6px; border-radius: var(--r-pill); background: var(--blue-500); }
