/* ============================================================
   Control de gastos · estilos
   ============================================================ */
:root {
  --bg: #f3f4f6;
  --card: #ffffff;
  --ink: #111827;
  --ink2: #374151;
  --muted: #6b7280;
  --line: #e5e7eb;
  --chip: #e9ecef;
  --green: #0b7a5a;
  --green-dark: #08654a;
  --green-soft: #ddf3ea;
  --dark: #0f2a24;
  --dark2: #1c3f37;
  --mint: #7ddfb3;
  --red: #b42318;
  --red-soft: #fde4e1;
  --salmon: #ff9e8f;
  --radius: 20px;
  --radius-sm: 14px;
  --shadow: 0 1px 2px rgba(17, 24, 39, .04), 0 2px 10px rgba(17, 24, 39, .04);
  --top: 64px;
  --side: 240px;
  /* tonos de apoyo (cambian en modo oscuro) */
  --on-green: #ffffff;
  --hero: var(--dark);
  --hover: #f3f5f7;
  --btn-soft: #eef0f3;
  --btn-soft2: #e3e6ea;
  --borde: #d1d5db;
  --red-borde: #f3b3aa;
  --sep: #f1f3f5;
  --faint: #9ca3af;
  --ink3: #4b5563;
  --track: #e5e9ef;
  --thead: #f6f7f9;
  --seg: #e5e8ec;
  --seg-on: var(--card);
  --gris-soft: #eceff3;
  --toast: #111827;
  --amar-soft: #fff8e6; --amar-borde: #f0c36d; --amar-ink: #6b4e00;
  --azul-soft: #e7f5ff; --azul-ink: #1864ab;
  --nar-soft: #fff4e6; --nar-ink: #9c4a00;
  --chart-hl: #f3f7f5;
  --barra-gasto: #111827;
  color-scheme: light;
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-tap-highlight-color: transparent;
}
/* ---------- Modo oscuro (js/tema.js pone data-tema="oscuro" en <html>) ---------- */
:root[data-tema="oscuro"] {
  --bg: #0e1412;
  --card: #171f1c;
  --ink: #e9eeec;
  --ink2: #c4cdc9;
  --ink3: #a9b3af;
  --muted: #8d9894;
  --faint: #6c7773;
  --line: #27312e;
  --chip: #27312e;
  --green: #3ccf99;
  --green-dark: #5ad9aa;
  --green-soft: rgba(60, 207, 153, .14);
  --on-green: #04261b;
  --dark: #12332b;
  --hero: #12332b;
  --dark2: #1f4d42;
  --red: #ff8473;
  --red-soft: rgba(255, 132, 115, .14);
  --red-borde: #6e2c25;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 2px 10px rgba(0, 0, 0, .25);
  --hover: #1f2926;
  --btn-soft: #222c29;
  --btn-soft2: #2c3834;
  --borde: #36433f;
  --sep: #232d2a;
  --track: #2a3532;
  --thead: #1c2522;
  --seg: #222c29;
  --seg-on: #34413d;
  --gris-soft: #252f2c;
  --toast: #2e3a36;
  --amar-soft: rgba(240, 195, 109, .12); --amar-borde: #7a6230; --amar-ink: #f0c36d;
  --azul-soft: rgba(116, 192, 252, .13); --azul-ink: #8cc8fc;
  --nar-soft: rgba(255, 169, 77, .13); --nar-ink: #ffb066;
  --chart-hl: rgba(255, 255, 255, .04);
  --barra-gasto: #b9c4c0;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); font-size: 15px; line-height: 1.4; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[data-lucide], svg.lucide { width: 20px; height: 20px; stroke-width: 2; flex-shrink: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Barra superior ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--top);
  display: flex; align-items: center; gap: 14px; padding: 0 16px;
  background: var(--card); border-bottom: 1px solid var(--line);
}
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--btn-soft);
  display: grid; place-items: center; flex-shrink: 0;
}
.icon-btn:hover { background: var(--btn-soft2); }
.icon-btn.plain { background: transparent; }
.icon-btn.plain:hover { background: var(--btn-soft); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--green); font-weight: 800; font-size: 19px; letter-spacing: -.2px; }
.brand-logo { width: 34px; height: 34px; flex-shrink: 0; display: block; object-fit: contain; }
.user { margin-left: auto; display: flex; align-items: center; gap: 10px; font-weight: 600; background: none; border: 0; padding: 4px 6px 4px 4px; border-radius: 99px; }
.user:hover { background: var(--hover); }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: grid; place-items: center; font-weight: 800; }

/* ---------- Layout ---------- */
.layout { display: flex; min-height: calc(100vh - var(--top)); }
.sidebar {
  width: var(--side); flex-shrink: 0; background: var(--card); border-right: 1px solid var(--line);
  padding: 12px; display: flex; flex-direction: column; gap: 2px;
  position: sticky; top: var(--top); height: calc(100vh - var(--top)); overflow-y: auto;
}
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px;
  text-decoration: none; color: var(--ink2); font-weight: 500;
}
.nav-item [data-lucide], .nav-item svg { width: 18px; height: 18px; color: var(--muted); }
.nav-item:hover { background: var(--hover); }
.nav-item.activo { background: var(--green-soft); color: var(--green); font-weight: 700; }
.nav-item.activo svg { color: var(--green); }
.nav-title { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 18px 12px 6px; }
.nav-foot { margin-top: auto; padding: 12px; font-size: 12px; color: var(--muted); }
.nav-foot button { background: none; border: 0; padding: 0; color: var(--green); text-decoration: underline; font-size: 12px; }
.scrim { display: none; }
.main { flex: 1; min-width: 0; padding: 26px 28px 110px; max-width: 1240px; outline: none; }

body.sin-menu .sidebar { display: none; }

@media (max-width: 899px) {
  .sidebar {
    position: fixed; z-index: 50; top: 0; left: 0; height: 100vh; width: min(290px, 84vw);
    transform: translateX(-100%); transition: transform .22s ease, visibility .22s; visibility: hidden;
    padding-top: 20px;
  }
  body.menu-abierto .sidebar { transform: none; visibility: visible; box-shadow: 0 0 40px rgba(0,0,0,.15); }
  body.menu-abierto .scrim { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(15, 23, 42, .35); }
  body.sin-menu .sidebar { display: flex; }
  .main { padding: 20px 16px 110px; }
  .user-name { display: none; }
  .brand { font-size: 18px; }
}

/* ---------- Encabezado de página ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.crumb { font-size: 13px; color: var(--muted); text-decoration: none; }
.crumb:hover { text-decoration: underline; }
.page-title { font-size: 28px; font-weight: 800; letter-spacing: -.5px; margin: 2px 0 0; }
.page-sub { color: var(--muted); font-size: 14px; margin: 2px 0 0; }
.head-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 22px; border-radius: 14px; border: 1px solid transparent;
  font-weight: 700; font-size: 15px; text-decoration: none; white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--green); color: var(--on-green); }
.btn-primary:hover { background: var(--green-dark); }
.btn-outline { background: var(--card); border-color: var(--borde); color: var(--ink); }
.btn-outline:hover { background: var(--hover); }
.btn-danger-outline { background: var(--card); border-color: var(--red-borde); color: var(--red); }
.btn-danger-outline:hover { background: var(--red-soft); }
.btn-sm { height: 40px; padding: 0 16px; border-radius: 12px; font-size: 14px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.link { background: none; border: 0; padding: 0; color: var(--green); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Selector de mes ---------- */
.periodo { display: flex; align-items: center; gap: 10px; }
.periodo .icon-btn { background: var(--card); box-shadow: var(--shadow); width: 40px; height: 40px; }
.periodo-nombre { font-size: 22px; font-weight: 800; letter-spacing: -.3px; min-width: 190px; text-align: center; position: relative; }
.periodo-nombre input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
@media (max-width: 899px) { .periodo-nombre { font-size: 19px; min-width: 0; flex: 1; } .periodo { width: 100%; } }

/* ---------- Tarjetas ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card-title { font-size: 17px; font-weight: 700; margin: 0 0 14px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 26px 0 12px; }
.section-head h2 { font-size: 18px; font-weight: 700; margin: 0; }

.hero {
  background: var(--hero); color: #fff; border-radius: 24px; padding: 26px 28px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.hero-main { flex: 1; min-width: 220px; }
.hero-label { color: #cfe3dc; font-size: 15px; }
.hero-amount { font-size: 40px; font-weight: 800; letter-spacing: -1px; line-height: 1.15; }
.hero-amount.mint { color: var(--mint); }
.hero-amount.salmon { color: var(--salmon); }
.hero-sub { color: #cfe3dc; font-size: 14px; margin-top: 4px; }
.hero-boxes { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-box { background: var(--dark2); border-radius: 16px; padding: 12px 18px; min-width: 190px; }
.hero-box .k { color: #cfe3dc; font-size: 13px; }
.hero-box .v { font-size: 19px; font-weight: 700; }
.hero-box .v.mint { color: var(--mint); }
.hero-box .v.salmon { color: var(--salmon); }
.hero-split { display: flex; justify-content: space-between; width: 100%; gap: 12px; }
.hero-split .k { color: #cfe3dc; font-size: 14px; }
.hero-split .v { font-size: 20px; font-weight: 700; }
.hero-split > div:last-child { text-align: right; }
.bar { height: 12px; border-radius: 99px; background: var(--dark2); overflow: hidden; width: 100%; }
.bar > span { display: block; height: 100%; border-radius: 99px; background: var(--mint); }
@media (max-width: 899px) {
  .hero { padding: 22px; flex-direction: column; align-items: stretch; }
  .hero-amount { font-size: 34px; }
  .hero-boxes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .hero-box { min-width: 0; padding: 12px 14px; }
  .hero-box .v { font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* ---------- Accesos rápidos ---------- */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
.tile {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px;
  display: flex; flex-direction: column; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; color: var(--ink);
}
.tile:hover { box-shadow: 0 4px 18px rgba(17,24,39,.08); }
.tile-ico { width: 44px; height: 44px; border-radius: 12px; background: var(--green-soft); color: var(--green); display: grid; place-items: center; }
@media (max-width: 899px) {
  .tiles { gap: 8px; }
  .tile { padding: 12px 4px; font-size: 12px; border-radius: 16px; }
  .tile-ico { width: 38px; height: 38px; }
}

.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 899px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Listas de movimientos ---------- */
.list { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px 22px; }
.list-day { font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: .04em; padding: 16px 0 4px; }
.row {
  display: flex; align-items: center; gap: 14px; padding: 12px 0; width: 100%;
  background: none; border: 0; text-align: left;
}
.list .row + .row { border-top: 1px solid var(--sep); }
.list .list-day + .row { border-top: 0; }
button.row:hover .row-title { text-decoration: underline; }
.row-ico { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; flex-shrink: 0; }
.row-ico .dot { width: 14px; height: 14px; border-radius: 50%; }
.row-ico svg { width: 20px; height: 20px; }
.row-body { flex: 1; min-width: 0; }
.row-title { display: block; font-weight: 700; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { display: block; color: var(--muted); font-size: 14px; }
.row-sub.danger { color: var(--red); font-weight: 500; }
.row-amount { font-weight: 800; font-size: 17px; white-space: nowrap; }
.row-amount.pos { color: var(--green); }
.row-amount.neg { color: var(--ink); }
.row-amount.debt { color: var(--red); }
.row-chev { color: var(--faint); }
.row-end { display: flex; align-items: center; gap: 10px; }
.mini { font-size: 13px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.mini.txt { white-space: normal; line-height: 1.45; }
.compact .row-ico { width: 38px; height: 38px; border-radius: 11px; }
.compact .row-ico .dot { width: 11px; height: 11px; }
.compact .row-title { font-size: 15px; }
.compact .row-sub { font-size: 12.5px; }
.compact .row-amount { font-size: 16px; }
.compact .row { padding: 9px 0; }

/* ---------- Barras por categoría ---------- */
.catbar + .catbar { margin-top: 14px; }
.catbar-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.catbar-head b { font-weight: 800; white-space: nowrap; }
.track { height: 10px; border-radius: 99px; background: var(--track); overflow: hidden; }
.track > span { display: block; height: 100%; border-radius: 99px; }

/* ---------- Gráfico ---------- */
.chart-legend { display: flex; gap: 16px; font-size: 13px; color: var(--ink2); }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.chart { width: 100%; height: 260px; display: block; }
.chart text { font-size: 11px; fill: var(--muted); font-family: inherit; }
.chart .bar-hit:hover { opacity: .85; }

/* ---------- Tablas (escritorio) ---------- */
.table-wrap { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; margin-top: 18px; }
table.tabla { width: 100%; border-collapse: collapse; }
.tabla th { background: var(--thead); text-align: left; font-size: 13px; font-weight: 600; color: var(--ink2); padding: 14px 20px; white-space: nowrap; }
.tabla td { padding: 14px 20px; border-top: 1px solid var(--sep); white-space: nowrap; }
.tabla tbody tr { cursor: pointer; }
.tabla tbody tr:hover { background: var(--hover); }
.tabla .r { text-align: right; }
.tabla .strong { font-weight: 700; }
.tabla tfoot td { color: var(--muted); font-size: 13px; text-align: right; cursor: default; }
.tabla .cell-ico { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.tabla .cell-ico .row-ico { width: 30px; height: 30px; border-radius: 8px; }
.tabla .cell-ico .row-ico svg { width: 16px; height: 16px; }
.tabla .track { width: 120px; height: 7px; }

@media (min-width: 900px) { .only-mob { display: none !important; } }
@media (max-width: 899px) { .only-desk { display: none !important; } }

.pill { display: inline-block; padding: 4px 11px; border-radius: 99px; font-size: 13px; font-weight: 700; background: var(--green-soft); color: var(--green); }
.pill.gray { background: var(--chip); color: var(--ink2); }
.pill.red { background: var(--red-soft); color: var(--red); }

/* ---------- Buscador ---------- */
.search { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 18px; box-shadow: var(--shadow); padding: 0 18px; height: 60px; margin-bottom: 16px; }
.search svg { color: var(--ink2); }
.search input { border: 0; outline: 0; flex: 1; font-size: 17px; background: transparent; height: 100%; }

/* ---------- Pestañas ---------- */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--seg); border-radius: 16px; padding: 6px; gap: 4px; }
.seg button { border: 0; background: transparent; height: 44px; border-radius: 12px; font-weight: 600; color: var(--muted); font-size: 16px; }
.seg button.on { background: var(--seg-on); color: var(--ink); font-weight: 700; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.seg.ingreso button.on { color: var(--green); }

/* ---------- Estado vacío ---------- */
.empty { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 42px 24px; text-align: center; }
.empty-ico { width: 72px; height: 72px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: grid; place-items: center; margin: 0 auto 16px; }
.empty-ico svg { width: 30px; height: 30px; }
.empty h3 { margin: 0 0 8px; font-size: 19px; }
.empty p { margin: 0 auto 20px; color: var(--muted); max-width: 340px; }

/* ---------- Botón flotante ---------- */
.fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 25; width: 64px; height: 64px; border-radius: 50%;
  border: 0; background: var(--green); color: var(--on-green); display: none; place-items: center;
  box-shadow: 0 8px 24px rgba(11, 122, 90, .35);
}
.fab svg { width: 28px; height: 28px; }
.fab.visible { display: grid; }
@media (min-width: 900px) { .fab { display: none !important; } }

/* ---------- Modales ---------- */
.modal-root:empty { display: none; }
.modal-back {
  position: fixed; inset: 0; z-index: 60; background: rgba(15, 23, 42, .45);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fade .15s ease;
}
.modal {
  background: var(--bg); width: 100%; max-width: 520px; max-height: calc(100vh - 40px);
  border-radius: 24px; display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.25); animation: up .18s ease;
}
.modal.small { max-width: 420px; }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--card); border-bottom: 1px solid var(--line); }
.modal-head h2 { flex: 1; margin: 0; font-size: 19px; font-weight: 800; text-align: center; padding-right: 44px; }
.modal-body { padding: 18px 20px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { display: flex; gap: 12px; padding: 14px 20px calc(14px + env(safe-area-inset-bottom)); background: var(--card); border-top: 1px solid var(--line); }
.modal-foot .btn { height: 54px; font-size: 17px; }
.modal-foot .btn-outline { flex: 0 0 auto; min-width: 120px; }
.modal-foot .btn-primary { flex: 1; }
.modal-foot .btn-icon { width: 58px; padding: 0; flex: 0 0 auto; }
@media (max-width: 599px) {
  .modal-back { padding: 0; align-items: stretch; }
  .modal { max-width: none; max-height: none; height: 100%; border-radius: 0; }
  .modal.small { height: auto; margin-top: auto; border-radius: 24px 24px 0 0; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(16px); opacity: 0; } }

/* ---------- Formularios ---------- */
.field { background: var(--card); border-radius: 18px; box-shadow: var(--shadow); padding: 12px 18px; display: block; position: relative; }
.field > span { display: block; font-size: 13.5px; color: var(--muted); font-weight: 500; }
.field input, .field select { border: 0; outline: 0; background: transparent; width: 100%; font-size: 18px; padding: 3px 0 0; }
.field input[type="date"] { min-height: 30px; }
.field:focus-within { box-shadow: 0 0 0 2px var(--green); }
.field.locked { background: var(--gris-soft); box-shadow: none; }
.field.locked input { color: var(--ink3); }
.field.amount input { font-size: 44px; font-weight: 800; letter-spacing: -1px; padding: 0; }
.field.amount .cur { font-size: 22px; font-weight: 600; color: var(--ink3); margin-right: 6px; }
.field.amount .amount-line { display: flex; align-items: baseline; }
.field.amount.ingreso input { color: var(--green); }
.field.amount.small input { font-size: 32px; }
.field.calc { background: var(--green-soft); box-shadow: none; }
.field.calc > span { color: var(--green); font-weight: 600; }
.field.calc .v { font-size: 34px; font-weight: 800; color: var(--green); letter-spacing: -.5px; }
.field.calc .v small { font-size: 20px; font-weight: 600; margin-right: 4px; }
.field.calc .d { font-size: 13px; color: var(--muted); }
.lbl { font-weight: 700; font-size: 15px; margin: 4px 0 -4px 2px; }
.notice { background: var(--gris-soft); border-radius: 16px; padding: 14px 16px; display: flex; gap: 12px; color: var(--ink3); font-size: 14.5px; }
.notice svg { flex-shrink: 0; margin-top: 2px; }
.err { color: var(--red); font-size: 14px; font-weight: 600; min-height: 0; }
.err:empty { display: none; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 9px; height: 46px; padding: 0 18px; border-radius: 99px;
  background: var(--card); border: 1px solid var(--line); font-weight: 500; font-size: 16px;
}
.chip .dot { width: 11px; height: 11px; border-radius: 50%; }
.chip.on { background: var(--green-soft); border-color: var(--green); font-weight: 700; }
.chip.add { border-style: dashed; color: var(--muted); }
.freq { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.freq button { border: 0; background: var(--seg); color: var(--ink); border-radius: 99px; padding: 8px 6px; font-size: 13.5px; line-height: 1.2; }
.freq button:hover { background: var(--btn-soft2); }
.colors { display: flex; flex-wrap: wrap; gap: 10px; }
.colors button { width: 38px; height: 38px; border-radius: 50%; border: 3px solid transparent; outline: 2px solid transparent; }
.colors button.on { border-color: var(--card); outline-color: var(--ink); }

/* ---------- Cuotas ---------- */
.cuota-actions { display: flex; gap: 10px; padding: 0 0 14px; }
.cuota-actions .btn-primary { flex: 1; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; z-index: 80; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--toast); color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 600; font-size: 14.5px; box-shadow: 0 8px 24px rgba(0,0,0,.2); animation: up .2s ease; display: flex; gap: 10px; align-items: center; max-width: 90vw; }
.toast.error { background: var(--red); }
.toast svg { width: 18px; height: 18px; color: var(--mint); }
.toast.error svg { color: #fff; }

/* ---------- Ingreso (login) ---------- */
.auth { display: none; }
body.sin-sesion .topbar, body.sin-sesion .layout, body.sin-sesion .fab { display: none !important; }
body.sin-sesion .auth { display: flex; min-height: 100vh; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 14px; }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--green); font-weight: 800; font-size: 22px; justify-content: center; margin-bottom: 6px; }
.auth-brand svg, .auth-logo { width: 112px; height: 112px; object-fit: contain; filter: drop-shadow(0 10px 18px rgba(11,122,90,.25)); }
.auth-card h1 { font-size: 26px; font-weight: 800; letter-spacing: -.4px; margin: 0; text-align: center; }
.auth-card .page-sub { text-align: center; margin: -6px 0 6px; }
.auth-card .btn { height: 54px; font-size: 17px; }
.auth-help { text-align: center; font-size: 14px; color: var(--muted); }
.auth-help a { color: var(--green); font-weight: 600; }
.demo-hint { background: var(--amar-soft); border: 1px dashed var(--amar-borde); border-radius: 14px; padding: 12px 14px; font-size: 13.5px; color: var(--amar-ink); }
.demo-hint code { font-family: inherit; font-weight: 700; }
.demo-hint button { background: none; border: 0; padding: 0; color: var(--amar-ink); text-decoration: underline; font-size: 13.5px; font-weight: 600; }

/* ---------- Avisos del abono ---------- */
.aviso { display: flex; align-items: center; gap: 12px; border-radius: 16px; padding: 12px 16px; margin-bottom: 18px; font-size: 14.5px; flex-wrap: wrap; }
.aviso > svg { flex-shrink: 0; }
.aviso span { flex: 1; min-width: 200px; }
.aviso.info { background: var(--azul-soft); color: var(--azul-ink); }
.aviso.warn { background: var(--nar-soft); color: var(--nar-ink); }
.aviso.danger { background: var(--red-soft); color: var(--red); }
.aviso .btn { height: 38px; }

/* ---------- Mi cuenta ---------- */
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--sep); }
.kv:first-child { border-top: 0; }
.kv .k { color: var(--muted); }
.kv .v { font-weight: 700; text-align: right; }
.stack { display: flex; flex-direction: column; gap: 10px; }

/* ---------- Superadmin: filtro por período ---------- */
.filtro-per { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; margin: 0 0 18px; }
.filtro-per > .seg { min-width: 320px; }
.filtro-per .periodo .btn { margin-left: 4px; }
.per-fechas { display: flex; gap: 12px; flex-wrap: wrap; }
.per-fechas .field { min-width: 170px; padding-top: 8px; padding-bottom: 8px; }
.per-fechas .field input { font-size: 16px; }
.sel-fecha { height: 38px; padding-right: 10px; cursor: pointer; max-width: 100%; }
@media (max-width: 899px) { .filtro-per > .seg { min-width: 0; width: 100%; } .per-fechas { width: 100%; } .per-fechas .field { flex: 1; min-width: 0; } }

/* ---------- Celular: listas más aprovechadas ---------- */
.prest-mob { padding: 12px 0 14px; }
.prest-mob + .prest-mob { border-top: 1px solid var(--sep); }
.pm-pie { display: flex; align-items: center; gap: 14px; width: 100%; background: none; border: 0; padding: 10px 0 0; text-align: left; }
.pm-pie .track { flex: 1; height: 8px; }
.pm-pie .row-amount { font-size: 16px; }
@media (max-width: 899px) {
  .list { padding: 4px 16px; }
  .row { gap: 12px; }
  .row-ico { width: 44px; height: 44px; border-radius: 13px; }
  .row-ico svg { width: 18px; height: 18px; }
  .row-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.3; }
  .row-amount { font-size: 16px; }
}
@media (max-width: 899px) { .hero-split .v { font-size: 17px; white-space: nowrap; } }
@media (max-width: 899px) {
  body.super .brand { white-space: nowrap; font-size: 17px; }
  body.super .search input::placeholder { font-size: 15px; }
  body.super .chips .chip { height: 36px !important; padding: 0 14px; font-size: 14.5px; }
}
@media (max-width: 420px) { .hide-xs { display: none; } }
button.nav-item { background: none; border: 0; width: 100%; text-align: left; font: inherit; cursor: pointer; }

/* ---------- Apariencia ---------- */
.tema-sel button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-size: 15px; height: 42px; }
.tema-sel svg { width: 17px; height: 17px; }
@media (max-width: 420px) { body.super .topbar { gap: 8px; } body.super #btnTema { width: 40px; height: 40px; } }

/* ---------- Ingreso: recordar email ---------- */
.recordar { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--ink2); cursor: pointer; margin: -2px 2px 0; user-select: none; }
.recordar input { width: 20px; height: 20px; margin: 0; accent-color: var(--green); flex-shrink: 0; cursor: pointer; }

/* ---------- Mi atajo ---------- */
.atajo { max-width: 560px; display: flex; flex-direction: column; gap: 16px; }
.atajo .seg { margin: 0; }
.atajo-token { display: flex; flex-direction: column; gap: 14px; }
.token-caja { background: var(--bg); border-radius: 16px; padding: 16px 18px; font-family: ui-monospace, Consolas, monospace; font-size: 16px; word-break: break-all; user-select: all; color: var(--ink); }
.token-caja.tapado { letter-spacing: 1px; user-select: none; color: var(--ink2); }
.pasos-atajo { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 18px; }
.pasos-atajo li { display: flex; gap: 14px; align-items: flex-start; }
.pasos-atajo .n { width: 40px; height: 40px; border-radius: 50%; background: var(--green-soft); color: var(--green); font-weight: 800; display: grid; place-items: center; flex-shrink: 0; }
.pasos-atajo li > span > b { display: block; font-size: 17px; }
.pasos-atajo small { display: block; color: var(--muted); font-size: 15px; margin-top: 2px; }
.pasos-atajo .btn { margin-top: 10px; }
.atajo-ejemplo { display: flex; gap: 14px; align-items: center; border: 2px dashed var(--green-soft); border-radius: 20px; padding: 16px 18px; }
.atajo-ejemplo .ok-ico { width: 48px; height: 48px; border-radius: 50%; background: var(--green); color: var(--on-green); display: grid; place-items: center; flex-shrink: 0; }
.atajo-ejemplo small { display: block; color: var(--muted); font-size: 13.5px; }
.atajo-ejemplo b { font-size: 17px; }
.atajo-acciones { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- Página rápida del atajo (atajo.html) ---------- */
body.atajo-rapido { min-height: 100vh; display: flex; justify-content: center; align-items: flex-start; padding: 20px 16px 40px; }
.ar-card { width: 100%; max-width: 460px; display: flex; flex-direction: column; gap: 14px; }
.ar-head { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 800; padding: 4px 2px 6px; }
.ar-logo { width: 40px; height: 40px; object-fit: contain; }
.ar-cargando { color: var(--muted); text-align: center; padding: 60px 0; }
.ar-aviso { display: flex; gap: 12px; background: var(--card); border-radius: 18px; padding: 18px; box-shadow: var(--shadow); color: var(--ink2); }
.ar-aviso p { margin: 4px 0 0; }
.ar-ok { display: flex; align-items: center; gap: 12px; background: var(--green-soft); border-radius: 16px; padding: 12px 14px; color: var(--green); }
.ar-ok .ok-ico { width: 34px; height: 34px; border-radius: 50%; background: var(--green); color: var(--on-green); display: grid; place-items: center; flex-shrink: 0; }
.ar-ok .ok-ico svg { width: 18px; height: 18px; }
.atajo-rapido .btn-primary { height: 56px; font-size: 17px; }
.ar-link { text-align: center; color: var(--muted); font-size: 14px; }
