/* =========================================================================
   EPUGMATIC — TEMA GITPUG / GITHUB DARK (solo presentación)
   -------------------------------------------------------------------------
   Hoja aislada: TODAS las reglas viven bajo `body.theme-gitpug`, así que
   con el tema inactivo esta hoja no cambia ni un píxel. No contiene JS,
   ni referencias a Supabase/store/cálculos: pura apariencia.

   Dirección de arte (GitHub Dark Mode, fiel):
   - Fondo #0D1117, paneles #161B22, bordes #30363D, texto #C9D1D9,
     secundario #8B949E. Verde #238636 (botones), #2EA043 (hover),
     #3FB950 (activos/éxito). Azul #58A6FF (enlaces/informativo).
     Esquinas de 6px, system-ui en texto y monoespaciada en cifras,
     fechas y calendario. Sin CRT, sin audio.
   ========================================================================= */

/* ─── Tokens ─────────────────────────────────────────────────────────── */
body.theme-gitpug {
  --surface-base: #0d1117;
  --surface-raised: #161b22;
  --surface-card: #161b22;
  --surface-overlay: #1c2128;
  --surface-cell: #161b22;
  --surface-cell-future: rgba(63, 185, 80, .04);
  --surface-cell-past: rgba(63, 185, 80, .08);
  --text-primary: #c9d1d9;
  --text-secondary: #8b949e;
  /* Sólido, nunca rgba. #7d868f mide 4.68:1 sobre --surface-card (#161b22). */
  --text-muted: #7d868f;
  --text-on-accent: #ffffff;
  --border-subtle: #30363d;
  --border-medium: #484f58;
  --accent-turquoise: #3fb950;
  --accent-fuchsia: #58a6ff;
  --accent-lila: #58a6ff;
  --accent-turquoise-text: #3fb950;
  --accent-fuchsia-text: #79c0ff;
  --accent-lila-text: #79c0ff;
  --accent-turquoise-bg: rgba(63, 185, 80, .12);
  --accent-fuchsia-bg: rgba(88, 166, 255, .12);
  --accent-lila-bg: rgba(88, 166, 255, .12);
  --accent-turquoise-border: rgba(63, 185, 80, .5);
  --accent-fuchsia-border: rgba(88, 166, 255, .5);
  --accent-lila-border: rgba(88, 166, 255, .5);
  /* Acento amarillo del sistema (Metas: tipo Progresivo): amarillo GitHub. */
  --accent-yellow: #d29922;
  --accent-yellow-text: #e3b341;
  --accent-yellow-bg: rgba(210, 153, 34, .12);
  --accent-yellow-border: rgba(210, 153, 34, .5);
  --pulse-day-glow: #3fb950;
  /* Botón sólido de flujo: verde y azul de GitHub con tinta #0d1117 (su propio
     lienzo): 7.45:1 y 7.49:1. */
  --solid-turquoise: #3fb950;
  --solid-turquoise-ink: #0d1117;
  --solid-fuchsia: #58a6ff;
  --solid-fuchsia-ink: #0d1117;
  /* Tercer rol (acciones estructurales): el azul de GitHub, 7.49:1. */
  --solid-lila: #58a6ff;
  --solid-lila-ink: #0d1117;
  /* Forma de los paneles flotantes (desplegables), calcada de su nav-dropdown. */
  --radius-overlay: 6px;
  --shadow-overlay: 0 8px 24px rgba(1, 4, 9, .85);
  /* Forma del tema: 6px, sombra propia y glow verde de GitHub. */
  --radius-card: 6px;
  --radius-control: 6px;
  --shadow-card: 0 8px 24px -14px rgba(1, 4, 9, .85);
  --shadow-card-hover: 0 10px 28px -14px rgba(1, 4, 9, .95);
  --glow-rest: 0 0 12px -6px rgba(63, 185, 80, .5);
  --glow-hover: 0 0 18px -4px rgba(63, 185, 80, .65);
  /* Hero de cuenta: verde → azul de GitHub. Tinta #ffffff: 12.8:1 y 15.7:1. */
  --surface-hero: #0d3a1c;
  --surface-hero-2: #12233f;
  --text-on-hero: #ffffff;
  --collapse-bg: #161b22;
  --collapse-hover: rgba(63, 185, 80, .08);
  color-scheme: dark;
}

/* ─── Base: fondo GitHub + system-ui ────────────────────────────────── */
body.theme-gitpug,
body.theme-gitpug #app-view,
body.theme-gitpug #auth-view {
  background: #0d1117 !important;
}
body.theme-gitpug,
body.theme-gitpug button,
body.theme-gitpug input,
body.theme-gitpug select,
body.theme-gitpug textarea {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Ubuntu, sans-serif !important;
}
body.theme-gitpug h1,
body.theme-gitpug h2,
body.theme-gitpug h3,
body.theme-gitpug .font-display,
body.theme-gitpug #hero-balance,
body.theme-gitpug .pulse-cell-num,
body.theme-gitpug .amount-value {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace !important;
  font-weight: 600 !important;
}
body.theme-gitpug ::selection {
  background: rgba(88, 166, 255, .35);
  color: #ffffff;
}
body.theme-gitpug ::-webkit-scrollbar-thumb {
  background: #30363d;
  border-radius: 6px;
}
body.theme-gitpug :focus-visible {
  outline: 2px solid #58a6ff;
  outline-offset: 2px;
}
body.theme-gitpug #app-ambient {
  display: none !important;
}

/* ─── Logo: texto claro, glow verde commit ──────────────────────────── */
body.theme-gitpug .brand-matic,
body.theme-gitpug .gradient-title {
  background: none !important;
  -webkit-text-fill-color: #c9d1d9 !important;
  color: #c9d1d9 !important;
}
body.theme-gitpug #btn-logo-home img {
  filter: drop-shadow(0 0 10px rgba(63, 185, 80, .55)) !important;
}

/* ─── Paneles de repositorio: #161B22 + borde #30363D ───────────────── */
body.theme-gitpug .neon-card {
  background: #161b22 !important;
  border: 1px solid #30363d !important;
  border-radius: 6px !important;
  box-shadow: none !important;
}
body.theme-gitpug .neon-border-brand,
body.theme-gitpug .neon-border-brand-ring::after {
  background: #161b22 padding-box !important;
}
body.theme-gitpug .neon-border-fuchsia,
body.theme-gitpug .neon-border-lila { border-color: rgba(88, 166, 255, .5) !important; }
body.theme-gitpug .neon-border-turquoise { border-color: rgba(63, 185, 80, .5) !important; }

/* ─── Header estilo navbar de GitHub ────────────────────────────────── */
body.theme-gitpug header {
  background: #161b22 !important;
  border-bottom: 1px solid #30363d !important;
}
body.theme-gitpug .nav-dropdown-menu {
  background: #161b22 !important;
  border: 1px solid #30363d !important;
  border-radius: 6px !important;
  box-shadow: 0 8px 24px rgba(1, 4, 9, .85) !important;
}
body.theme-gitpug .nav-btn,
body.theme-gitpug .nav-dropdown-item,
body.theme-gitpug .drawer-item {
  border-radius: 6px !important;
}
body.theme-gitpug .nav-btn:hover:not([class*="tab-active"]) {
  background: rgba(177, 186, 196, .12) !important;
  color: #c9d1d9 !important;
}
body.theme-gitpug .nav-btn[class*="tab-active"],
body.theme-gitpug .nav-dropdown-item.active-view {
  background: rgba(63, 185, 80, .15) !important;
  color: #3fb950 !important;
  box-shadow: none !important;
}
body.theme-gitpug .nav-dropdown-item.active-view .text-txt { color: #3fb950 !important; }
body.theme-gitpug #mobile-drawer {
  background: #161b22 !important;
  border-right: 1px solid #30363d !important;
}
body.theme-gitpug .drawer-item.active-view {
  background: rgba(63, 185, 80, .12) !important;
  color: #3fb950 !important;
}
body.theme-gitpug .drawer-item.active-view span:last-child { color: #3fb950 !important; }
body.theme-gitpug .profile-pill {
  background: rgba(177, 186, 196, .08) !important;
  border: 1px solid #30363d !important;
  border-radius: 6px !important;
}

/* ─── Hero: saldo monoespaciado en verde commit ─────────────────────── */
body.theme-gitpug #hero-balance {
  font-size: 2.6rem !important;
  color: #3fb950 !important;
  text-shadow: none !important;
}
body.theme-gitpug .hero-quick-btn {
  border-radius: 6px !important;
  background: #21262d !important;
  border: 1px solid #30363d !important;
}
body.theme-gitpug .hero-quick-btn:hover {
  background: #30363d !important;
  border-color: #8b949e !important;
}
body.theme-gitpug #hero-btn-ingreso {
  background: #238636 !important;
  border: 1px solid rgba(240, 246, 252, .1) !important;
  color: #ffffff !important;
}
body.theme-gitpug #hero-btn-ingreso:hover {
  background: #2ea043 !important;
}
body.theme-gitpug #hero-btn-gasto {
  background: #21262d !important;
  border: 1px solid #30363d !important;
  color: #c9d1d9 !important;
}
body.theme-gitpug #hero-btn-transferir {
  background: transparent !important;
  border: 1px solid #58a6ff !important;
  color: #79c0ff !important;
}

/* ─── Pulso: contribution graph de GitHub ───────────────────────────── */
body.theme-gitpug .pulse-cell {
  aspect-ratio: 1;
  border-radius: 2px !important;
  border: 1px solid #30363d !important;
  background: #161b22 !important;
  box-shadow: none !important;
}
body.theme-gitpug .pulse-cell-num {
  font-size: 1rem !important;
  color: #8b949e !important;
}
body.theme-gitpug .pulse-cell.is-today {
  border-color: #3fb950 !important;
  box-shadow: inset 0 0 0 1px rgba(63, 185, 80, .6) !important;
}
body.theme-gitpug .pulse-cell.selected {
  background: #238636 !important;
  border-color: #3fb950 !important;
  box-shadow: none !important;
}
body.theme-gitpug .pulse-cell.selected .pulse-cell-num,
body.theme-gitpug .pulse-cell.selected .pulse-cell-plus {
  color: #ffffff !important;
}
body.theme-gitpug .pulse-cell-plus { color: rgba(63, 185, 80, .55) !important; }

/* ─── Colapsable ────────────────────────────────────────────────────── */
body.theme-gitpug .dashboard-collapse-header {
  border-radius: 6px !important;
  border: 1px solid #30363d !important;
}
body.theme-gitpug .dashboard-collapse-header:hover { background: rgba(63, 185, 80, .08) !important; }
/* Tira de estado del repositorio al cierre del análisis (solo look, vía CSS) */
body.theme-gitpug #dashboard-analysis-body::after {
  content: '// README.md — BUILD PASSING ✓';
  display: block;
  padding: 10px 4px 2px;
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 11px;
  letter-spacing: .06em;
  color: #3fb950;
}

/* ─── Inputs estilo GitHub ──────────────────────────────────────────── */
body.theme-gitpug .neon-input {
  background: #0d1117 !important;
  border: 1px solid #30363d !important;
  border-radius: 6px !important;
  color: #c9d1d9 !important;
}
body.theme-gitpug .neon-input:focus {
  border-color: #58a6ff !important;
  box-shadow: 0 0 0 3px rgba(88, 166, 255, .25) !important;
}
body.theme-gitpug .neon-input::placeholder { color: #8b949e !important; }
body.theme-gitpug select.neon-input option,
body.theme-gitpug select.neon-input optgroup {
  background-color: #161b22 !important;
  color: #c9d1d9 !important;
}

/* ─── Botones / chips / tabs ────────────────────────────────────────── */
/* La forma la manda el token (--radius-control), no un literal por hoja. */
body.theme-gitpug button { border-radius: var(--radius-control, 6px) !important; }
body.theme-gitpug .neon-cta {
  background: #238636 !important;
  color: #ffffff !important;
  border: 1px solid rgba(240, 246, 252, .1) !important;
  box-shadow: none !important;
}
body.theme-gitpug .neon-cta:hover { background: #2ea043 !important; box-shadow: none !important; }
body.theme-gitpug .link-chip {
  border-radius: 6px !important;
  background: rgba(88, 166, 255, .1) !important;
  border-color: rgba(88, 166, 255, .4) !important;
  color: #79c0ff !important;
  box-shadow: none !important;
}
body.theme-gitpug .link-chip-ghost {
  background: rgba(177, 186, 196, .08) !important;
  color: #8b949e !important;
}
body.theme-gitpug .tab-active-turquoise {
  background: rgba(63, 185, 80, .15) !important;
  border-color: #3fb950 !important;
  color: #3fb950 !important;
  box-shadow: none !important;
}
body.theme-gitpug .tab-active-fuchsia {
  background: rgba(88, 166, 255, .15) !important;
  border-color: #58a6ff !important;
  color: #79c0ff !important;
  box-shadow: none !important;
}
body.theme-gitpug .tab-active-lila {
  background: rgba(88, 166, 255, .15) !important;
  border-color: #58a6ff !important;
  color: #79c0ff !important;
  box-shadow: none !important;
}

/* ─── Semántica Gitpug ──────────────────────────────────────────────── */
body.theme-gitpug .text-turquoise { color: #3fb950 !important; }
body.theme-gitpug .text-fuchsia { color: #79c0ff !important; }
body.theme-gitpug .text-lila { color: #79c0ff !important; }
body.theme-gitpug .progress-track { background: #21262d !important; }
body.theme-gitpug .progress-fill-fijo { background: #3fb950 !important; }
body.theme-gitpug .progress-fill-comp { background: linear-gradient(90deg, #238636 0%, #58a6ff 100%) !important; }
body.theme-gitpug .progress-fill::after { display: none !important; }

/* ─── Actividad / tablas ───────────────────────────────────────────── */
body.theme-gitpug .recent-card {
  border-radius: 6px !important;
  border: 1px solid #30363d !important;
  background: #161b22 !important;
}
body.theme-gitpug .recent-card:hover {
  border-color: rgba(63, 185, 80, .5) !important;
  background: #161b22 !important;
}
body.theme-gitpug .recent-icon { border-radius: 6px !important; }
body.theme-gitpug table th { color: #8b949e !important; }
body.theme-gitpug table td { color: #c9d1d9 !important; }
body.theme-gitpug table tr { border-color: #21262d !important; }

/* ─── Splash acorde al tema (F5 nace en #0D1117) ─────────────────────── */
body.theme-gitpug #splash-screen { background: #0d1117 !important; }
body.theme-gitpug #splash-screen img {
  filter: drop-shadow(0 0 16px rgba(63, 185, 80, .45)) !important;
}
body.theme-gitpug #splash-screen p {
  color: #8b949e !important;
  font-family: 'SFMono-Regular', Consolas, monospace !important;
}
body.theme-gitpug #splash-screen .bg-white\/5 { background: rgba(177, 186, 196, .12) !important; }
body.theme-gitpug #splash-screen [class*="animate-[splashBar"] {
  background: #238636 !important;
  box-shadow: none !important;
}

/* ─── Modales / sheets / toast / FABs ──────────────────────────────── */
body.theme-gitpug .modal-backdrop { background: rgba(1, 4, 9, .8) !important; }
body.theme-gitpug .sheet {
  background: #161b22 !important;
  border: 1px solid #30363d !important;
  border-radius: 6px 6px 0 0 !important;
}
body.theme-gitpug .toast {
  background: #161b22 !important;
  border: 1px solid #30363d !important;
  border-radius: 6px !important;
  color: #c9d1d9 !important;
}
body.theme-gitpug #btn-fab-add {
  background: #238636 !important;
  color: #ffffff !important;
  border-radius: 6px !important;
  box-shadow: none !important;
}
body.theme-gitpug #btn-fab-add:hover { background: #2ea043 !important; }
body.theme-gitpug #btn-fab-voice { border-radius: 6px !important; }

/* ─── Misceláneos ──────────────────────────────────────────────────── */
body.theme-gitpug .glossary-trigger {
  border: 1px solid rgba(88, 166, 255, .4) !important;
  border-radius: 6px !important;
}
body.theme-gitpug .bubble-mine {
  background: rgba(63, 185, 80, .1) !important;
  border: 1px solid rgba(63, 185, 80, .35) !important;
  border-radius: 6px !important;
}
body.theme-gitpug .bubble-theirs {
  background: rgba(177, 186, 196, .08) !important;
  border: 1px solid #30363d !important;
  border-radius: 6px !important;
}
body.theme-gitpug .skeleton { --skeleton-bg: #21262d; --skeleton-shimmer: rgba(255, 255, 255, .08); }
body.theme-gitpug .celebration-card { animation: none !important; }
body.theme-gitpug .sync-spinner { border-top-color: #3fb950 !important; }

/* Movimiento reducido: sin animaciones propias */
@media (prefers-reduced-motion: reduce) {
  body.theme-gitpug * { animation-duration: .01ms !important; }
}
