/* ═══════════════════════════════════════════════════════════════
   RUMBO — Design System Foundation v3
   Tema dual (light / dark) · Mobile-First · Lucide icons
═══════════════════════════════════════════════════════════════ */

/* ─── LIGHT THEME ───────────────────────────────────────────── */
:root,
[data-theme="light"] {
  /* Accent (Blue 600) */
  --accent:       #2563EB;
  --accent-hover: #1D4ED8;
  --accent-muted: #DBEAFE;
  --accent-text:  #1E40AF;

  /* Semantic palette */
  --success:      #059669;
  --success-bg:   #ECFDF5;
  --success-text: #065F46;
  --danger:       #DC2626;
  --danger-bg:    #FEF2F2;
  --danger-text:  #991B1B;
  --warning:      #D97706;
  --warning-bg:   #FFFBEB;
  --warning-text: #92400E;

  /* Backgrounds */
  --bg:        #F5F6FA;
  --surface:   #FFFFFF;
  --surface-2: #F8F9FC;
  --surface-3: #EEF0F6;
  --overlay:   rgba(15,23,42,0.55);

  /* Text hierarchy */
  --t1:  #0F172A;   /* Headings, primary */
  --t2:  #1E293B;   /* Body */
  --t3:  #475569;   /* Secondary */
  --t4:  #64748B;   /* Hints */
  --t5:  #94A3B8;   /* Placeholders */
  --t6:  #CBD5E1;   /* Disabled */

  /* Borders */
  --border:       rgba(0,0,0,0.07);
  --border-md:    rgba(0,0,0,0.12);
  --border-focus: var(--accent);

  /* Shadows (light = meaningful depth) */
  --sh-xs: 0 1px 2px rgba(0,0,0,0.05);
  --sh-sm: 0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
  --sh-md: 0 4px 16px rgba(0,0,0,0.08);
  --sh-lg: 0 8px 32px rgba(0,0,0,0.10);
  --sh-fab: 0 4px 20px rgba(37,99,235,0.40);

  /* Progress track */
  --track: #E2E8F0;
}

/* ─── DARK THEME ────────────────────────────────────────────── */
[data-theme="dark"] {
  --accent:       #3B82F6;
  --accent-hover: #60A5FA;
  --accent-muted: rgba(59,130,246,0.14);
  --accent-text:  #93C5FD;

  --success:      #10B981;
  --success-bg:   rgba(16,185,129,0.13);
  --success-text: #34D399;
  --danger:       #EF4444;
  --danger-bg:    rgba(239,68,68,0.13);
  --danger-text:  #F87171;
  --warning:      #F59E0B;
  --warning-bg:   rgba(245,158,11,0.13);
  --warning-text: #FCD34D;

  --bg:        #080910;
  --surface:   #11121C;
  --surface-2: #181929;
  --surface-3: #1E1F32;
  --overlay:   rgba(0,0,0,0.72);

  --t1:  #F1F5F9;
  --t2:  #E2E8F0;
  --t3:  #94A3B8;
  --t4:  #64748B;
  --t5:  #475569;
  --t6:  #334155;

  --border:       rgba(255,255,255,0.07);
  --border-md:    rgba(255,255,255,0.13);
  --border-focus: var(--accent);

  --sh-xs: none;
  --sh-sm: none;
  --sh-md: none;
  --sh-lg: none;
  --sh-fab: 0 4px 20px rgba(59,130,246,0.35);

  --track: rgba(255,255,255,0.08);
}

/* ─── GLOBALS ───────────────────────────────────────────────── */
:root {
  --font:  'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono:  'Outfit', monospace;

  /* Spacing */
  --sp-1:  4px;  --sp-2:  8px;  --sp-3: 12px;
  --sp-4: 16px;  --sp-5: 20px;  --sp-6: 24px;
  --sp-8: 32px;

  /* Border radius */
  --r-sm:   8px;
  --r-md:  12px;
  --r-lg:  16px;
  --r-xl:  22px;
  --r-2xl: 28px;
  --r-full: 9999px;

  /* Heights */
  --nav-h:     64px;
  --header-h:  60px;
  --sidebar-w: 228px;
}

/* ─── RESET ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--t1);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 0.22s ease, color 0.22s ease;
}
input, select, textarea, button { font-family: var(--font); }
button { cursor: pointer; }

/* Scrollbar */
::-webkit-scrollbar        { width: 4px; height: 4px; }
::-webkit-scrollbar-track  { background: transparent; }
::-webkit-scrollbar-thumb  { background: var(--border-md); border-radius: var(--r-full); }

/* ─── LAYOUT ────────────────────────────────────────────────── */
.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.app-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  position: fixed;
  inset: 0 auto 0 0;
  height: 100vh;
  z-index: 100;
  background: var(--surface);
  border-right: 1px solid var(--border);
  transition: background 0.22s ease;
}

.app-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  overflow-y: auto;
  height: 100vh;
  background: var(--bg);
  transition: background 0.22s ease;
}

/* ─── BOTTOM NAV ────────────────────────────────────────────── */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 200;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  transition: background 0.22s ease;
}

.mobile-nav-items {
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: var(--nav-h);
  padding: 0 var(--sp-2);
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 4px;
  border: none;
  background: none;
  flex: 1;
  transition: opacity 0.15s;
}

.mobile-nav-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--t5);
  transition: color 0.2s;
}
.mobile-nav-item.active .mobile-nav-label { color: var(--accent); }

/* ─── FAB ───────────────────────────────────────────────────── */
.mobile-nav-fab,
.fab {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  box-shadow: var(--sh-fab);
  transition: transform 0.15s, box-shadow 0.15s;
  flex-shrink: 0;
}
.mobile-nav-fab { margin-bottom: 10px; }
.mobile-nav-fab:active, .fab:active { transform: scale(0.91); }

.fab-fixed {
  position: fixed;
  bottom: calc(var(--nav-h) + 16px);
  right: 20px;
  z-index: 150;
}

/* ─── DRAWER ────────────────────────────────────────────────── */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 500;
  animation: fadeIn 0.2s ease forwards;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.drawer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--surface);
  border-radius: var(--r-2xl) var(--r-2xl) 0 0;
  z-index: 510;
  max-height: 93vh;
  overflow-y: auto;
  animation: slideUp 0.3s cubic-bezier(0.34, 1.06, 0.64, 1) forwards;
  padding-bottom: env(safe-area-inset-bottom, 16px);
}

.drawer-handle {
  width: 36px; height: 4px;
  background: var(--border-md);
  border-radius: var(--r-full);
  margin: 12px auto 4px;
  flex-shrink: 0;
}

/* On desktop, drawer becomes a centered modal */
@media (min-width: 769px) {
  .drawer-backdrop { background: var(--overlay); }
  .drawer {
    left: 50%; right: auto;
    bottom: auto; top: 50%;
    transform: translate(-50%, -50%);
    width: 480px;
    border-radius: var(--r-xl);
    max-height: 88vh;
    animation: fadeScaleIn 0.22s ease forwards;
  }
  .drawer-handle { display: none; }
}

/* ─── CARDS ─────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  box-shadow: var(--sh-sm);
  transition: background 0.22s ease;
}

.card-interactive:hover {
  border-color: var(--border-md);
  box-shadow: var(--sh-md);
}

/* ─── FORM FIELDS ───────────────────────────────────────────── */
.field {
  width: 100%;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 14px;
  color: var(--t1);
  font-size: 14px;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
  box-sizing: border-box;
}
.field:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}
.field::placeholder { color: var(--t5); }

/* ─── BUTTONS ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--r-md);
  font-family: var(--font);
  font-weight: 700;
  font-size: 14px;
  padding: 12px 20px;
  transition: opacity 0.15s, transform 0.12s, box-shadow 0.15s;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--sh-fab);
}
.btn-primary:hover { opacity: 0.9; }

.btn-secondary {
  background: var(--surface-2);
  color: var(--t2);
  border: 1.5px solid var(--border-md);
}

.btn-ghost {
  background: none;
  color: var(--accent);
  padding: 10px 14px;
}

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger-text);
  border: 1.5px solid rgba(220,38,38,0.2);
}

.btn-full { width: 100%; }

/* ─── BADGES ────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1px;
}
.badge-blue    { background: var(--accent-muted);  color: var(--accent-text); }
.badge-green   { background: var(--success-bg);    color: var(--success-text); }
.badge-red     { background: var(--danger-bg);     color: var(--danger-text); }
.badge-yellow  { background: var(--warning-bg);    color: var(--warning-text); }
.badge-gray    { background: var(--surface-3);     color: var(--t4); }

/* ─── PILL TABS ─────────────────────────────────────────────── */
.pill-tabs {
  display: flex;
  background: var(--surface-3);
  border-radius: var(--r-lg);
  padding: 4px;
  gap: 2px;
}
.pill-tab {
  flex: 1;
  padding: 8px 12px;
  border: none;
  border-radius: var(--r-md);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--t4);
  background: none;
  transition: all 0.18s;
  text-align: center;
  white-space: nowrap;
}
.pill-tab.active {
  background: var(--surface);
  color: var(--t1);
  box-shadow: var(--sh-sm);
}

/* ─── URGENCY SEMAPHORE ─────────────────────────────────────── */
.urgency-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  animation: pulse 2.5s ease-in-out infinite;
}
.u-red    { background: var(--danger);  box-shadow: 0 0 0 3px rgba(220,38,38,0.18); }
.u-yellow { background: var(--warning); box-shadow: 0 0 0 3px rgba(217,119,6,0.18); }
.u-green  { background: var(--success); box-shadow: 0 0 0 3px rgba(5,150,105,0.18); }
.u-gray   { background: var(--t5);      box-shadow: none; animation: none; }

/* ─── INSIGHT CARDS ─────────────────────────────────────────── */
.insight {
  border-radius: var(--r-lg);
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.insight-icon {
  width: 36px; height: 36px;
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.insight.good   { background: var(--success-bg); border: 1px solid rgba(5,150,105,0.18); }
.insight.warn   { background: var(--warning-bg); border: 1px solid rgba(217,119,6,0.18); }
.insight.bad    { background: var(--danger-bg);  border: 1px solid rgba(220,38,38,0.18); }
.insight.info   { background: var(--accent-muted); border: 1px solid rgba(37,99,235,0.15); }

/* ─── CATEGORY ICON ─────────────────────────────────────────── */
.cat-icon {
  width: 42px; height: 42px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.cat-icon-sm {
  width: 32px; height: 32px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

/* ─── THEME TOGGLE ──────────────────────────────────────────── */
.theme-toggle {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--border-md);
  background: var(--surface);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.18s, background 0.18s;
  flex-shrink: 0;
  color: var(--t3);
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* ─── RANGE SLIDER ──────────────────────────────────────────── */
input[type=range] {
  -webkit-appearance: none;
  appearance: none;
  height: 5px;
  border-radius: var(--r-full);
  background: var(--track);
  outline: none;
  cursor: pointer;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 0 3px var(--accent-muted), var(--sh-sm);
  transition: transform 0.15s;
}
input[type=range]::-webkit-slider-thumb:hover { transform: scale(1.15); }

/* ─── SELECT OPTIONS ────────────────────────────────────────── */
select option { background: var(--surface); color: var(--t1); }
[data-theme="dark"] select option { background: #1A1B2E; color: #E2E8F0; }

/* ─── Ocultar flecha nativa de selects (usamos chevron Lucide custom) ────── */
select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: none;
}
select::-ms-expand { display: none; }

/* ─── Ocultar spinners number en drawers ─────────────── */
.drawer input[type=number]::-webkit-inner-spin-button,
.drawer input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.drawer input[type=number] { -moz-appearance: textfield; }

/* ─── Input time moderno (oculta icono nativo) ────────── */
.drawer input[type=time]::-webkit-calendar-picker-indicator { opacity: 0; width: 0; }
.drawer input[type=time] { -webkit-appearance: none; }

/* ─── Picker inline: celdas de día con hover suave ────── */
.picker-day:hover { background: var(--surface-3) !important; }

/* ─── Focus accent en cualquier input dentro del drawer ─ */
.drawer input:focus,
.drawer select:focus,
.drawer textarea:focus { outline: none; }

/* ─── WALLET CARD ───────────────────────────────────────────── */
.wallet-card {
  border-radius: var(--r-xl);
  padding: 22px 24px;
  color: #fff;
  position: relative;
  overflow: hidden;
  min-height: 130px;
}
.wallet-card::after {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 140px; height: 140px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
}
.wallet-card::before {
  content: '';
  position: absolute;
  bottom: -20px; right: 40px;
  width: 80px; height: 80px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
}

/* ─── PROGRESS BAR ──────────────────────────────────────────── */
.progress-track {
  height: 7px;
  border-radius: var(--r-full);
  background: var(--track);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: var(--r-full);
  transition: width 0.8s cubic-bezier(0.34,1.06,0.64,1);
}

/* ─── BRAND HEADER — solo visible en mobile, sticky top ──── */
.mobile-brand-header {
  display: none;
  position: sticky;
  top: 0;
  z-index: 60;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  transition: background 0.22s ease, border-color 0.22s ease;
}
.mobile-brand-header img { display: block; flex-shrink: 0; }
.mobile-brand-header .brand-logo-tile {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 6px 14px -6px color-mix(in srgb, var(--accent) 65%, transparent),
              0 2px 4px -1px color-mix(in srgb, var(--accent) 30%, transparent);
  overflow: hidden;
}
.mobile-brand-header .brand-logo-tile svg {
  animation: rumbo-compass-spin 12s linear infinite;
  transform-origin: 50% 50%;
}
.norte-compass-anim svg {
  animation: rumbo-compass-spin 18s linear infinite;
  transform-origin: 50% 50%;
}
@keyframes rumbo-compass-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .mobile-brand-header .brand-logo-tile svg,
  .norte-compass-anim svg { animation: none; }
}
.mobile-brand-header .brand-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}
.mobile-brand-header .brand-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.mobile-brand-header .brand-name {
  font-size: 20px;
  font-weight: 900;
  color: var(--accent);
  letter-spacing: -0.5px;
  line-height: 1;
}
.mobile-brand-header .brand-sep {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 45%, var(--t5));
  display: inline-block;
  flex-shrink: 0;
}
.mobile-brand-header .brand-sub {
  font-size: 13px;
  font-weight: 600;
  color: color-mix(in srgb, var(--accent) 70%, var(--t4));
  letter-spacing: -0.1px;
  line-height: 1;
}
.mobile-brand-header .brand-tagline {
  font-size: 9.5px;
  font-weight: 500;
  color: var(--t5);
  letter-spacing: 1.3px;
  text-transform: uppercase;
  line-height: 1;
}
.mobile-brand-header .theme-toggle {
  margin-left: auto;
  flex-shrink: 0;
}

/* ─── SECTION HEADER ────────────────────────────────────────── */
.screen-header {
  padding: var(--sp-5) var(--sp-5) 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.screen-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--t1);
  letter-spacing: -0.5px;
  line-height: 1.2;
}
.screen-sub {
  font-size: 13px;
  color: var(--t4);
  margin-top: 2px;
}

/* ─── DIVIDER ───────────────────────────────────────────────── */
.divider { height: 1px; background: var(--border); }

/* ─── ANIMATIONS ────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
@keyframes fadeScaleIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.95); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.55; }
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-10px) scale(0.94); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; }
  to   { opacity: 0; transform: translateY(-6px) scale(0.96); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ─── TOAST ─────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: 20px; left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
  width: min(90%, 360px);
}
.toast {
  padding: 13px 18px;
  border-radius: var(--r-lg);
  font-size: 13px; font-weight: 600;
  display: flex; align-items: center; gap: 10px;
  pointer-events: all;
  animation: toastIn 0.28s cubic-bezier(0.34,1.06,0.64,1) forwards;
  background: #1E293B;
  color: #F1F5F9;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}
.toast.success { background: #14532D; }
.toast.error   { background: #7F1D1D; }
.toast.warning { background: #78350F; }

/* ─── SPINNER ───────────────────────────────────────────────── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border-md);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

/* ─── RESPONSIVE ────────────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }

  .app-sidebar { display: none !important; }
  .app-main    {
    margin-left: 0 !important;
    padding-bottom: calc(var(--nav-h) + 16px);
  }
  .mobile-nav  { display: block; }
  .mobile-brand-header { display: flex; }
  /* En mobile el FAB central del bottom-nav cumple el rol del flotante */
  .fab-fixed   { display: none !important; }

  /* Drawer: padding inferior extra para pulgar en la zona segura */
  .drawer { padding-bottom: max(env(safe-area-inset-bottom, 0px), 20px); }

  /* Inputs dentro del drawer más altos en mobile (44px touch target) */
  .drawer .field,
  .drawer input[type="text"],
  .drawer input[type="number"],
  .drawer input[type="date"],
  .drawer input[type="time"],
  .drawer select { min-height: 44px; }

  .stats-grid-4    { grid-template-columns: repeat(2,1fr) !important; gap: 10px !important; }
  .stats-grid-3    { grid-template-columns: repeat(2,1fr) !important; gap: 10px !important; }
  .grid-2col       { grid-template-columns: 1fr !important; }
  .grid-projection { grid-template-columns: 1fr !important; }
  .screen-pad      { padding: 20px 16px !important; }
  .hide-mobile     { display: none !important; }
  .btn-full-mobile { width: 100% !important; justify-content: center !important; }
}
@media (max-width: 768px) {
  /* Header de cada pantalla: título arriba, controles abajo full-width.
     Padding balanceado: menos arriba (ya respira por el brand header) y
     algo de aire abajo para que no quede pegado a la primera card. */
  .screen-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding-top: 12px !important;
    padding-bottom: 6px !important;
  }
  /* Bloque título + subtítulo centrado para evitar aire a la derecha */
  .screen-header > :first-child {
    text-align: center;
  }
  .screen-header > :last-child {
    align-self: stretch;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-top: 0 !important;
  }
  /* Theme toggle vive en el brand header global en mobile.
     Lo ocultamos del header de cada pantalla para evitar duplicado. */
  .screen-header .theme-toggle { display: none !important; }

  /* MonthSwitcher ocupa todo el ancho de la fila de controles en mobile.
     El botón central (label del mes) crece, las flechas quedan en los bordes. */
  .screen-header .month-switcher {
    display: flex !important;
    width: 100%;
  }
  .screen-header .month-switcher > button:nth-child(2) {
    flex: 1;
    justify-content: center;
  }
  /* Transacciones tiene varios controles que viven juntos en una fila
     (datepicker + Mes + buscar + descargar) — revertimos full-width
     y forzamos una sola fila punta a punta sin wrap. */
  .screen-header--compact .month-switcher {
    display: inline-flex !important;
    width: auto !important;
  }
  .screen-header--compact .month-switcher > button:nth-child(2) {
    flex: 0 1 auto;
    justify-content: flex-start;
    padding: 4px 6px !important;
  }
  .screen-header--compact > :last-child {
    justify-content: space-between !important;
    flex-wrap: nowrap !important;
    gap: 6px !important;
  }
}
@media (max-width: 480px) {
  .stats-grid-4 { grid-template-columns: 1fr 1fr !important; gap: 8px !important; }
  .screen-title { font-size: 20px; }

  /* Padding horizontal reducido en pantallas muy pequeñas */
  .screen-header { padding-left: 16px !important; padding-right: 16px !important; }
}
