/* ─────────────────────────────────────────────────
   DESIGN TOKENS
   ───────────────────────────────────────────────── */
:root {
  /* Paleta */
  --bg:           #F7F4EE;
  --bg-elev:     #FFFFFF;
  --bg-soft:     #F0EBE0;
  --ink:         #1A1F2E;
  --ink-soft:    #4A5160;
  --ink-muted:   #8B8F99;
  --line:        #E5DFD2;
  --line-soft:   #EDE7DA;

  --primary:     #0F6B4D;
  --primary-deep:#094F37;
  --primary-soft:#E3EFE9;

  --accent:      #C25A2C;
  --accent-soft: #F8E8DD;

  --danger:      #A8332C;
  --danger-soft: #F5E0DD;

  --warning:     #B8860B;
  --warning-soft:#F5EDD9;

  --gold:        #B5944D;

  /* Espaciado (8pt grid) */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
  --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;

  /* Radio */
  --r1: 6px; --r2: 10px; --r3: 14px; --r4: 20px;

  /* Sombras */
  --shadow-sm: 0 1px 2px rgba(26,31,46,.04), 0 1px 1px rgba(26,31,46,.03);
  --shadow-md: 0 4px 12px rgba(26,31,46,.06), 0 2px 4px rgba(26,31,46,.04);
  --shadow-lg: 0 12px 32px rgba(26,31,46,.08), 0 4px 8px rgba(26,31,46,.04);

  /* Typo */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body:    'Manrope', -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, monospace;
}

/* ─────────────────────────────────────────────────
   RESET + BASE
   ───────────────────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  background-image:
    radial-gradient(1200px 600px at 20% -10%, rgba(15,107,77,.06), transparent),
    radial-gradient(900px 500px at 110% 10%, rgba(194,90,44,.05), transparent);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-feature-settings: 'tnum'; }

/* ─────────────────────────────────────────────────
   LAYOUT
   ───────────────────────────────────────────────── */
.shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--s5) var(--s4);
}
@media (min-width: 768px) {
  .shell { padding: var(--s7) var(--s6); }
}

/* ─────────────────────────────────────────────────
   HEADER EDITORIAL
   ───────────────────────────────────────────────── */
.masthead {
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--line);
  padding: var(--s5) 0 var(--s6);
  margin-bottom: var(--s7);
  position: relative;
}
.masthead-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 500;
  margin-bottom: var(--s4);
}
.masthead-meta .dot {
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--primary);
  border-radius: 50%;
  margin: 0 var(--s2);
  vertical-align: middle;
}
.masthead h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.2rem, 5.5vw, 4rem);
  line-height: 1.05;
  letter-spacing: -.02em;
  color: var(--ink);
  font-variation-settings: 'opsz' 144, 'SOFT' 100;
}
.masthead h1 em {
  font-style: italic;
  color: var(--primary);
  font-weight: 400;
}
.masthead .lede {
  margin-top: var(--s4);
  max-width: 620px;
  font-size: 1.05rem;
  color: var(--ink-soft);
  font-weight: 400;
}
.masthead-actions {
  display: flex;
  align-items: center;
  gap: var(--s2);
}
.masthead-actions .sep {
  width: 1px;
  height: 12px;
  background: var(--line);
  margin: 0 var(--s1);
}
.btn-meta {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  padding: 5px var(--s3);
  font-family: var(--font-body);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 600;
  border-radius: var(--r1);
  cursor: pointer;
  transition: all .2s ease;
  line-height: 1;
  white-space: nowrap;
}
.btn-meta:hover {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.btn-meta.primary:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}
.btn-meta.danger:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: white;
}
@media (max-width: 600px) {
  .masthead-meta { flex-wrap: wrap; gap: var(--s2); }
}

/* ─────────────────────────────────────────────────
   LAST UPDATED STATUS
   ───────────────────────────────────────────────── */
.last-updated {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  font-size: 11px;
  color: var(--ink-muted);
  letter-spacing: .03em;
  padding: var(--s2) var(--s3);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 999px;
  margin-bottom: var(--s5);
}
.live-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--primary);
  position: relative;
  flex-shrink: 0;
}
.live-dot::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: var(--primary);
  opacity: .35;
  animation: pulse-dot 2s infinite;
}
.live-dot.idle { background: var(--ink-muted); }
.live-dot.idle::before { background: var(--ink-muted); animation: none; opacity: 0; }
@keyframes pulse-dot {
  0%   { transform: scale(.8); opacity: .35; }
  50%  { transform: scale(1.6); opacity: 0; }
  100% { transform: scale(.8); opacity: 0; }
}
.last-updated strong {
  color: var(--ink);
  font-weight: 600;
}
.last-updated .pill-counter {
  margin-left: var(--s2);
  padding-left: var(--s3);
  border-left: 1px solid var(--line);
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--primary);
}

/* ─────────────────────────────────────────────────
   TOAST
   ───────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: var(--s5);
  right: var(--s5);
  background: var(--ink);
  color: white;
  padding: var(--s3) var(--s5);
  border-radius: var(--r2);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  transform: translateY(80px);
  opacity: 0;
  transition: all .35s cubic-bezier(.2,.8,.2,1);
  z-index: 9999;
  max-width: 360px;
  display: flex;
  align-items: center;
  gap: var(--s2);
}
.toast.show {
  transform: translateY(0);
  opacity: 1;
}
.toast.success { background: var(--primary); }
.toast.error   { background: var(--danger); }
.toast .toast-icon {
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
}

/* ─────────────────────────────────────────────────
   KPI HERO STRIP
   ───────────────────────────────────────────────── */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--r3);
  background: var(--bg-elev);
  overflow: hidden;
  margin-bottom: var(--s7);
  box-shadow: var(--shadow-sm);
}
.kpi {
  padding: var(--s5);
  border-right: 1px solid var(--line);
  position: relative;
}
.kpi:last-child { border-right: none; }
@media (max-width: 720px) {
  .kpi { border-right: none; border-bottom: 1px solid var(--line); }
  .kpi:last-child { border-bottom: none; }
}
.kpi-label {
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 600;
  margin-bottom: var(--s3);
}
.kpi-value {
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 500;
  letter-spacing: -.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.kpi-sub {
  font-size: 12px;
  color: var(--ink-muted);
  margin-top: var(--s2);
}
.kpi.accent .kpi-value { color: var(--primary); }
.kpi.warn .kpi-value { color: var(--accent); }

/* ─────────────────────────────────────────────────
   PROGRESS BAR GLOBAL
   ───────────────────────────────────────────────── */
.progress-global {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r3);
  padding: var(--s5);
  margin-bottom: var(--s7);
}
.progress-global-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: var(--s3);
}
.progress-global-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--ink);
}
.progress-global-pct {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1.4rem;
  color: var(--primary);
}
.progress-track {
  height: 10px;
  background: var(--line-soft);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, #14a374 100%);
  border-radius: 999px;
  transition: width .8s cubic-bezier(.2,.8,.2,1);
  position: relative;
}
.progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.3), transparent);
  animation: shimmer 2.5s infinite;
}
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
.progress-meta {
  display: flex;
  justify-content: space-between;
  margin-top: var(--s2);
  font-size: 12px;
  color: var(--ink-muted);
}

/* ─────────────────────────────────────────────────
   TAB NAV
   ───────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--ink);
  margin-bottom: var(--s6);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 50;
  padding-top: var(--s2);
}
.tabs::-webkit-scrollbar { height: 4px; }
.tabs::-webkit-scrollbar-thumb { background: var(--line); }
.tab {
  background: transparent;
  border: none;
  padding: var(--s4) var(--s4);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-muted);
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  transition: color .2s;
  letter-spacing: .02em;
}
.tab:hover { color: var(--ink); }
.tab.active {
  color: var(--ink);
}
.tab.active::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0; right: 0;
  height: 3px;
  background: var(--primary);
}
.tab-year {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 11px;
  color: var(--ink-muted);
  margin-left: 4px;
}

/* ─────────────────────────────────────────────────
   TAB CONTENT
   ───────────────────────────────────────────────── */
.tab-content { display: none; }
.tab-content.active { display: block; }
.tab-content.entering { animation: slideUp .4s ease; }
@keyframes slideUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─────────────────────────────────────────────────
   SECTION (genérico)
   ───────────────────────────────────────────────── */
.section {
  margin-bottom: var(--s6);
}
.section-eyebrow {
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 700;
  margin-bottom: var(--s2);
}
.section-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 500;
  letter-spacing: -.01em;
  color: var(--ink);
  margin-bottom: var(--s5);
}

/* ─────────────────────────────────────────────────
   MONTH HEADER (cada tab mensual)
   ───────────────────────────────────────────────── */
.month-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: var(--s4);
  padding: var(--s5) 0 var(--s5);
  border-bottom: 1px solid var(--line);
  margin-bottom: var(--s6);
}
.month-name {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 500;
  letter-spacing: -.02em;
  line-height: 1;
}
.month-name em {
  font-style: italic;
  color: var(--primary);
}
.month-tagline {
  font-size: 13px;
  color: var(--ink-muted);
  margin-top: var(--s2);
  letter-spacing: .03em;
}
.month-balance {
  text-align: right;
}
.month-balance-label {
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 600;
  margin-bottom: var(--s1);
}
.month-balance-value {
  font-family: var(--font-mono);
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--primary);
}

/* ─────────────────────────────────────────────────
   GRID DE 2 COLUMNAS
   ───────────────────────────────────────────────── */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s5);
  margin-bottom: var(--s6);
}
@media (min-width: 900px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
}

/* ─────────────────────────────────────────────────
   PANEL (caja base)
   ───────────────────────────────────────────────── */
.panel {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r3);
  overflow: hidden;
}
.panel-header {
  padding: var(--s4) var(--s5);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-soft);
}
.panel-header h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
}
.panel-header .count {
  font-size: 11px;
  color: var(--ink-muted);
  letter-spacing: .1em;
  text-transform: uppercase;
  font-weight: 600;
}
.panel-body { padding: var(--s3) 0; }

/* ─────────────────────────────────────────────────
   ROW (item dentro de panel)
   ───────────────────────────────────────────────── */
.row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--s3);
  padding: var(--s3) var(--s5);
  transition: background .15s;
  border-bottom: 1px solid transparent;
}
.row:hover { background: var(--bg-soft); }
.row + .row { border-top: 1px dashed var(--line-soft); }

.row-icon {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  background: var(--bg-soft);
  border-radius: var(--r1);
  font-size: 14px;
  flex-shrink: 0;
}
.row-text {
  font-weight: 500;
  font-size: 14px;
  color: var(--ink);
}
.row-text small {
  display: block;
  font-size: 11px;
  color: var(--ink-muted);
  font-weight: 400;
  margin-top: 2px;
  letter-spacing: .02em;
}
.row-amount {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  text-align: right;
}

/* Estado: pagado */
.row.paid {
  background: var(--primary-soft);
}
.row.paid .row-text,
.row.paid .row-amount {
  text-decoration: line-through;
  color: var(--primary);
}
.row.paid .row-icon {
  background: var(--primary);
  color: white;
}

/* Checkbox custom */
.check {
  width: 20px; height: 20px;
  border: 2px solid var(--line);
  border-radius: 4px;
  display: grid; place-items: center;
  cursor: pointer;
  transition: all .15s;
  flex-shrink: 0;
  background: white;
}
.check:hover { border-color: var(--primary); }
.check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.check.checked {
  background: var(--primary);
  border-color: var(--primary);
}
.check.checked::after {
  content: '✓';
  color: white;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

/* Total row */
.row-total {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  padding: var(--s4) var(--s5);
  border-top: 2px solid var(--ink);
  margin-top: var(--s2);
  background: var(--bg-soft);
}
.row-total-label {
  font-size: 11px;
  letter-spacing: .15em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink);
}
.row-total-value {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--ink);
}

/* ─────────────────────────────────────────────────
   CALLOUTS
   ───────────────────────────────────────────────── */
.callout {
  padding: var(--s4) var(--s5);
  border-radius: var(--r2);
  margin: var(--s4) 0;
  font-size: 14px;
  border-left: 3px solid;
  background: var(--bg-elev);
}
.callout strong { font-weight: 600; }
.callout.success { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-deep); }
.callout.warn    { background: var(--warning-soft); border-color: var(--warning); color: #6b5208; }
.callout.danger  { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.callout.info    { background: var(--bg-soft); border-color: var(--ink-muted); color: var(--ink-soft); }
.callout-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: var(--s1);
  display: block;
}

/* ─────────────────────────────────────────────────
   DEUDAS — TABLA TRACKER
   ───────────────────────────────────────────────── */
.debts-table {
  width: 100%;
  border-collapse: collapse;
}
.debts-table th {
  text-align: left;
  font-size: 10px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 600;
  padding: var(--s3) var(--s4);
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
}
.debts-table th:last-child,
.debts-table td:last-child { text-align: right; }
.debts-table td {
  padding: var(--s4);
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
.debts-table tr:last-child td { border-bottom: none; }
.debt-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
}
.debt-name small {
  display: block;
  font-weight: 400;
  font-size: 11px;
  color: var(--ink-muted);
  margin-top: 2px;
}
.debt-bar {
  height: 6px;
  background: var(--line-soft);
  border-radius: 999px;
  overflow: hidden;
  width: 100%;
  min-width: 80px;
}
.debt-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
  transition: width .8s cubic-bezier(.2,.8,.2,1);
}
.debt-amount {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 14px;
}
.debt-amount.original {
  color: var(--ink-muted);
  font-size: 11px;
  text-decoration: line-through;
}
.debt-row.cleared {
  background: var(--primary-soft);
}
.debt-row.cleared .debt-name,
.debt-row.cleared .debt-amount { color: var(--primary); }

/* ─────────────────────────────────────────────────
   TIMELINE
   ───────────────────────────────────────────────── */
.timeline {
  position: relative;
  padding-left: var(--s5);
}
.timeline::before {
  content: '';
  position: absolute;
  left: 11px; top: 8px; bottom: 8px;
  width: 2px;
  background: var(--line);
}
.timeline-item {
  position: relative;
  padding: var(--s2) 0 var(--s4) var(--s4);
  font-size: 14px;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -18px; top: 10px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--bg-elev);
  border: 2px solid var(--line);
}
.timeline-item.milestone::before {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
}
.timeline-item.future::before {
  background: var(--bg);
}
.timeline-date {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 13px;
  color: var(--ink-muted);
  margin-bottom: 2px;
}
.timeline-text {
  color: var(--ink);
  font-weight: 500;
}
.timeline-text strong { color: var(--primary); }

/* ─────────────────────────────────────────────────
   CALENDARIO DE PAGOS (días pesados)
   ───────────────────────────────────────────────── */
.calendar-strip {
  display: flex;
  gap: var(--s2);
  overflow-x: auto;
  padding: var(--s2) 0;
  scrollbar-width: thin;
}
.cal-day {
  flex-shrink: 0;
  min-width: 110px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  padding: var(--s3);
  text-align: center;
}
.cal-day.heavy {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.cal-day-num {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1;
}
.cal-day.heavy .cal-day-num { color: var(--accent); }
.cal-day-label {
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 600;
  margin-top: var(--s1);
}
.cal-day-amount {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  margin-top: var(--s2);
}
.cal-day-amount.in { color: var(--primary); }
.cal-day-amount.out { color: var(--accent); }

/* ─────────────────────────────────────────────────
   DISTRIBUCIÓN (pie de mes)
   ───────────────────────────────────────────────── */
.distribution {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s3);
  margin-top: var(--s4);
}
.dist-card {
  padding: var(--s5);
  border-radius: var(--r2);
  border: 1px solid var(--line);
}
.dist-card.raquel {
  background: linear-gradient(135deg, var(--primary-deep), var(--primary));
  color: white;
  border-color: var(--primary-deep);
}
.dist-card.buffer {
  background: linear-gradient(135deg, #2D3748, #4A5568);
  color: white;
  border-color: #2D3748;
}
.dist-label {
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  font-weight: 700;
  opacity: .8;
}
.dist-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  margin-top: var(--s2);
}
.dist-sub {
  font-size: 12px;
  opacity: .85;
  margin-top: var(--s1);
}

/* ─────────────────────────────────────────────────
   EDUCACIÓN — LECCIONES DE CONTADOR
   ───────────────────────────────────────────────── */
.lessons {
  margin-top: var(--s8);
  padding-top: var(--s7);
  border-top: 1px solid var(--line);
}
.lessons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--s4);
  margin-top: var(--s5);
}
.lesson {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r3);
  padding: var(--s5);
  position: relative;
  overflow: hidden;
}
.lesson::before {
  content: attr(data-num);
  position: absolute;
  top: -10px; right: -10px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 6rem;
  font-weight: 400;
  color: var(--bg-soft);
  line-height: 1;
  pointer-events: none;
}
.lesson h4 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--ink);
  margin-bottom: var(--s3);
  position: relative;
}
.lesson p {
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink-soft);
  position: relative;
}

/* ─────────────────────────────────────────────────
   FOOTER
   ───────────────────────────────────────────────── */
.foot {
  margin-top: var(--s8);
  padding-top: var(--s5);
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--ink-muted);
  text-align: center;
  letter-spacing: .05em;
}

/* ─────────────────────────────────────────────────
   ESTADOS — ARRANCANDO MES
   ───────────────────────────────────────────────── */
.month-empty-state {
  background: var(--bg-soft);
  border: 1px dashed var(--line);
  border-radius: var(--r3);
  padding: var(--s6);
  text-align: center;
  color: var(--ink-muted);
}

/* ─────────────────────────────────────────────────
   PAY BUTTONS
   ───────────────────────────────────────────────── */
.pay-toggle {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--r1);
  padding: var(--s2) var(--s3);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  cursor: pointer;
  font-family: var(--font-body);
  transition: all .15s;
}
.pay-toggle:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.pay-toggle.paid {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* ─────────────────────────────────────────────────
   ACCESIBILIDAD
   ───────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ─────────────────────────────────────────────────
   SWEETALERT2 — TEMA EDITORIAL CUSTOM
   ───────────────────────────────────────────────── */
.swal2-container {
  font-family: var(--font-body) !important;
}
.swal2-popup {
  background: var(--bg-elev) !important;
  border-radius: var(--r3) !important;
  border: 1px solid var(--line) !important;
  box-shadow: var(--shadow-lg) !important;
  padding: var(--s6) var(--s5) var(--s5) !important;
  max-width: 460px !important;
}
.swal2-title {
  font-family: var(--font-display) !important;
  font-weight: 600 !important;
  font-size: 1.5rem !important;
  letter-spacing: -.01em !important;
  color: var(--ink) !important;
  padding: 0 !important;
  margin-bottom: var(--s3) !important;
  line-height: 1.2 !important;
}
.swal2-html-container {
  font-family: var(--font-body) !important;
  font-size: 14px !important;
  color: var(--ink-soft) !important;
  line-height: 1.6 !important;
  margin: var(--s2) 0 var(--s4) !important;
  padding: 0 !important;
  text-align: left !important;
}
.swal2-html-container .sa-stat-block {
  background: var(--bg-soft);
  border-left: 3px solid var(--primary);
  padding: var(--s3) var(--s4);
  border-radius: var(--r1);
  margin: var(--s3) 0;
  font-size: 13px;
}
.swal2-html-container .sa-stat-block.warn {
  border-left-color: var(--accent);
  background: var(--accent-soft);
}
.swal2-html-container .sa-stat-block strong {
  display: block;
  font-size: 11px;
  letter-spacing: .15em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
}
.swal2-html-container .sa-stat-block ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.swal2-html-container .sa-stat-block li {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink);
  padding: 2px 0;
}
.swal2-html-container .sa-stat-block li::before {
  content: '·';
  color: var(--primary);
  font-weight: 700;
  margin-right: 8px;
}

/* Botones */
.swal2-actions {
  gap: var(--s2) !important;
  margin-top: var(--s4) !important;
}
.swal2-styled.swal2-confirm,
.swal2-styled.swal2-cancel,
.swal2-styled.swal2-deny {
  font-family: var(--font-body) !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  letter-spacing: .08em !important;
  text-transform: uppercase !important;
  padding: 10px 18px !important;
  border-radius: var(--r1) !important;
  box-shadow: none !important;
  border: 1px solid transparent !important;
  transition: all .2s ease !important;
}
.swal2-styled.swal2-confirm {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
}
.swal2-styled.swal2-confirm:hover {
  background: var(--primary-deep) !important;
  border-color: var(--primary-deep) !important;
  transform: translateY(-1px);
}
.swal2-styled.swal2-cancel {
  background: transparent !important;
  border-color: var(--line) !important;
  color: var(--ink-soft) !important;
}
.swal2-styled.swal2-cancel:hover {
  background: var(--ink) !important;
  border-color: var(--ink) !important;
  color: white !important;
}
.swal2-styled.swal2-deny {
  background: var(--danger) !important;
  border-color: var(--danger) !important;
}
.swal2-styled.swal2-deny:hover {
  background: #8a2823 !important;
  border-color: #8a2823 !important;
}
.swal2-styled:focus {
  box-shadow: 0 0 0 3px rgba(15,107,77,.18) !important;
}

/* Iconos custom */
.swal2-icon {
  border-color: var(--line) !important;
  margin: 0 auto var(--s3) !important;
  width: 56px !important;
  height: 56px !important;
  border-width: 2px !important;
}
.swal2-icon.swal2-warning {
  color: var(--accent) !important;
  border-color: var(--accent) !important;
}
.swal2-icon.swal2-warning .swal2-icon-content {
  font-size: 2rem !important;
}
.swal2-icon.swal2-success {
  border-color: var(--primary) !important;
}
.swal2-icon.swal2-success [class^=swal2-success-line] {
  background-color: var(--primary) !important;
}
.swal2-icon.swal2-success .swal2-success-ring {
  border-color: rgba(15,107,77,.3) !important;
}
.swal2-icon.swal2-error {
  border-color: var(--danger) !important;
}
.swal2-icon.swal2-error [class^=swal2-x-mark-line] {
  background-color: var(--danger) !important;
}
.swal2-icon.swal2-question {
  color: var(--primary) !important;
  border-color: var(--primary) !important;
}

/* Backdrop */
.swal2-backdrop-show {
  background: rgba(26,31,46,.5) !important;
  backdrop-filter: blur(4px);
}

/* ─────────────────────────────────────────────────
   PRINT
   ───────────────────────────────────────────────── */
@media print {
  body { background: white; }
  .tabs, .reset-btn { display: none; }
  .tab-content { display: block !important; page-break-after: always; }
}

/* ── Módulo supermercado ────────────────────────────── */
.sm-tb { padding:8px 15px;border:0.5px solid var(--line);background:transparent;color:var(--ink-soft);border-radius:var(--r1);font-size:13px;cursor:pointer;font-weight:400;transition:all .15s; }
.sm-tb.sm-ta { border-color:var(--primary);background:var(--primary-soft);color:var(--primary);font-weight:500; }
.sm-pc:hover { background:var(--bg-soft) !important; }
