/* =============================================
   AHORRETA - Fintech Dark Design System
   Fuente display: DM Serif Display
   Fuente UI: DM Sans
   Paleta: Argentina — Celeste & Blanco
   ============================================= */

@import url("https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap");

/* ---------- Variables ---------- */
:root {
  /* Fondos oscuros con tinte celeste */
  --bg-base: #060c14;
  --bg-surface: #0b1420;
  --bg-elevated: #101d2e;
  --bg-hover: #162538;
  --bg-input: #0e1825;
  --border: #1a2e44;
  --border-strong: #244060;

  /* Texto */
  --text-primary: #f0f6ff;
  --text-secondary: #7ba3cc;
  --text-muted: #3d6080;

  /* MARCA — celeste y blanco argentino (solo identidad, no datos) */
  --brand-celeste: #74c5f5;
  --brand-white: #ffffff;

  /* DATOS — convención financiera universal */
  --accent-green: #22c55e; /* verde = ingreso / positivo */
  --accent-green-dim: #14532d;
  --accent-red: #f0445a; /* rojo = gasto / negativo */
  --accent-red-dim: #8a1a27;

  /* Sol de mayo dorado — cuotas / deuda */
  --accent-amber: #f5c842;
  --accent-amber-dim: #7a5c00;

  /* Celeste — info / ahorros ARS */
  --accent-blue: #38a8f5;
  --accent-blue-dim: #0a3860;

  /* Violeta — ahorros USD / patrimonio */
  --accent-violet: #a78bfa;
  --accent-violet-dim: #3b2880;

  --sidebar-w: 240px;
  --sidebar-collapsed: 64px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --font-display: "DM Serif Display", serif;
  --font-ui: "DM Sans", sans-serif;
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.5);
  --shadow-glow-green: 0 0 20px rgba(34, 197, 94, 0.18);
  --shadow-glow-red: 0 0 20px rgba(240, 68, 90, 0.15);
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-ui);
  background-color: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* subtle noise texture on bg */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

/* =============================================
   LANDING PAGE
   ============================================= */
#pantalla-home {
  background: var(--bg-base);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#pantalla-home header {
  background: transparent;
  border: none !important;
  padding: 4rem 1rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

#pantalla-home header::before {
  content: "";
  position: absolute;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(
    circle,
    rgba(116, 197, 245, 0.1) 0%,
    transparent 70%
  );
  pointer-events: none;
}

.landing-logo {
  font-family: var(--font-display);
  font-size: 4.5rem;
  letter-spacing: -2px;
  line-height: 1;
  margin-bottom: 0.5rem;
  /* Franjas celeste - blanco - celeste de la bandera argentina */
  background: linear-gradient(
    180deg,
    #74c5f5 0%,
    #74c5f5 30%,
    #ffffff 45%,
    #ffffff 55%,
    #74c5f5 70%,
    #74c5f5 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.landing-logo span {
  /* hereda el degradé del padre — no hace falta override */
}

.landing-tagline {
  font-size: 1.15rem;
  color: var(--text-secondary);
  font-weight: 300;
  max-width: 520px;
  margin: 0.75rem auto 0;
  line-height: 1.65;
}

.landing-pill {
  display: inline-block;
  background: rgba(116, 197, 245, 0.12);
  color: var(--brand-celeste);
  border: 1px solid rgba(116, 197, 245, 0.25);
  border-radius: 100px;
  padding: 0.25rem 0.9rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  max-width: 900px;
  margin: 3rem auto 0;
  padding: 0 1rem;
}

@media (max-width: 700px) {
  .features-grid {
    grid-template-columns: 1fr;
  }
  .landing-logo {
    font-size: 3rem;
  }
}

.feature-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.5rem;
  text-align: left;
  transition:
    border-color 0.25s,
    transform 0.25s;
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--accent-green),
    #ffffff,
    var(--accent-green),
    transparent
  );
  opacity: 0;
  transition: opacity 0.3s;
}

.feature-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-3px);
}

.feature-card:hover::before {
  opacity: 1;
}

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  margin-bottom: 1rem;
}

.feature-icon.green {
  background: rgba(16, 217, 126, 0.1);
  color: var(--accent-green);
}
.feature-icon.amber {
  background: rgba(245, 166, 35, 0.1);
  color: var(--accent-amber);
}
.feature-icon.blue {
  background: rgba(56, 189, 248, 0.1);
  color: var(--accent-blue);
}

.feature-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}

.feature-card p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.landing-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 3rem 1rem;
  text-align: center;
  margin-top: 4rem;
}

.landing-footer h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  font-weight: 400;
}

.landing-footer p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 2rem;
}

/* =============================================
   APP SHELL: SIDEBAR + MAIN
   ============================================= */
#contenedor-app {
  display: flex;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.app-sidebar {
  width: var(--sidebar-w);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  transition:
    width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.3s;
  overflow: hidden;
}

.sidebar-header {
  padding: 1.5rem 1.25rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.sidebar-brand {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  white-space: nowrap;
}

.sidebar-brand em {
  color: var(--accent-green);
  font-style: normal;
}

.sidebar-logo-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  background: rgba(116, 197, 245, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-celeste);
  font-size: 1rem;
  flex-shrink: 0;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0.75rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-nav::-webkit-scrollbar {
  width: 3px;
}
.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar-nav::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 99px;
}

.sidebar-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.75rem 0.6rem 0.25rem;
  white-space: nowrap;
}

.nav-link-sidebar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition:
    background 0.15s,
    color 0.15s;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  white-space: nowrap;
  position: relative;
}

.nav-link-sidebar:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-link-sidebar.active {
  background: rgba(116, 197, 245, 0.1);
  color: var(--brand-celeste);
}

.nav-link-sidebar .nav-icon {
  font-size: 1rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.nav-link-sidebar .nav-badge {
  margin-left: auto;
  font-size: 0.65rem;
  background: rgba(240, 68, 90, 0.15);
  color: var(--accent-red);
  border-radius: 99px;
  padding: 0.1rem 0.45rem;
  font-weight: 700;
}

.sidebar-footer {
  padding: 1rem 0.75rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.5rem 0.6rem;
  border-radius: var(--radius-md);
  background: var(--bg-hover);
}

.sidebar-user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(167, 139, 250, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-violet);
  font-size: 0.8rem;
  flex-shrink: 0;
}

.sidebar-user-name {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Main Content ---------- */
.app-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  transition: margin-left 0.3s;
}

.main-topbar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(8px);
}

.topbar-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--text-primary);
  font-weight: 400;
  letter-spacing: -0.3px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.25rem;
}

.main-content {
  padding: 2rem;
  max-width: 1400px;
}

/* =============================================
   SECTION HEADERS
   ============================================= */
.section-header {
  margin-bottom: 1.75rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 400;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  line-height: 1.15;
}

.section-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* =============================================
   KPI CARDS
   ============================================= */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 1100px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 600px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }
}

.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s;
}

.kpi-card:hover {
  border-color: var(--border-strong);
}

.kpi-card::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.kpi-card.green::after {
  background: var(--accent-green);
  box-shadow: var(--shadow-glow-green);
}
.kpi-card.blue::after {
  background: var(--accent-blue);
}
.kpi-card.red::after {
  background: var(--accent-red);
  box-shadow: var(--shadow-glow-red);
}
.kpi-card.violet::after {
  background: var(--accent-violet);
}

.kpi-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.kpi-value {
  font-family: var(--font-display);
  font-size: 1.9rem;
  line-height: 1;
  letter-spacing: -0.5px;
  margin-bottom: 0.3rem;
}

.kpi-card.green .kpi-value {
  color: var(--accent-green);
}
.kpi-card.blue .kpi-value {
  color: var(--accent-blue);
}
.kpi-card.red .kpi-value {
  color: var(--accent-red);
}
.kpi-card.violet.kpi-value {
  color: var(--accent-violet);
}

.kpi-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.kpi-icon {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  font-size: 1.5rem;
  opacity: 0.12;
}

/* =============================================
   CARDS
   ============================================= */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-card);
}

.card-header {
  background: var(--bg-elevated) !important;
  border-bottom: 1px solid var(--border) !important;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-secondary) !important;
  padding: 0.9rem 1.25rem;
  border-top-left-radius: calc(var(--radius-lg) - 1px) !important;
  border-top-right-radius: calc(var(--radius-lg) - 1px) !important;
}

.card-body {
  padding: 1.5rem;
}

/* =============================================
   SUMMARY CARDS (3-month) 
   ============================================= */
.summary-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.summary-item {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.1rem;
  text-align: center;
  transition: border-color 0.2s;
}

.summary-item:hover {
  border-color: var(--border-strong);
}

.summary-month {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.summary-amount {
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: -0.3px;
}

/* =============================================
   FORMS
   ============================================= */
.form-section {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.form-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

label.form-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  display: block;
}

.form-control,
.form-select {
  background: var(--bg-input) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-primary) !important;
  border-radius: var(--radius-md) !important;
  font-family: var(--font-ui);
  font-size: 0.875rem;
  padding: 0.55rem 0.875rem;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.form-control::placeholder {
  color: var(--text-muted);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--brand-celeste) !important;
  box-shadow: 0 0 0 3px rgba(116, 197, 245, 0.15) !important;
  outline: none;
  background: var(--bg-input) !important;
  color: var(--text-primary) !important;
}

.form-select option {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.input-group-text {
  background: var(--bg-elevated) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-secondary) !important;
  font-size: 0.8rem;
  font-weight: 600;
}

.form-control-color {
  padding: 0.375rem;
  width: 44px !important;
  cursor: pointer;
  border-radius: var(--radius-md) !important;
}

/* =============================================
   BUTTONS
   ============================================= */
.btn {
  font-family: var(--font-ui);
  font-weight: 600;
  border-radius: var(--radius-md) !important;
  font-size: 0.85rem;
  transition: all 0.15s;
}

.btn-success,
.btn-primary-app {
  background: var(--accent-green) !important;
  border-color: var(--accent-green) !important;
  color: #04140a !important;
}
.btn-success:hover {
  background: #16a34a !important;
  box-shadow: var(--shadow-glow-green);
}

.btn-danger {
  background: var(--accent-red) !important;
  border-color: var(--accent-red) !important;
  color: #fff !important;
}
.btn-danger:hover {
  background: #e02d44 !important;
}

.btn-warning {
  background: var(--accent-amber) !important;
  border-color: var(--accent-amber) !important;
  color: #1a0e00 !important;
}
.btn-warning:hover {
  background: #e8981a !important;
}

.btn-info {
  background: var(--accent-blue) !important;
  border-color: var(--accent-blue) !important;
  color: #041824 !important;
}
.btn-info:hover {
  background: #22b0e8 !important;
}

.btn-primary {
  background: var(--accent-violet) !important;
  border-color: var(--accent-violet) !important;
  color: #fff !important;
}
.btn-primary:hover {
  background: #9270f8 !important;
}

.btn-outline-secondary {
  border-color: var(--border-strong) !important;
  color: var(--text-secondary) !important;
  background: transparent !important;
}
.btn-outline-secondary:hover {
  background: var(--bg-hover) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-strong) !important;
}

.btn-outline-danger {
  border-color: rgba(240, 68, 90, 0.3) !important;
  color: var(--accent-red) !important;
  background: transparent !important;
}
.btn-outline-danger:hover {
  background: rgba(240, 68, 90, 0.1) !important;
  border-color: var(--accent-red) !important;
}

.btn-outline-success {
  border-color: rgba(34, 197, 94, 0.3) !important;
  color: var(--accent-green) !important;
  background: transparent !important;
}
.btn-outline-success:hover {
  background: rgba(34, 197, 94, 0.1) !important;
  border-color: var(--accent-green) !important;
}

.btn-outline-info {
  border-color: rgba(56, 189, 248, 0.3) !important;
  color: var(--accent-blue) !important;
  background: transparent !important;
}
.btn-outline-info:hover {
  background: rgba(56, 189, 248, 0.1) !important;
  border-color: var(--accent-blue) !important;
}

.btn-outline-warning {
  border-color: rgba(245, 166, 35, 0.3) !important;
  color: var(--accent-amber) !important;
  background: transparent !important;
}
.btn-outline-warning:hover {
  background: rgba(245, 166, 35, 0.1) !important;
  border-color: var(--accent-amber) !important;
}

.btn-sm {
  font-size: 0.78rem;
  padding: 0.3rem 0.65rem;
}

/* submit button accent */
.btn-submit-green {
  background: linear-gradient(135deg, var(--accent-green), #06c47a);
  border: none;
  color: #041a0e;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 0.55rem 1.25rem;
  border-radius: var(--radius-md);
  transition:
    opacity 0.2s,
    transform 0.15s;
}
.btn-submit-green:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* =============================================
   TABLES
   ============================================= */
.table-wrapper {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.table {
  color: var(--text-primary) !important;
  border-color: var(--border) !important;
  margin-bottom: 0 !important;
  font-size: 0.875rem;
}

.table thead th {
  background: var(--bg-elevated) !important;
  color: var(--text-muted) !important;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border) !important;
  padding: 0.85rem 1rem;
  white-space: nowrap;
}

.table tbody tr {
  border-bottom: 1px solid var(--border) !important;
  transition: background 0.12s;
}

.table tbody tr:last-child {
  border-bottom: none !important;
}
.table tbody tr:hover {
  background: var(--bg-hover) !important;
}

.table tbody td {
  padding: 0.8rem 1rem;
  vertical-align: middle;
  border: none !important;
  color: var(--text-primary);
}

.table-dark {
  --bs-table-bg: transparent !important;
}

/* =============================================
   BADGES & PILLS
   ============================================= */
.badge-custom-pill {
  font-weight: 600;
  padding: 0.35em 0.8em;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

.badge {
  font-weight: 600;
  border-radius: var(--radius-sm) !important;
  font-size: 0.72rem;
}

.bg-success {
  background: rgba(34, 197, 94, 0.15) !important;
  color: var(--accent-green) !important;
  border: 1px solid rgba(34, 197, 94, 0.25) !important;
}
.bg-danger {
  background: rgba(240, 68, 90, 0.15) !important;
  color: var(--accent-red) !important;
  border: 1px solid rgba(240, 68, 90, 0.25) !important;
}
.bg-info {
  background: rgba(56, 189, 248, 0.15) !important;
  color: var(--accent-blue) !important;
  border: 1px solid rgba(56, 189, 248, 0.25) !important;
}
.bg-primary {
  background: rgba(167, 139, 250, 0.15) !important;
  color: var(--accent-violet) !important;
  border: 1px solid rgba(167, 139, 250, 0.25) !important;
}
.bg-warning {
  background: rgba(245, 166, 35, 0.15) !important;
  color: var(--accent-amber) !important;
  border: 1px solid rgba(245, 166, 35, 0.25) !important;
}
.bg-dark {
  background: var(--bg-elevated) !important;
  color: var(--text-secondary) !important;
  border: 1px solid var(--border) !important;
}

.text-success {
  color: var(--accent-green) !important;
}
.text-danger {
  color: var(--accent-red) !important;
}
.text-info {
  color: var(--accent-blue) !important;
}
.text-warning {
  color: var(--accent-amber) !important;
}
.text-primary {
  color: var(--accent-violet) !important;
}
.text-muted {
  color: var(--text-muted) !important;
}

/* =============================================
   COLLAPSE BUTTONS
   ============================================= */
.btn-collapse-custom {
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  transition: all 0.2s;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.btn-collapse-custom:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

/* =============================================
   ICON PICKER
   ============================================= */
.btn-icon-picker {
  border-radius: var(--radius-sm) !important;
  color: var(--text-secondary) !important;
  background: transparent !important;
  border: none !important;
  transition:
    background 0.15s,
    color 0.15s;
}
.btn-icon-picker:hover {
  background: var(--bg-hover) !important;
  color: var(--accent-green) !important;
}

.dropdown-menu-dark {
  background: var(--bg-elevated) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6) !important;
}

/* =============================================
   LIST GROUP (Tarjetas & Categorías)
   ============================================= */
.list-group-item {
  background: transparent !important;
  border: none !important;
  border-bottom: 1px solid var(--border) !important;
  color: var(--text-primary) !important;
  padding: 0.75rem 0.5rem !important;
  font-size: 0.875rem;
  transition: background 0.15s;
}
.list-group-item:last-child {
  border-bottom: none !important;
}
.list-group-item:hover {
  background: var(--bg-hover) !important;
}

/* =============================================
   NAV PILLS
   ============================================= */
.nav-pills .nav-link {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.8rem;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-md);
  transition: all 0.15s;
  border: 1px solid transparent;
}
.nav-pills .nav-link:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.nav-pills .nav-link.active {
  background: rgba(116, 197, 245, 0.12);
  color: var(--brand-celeste) !important;
  border-color: rgba(116, 197, 245, 0.25);
}

/* =============================================
   MODAL
   ============================================= */
.modal-content {
  background: var(--bg-elevated) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-xl) !important;
  box-shadow: 0 16px 64px rgba(0, 0, 0, 0.7) !important;
}

.modal-header {
  border-bottom: 1px solid var(--border) !important;
  background: var(--bg-surface) !important;
  border-radius: calc(var(--radius-xl) - 1px) calc(var(--radius-xl) - 1px) 0 0 !important;
  padding: 1.25rem 1.5rem !important;
}

.modal-footer {
  border-top: 1px solid var(--border) !important;
  background: var(--bg-surface) !important;
  border-radius: 0 0 calc(var(--radius-xl) - 1px) calc(var(--radius-xl) - 1px) !important;
  padding: 1rem 1.5rem !important;
}

.modal-body {
  padding: 1.5rem !important;
}
.modal-title {
  color: var(--text-primary) !important;
  font-weight: 600;
}
.btn-close-white {
  filter: invert(1) grayscale(1) brightness(0.7);
}

/* =============================================
   PROJECTION CARDS (Cuotas)
   ============================================= */
.proyeccion-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  text-align: center;
  transition: border-color 0.2s;
}
.proyeccion-card.activo {
  border-color: var(--accent-blue);
}
.proyeccion-card .mes-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.proyeccion-card .mes-monto {
  font-family: var(--font-display);
  font-size: 1rem;
  margin-top: 0.25rem;
}

/* =============================================
   TOTALS STRIP (GastosMensuales, Cuotas, Ahorros)
   ============================================= */
.totals-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.total-item {
  flex: 1;
  min-width: 150px;
  padding: 1.25rem 1.5rem;
  border-right: 1px solid var(--border);
}
.total-item:last-child {
  border-right: none;
}

.total-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.total-value {
  font-family: var(--font-display);
  font-size: 1.75rem;
  letter-spacing: -0.5px;
  line-height: 1;
}

/* =============================================
   CHART CONTAINERS
   ============================================= */
.chart-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-card);
}

.chart-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* =============================================
   MOBILE OVERLAY
   ============================================= */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 99;
  backdrop-filter: blur(2px);
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 900px) {
  .app-sidebar {
    transform: translateX(-100%);
  }
  .app-sidebar.open {
    transform: translateX(0);
    box-shadow: 8px 0 40px rgba(0, 0, 0, 0.6);
  }
  .app-main {
    margin-left: 0;
  }
  .main-content {
    padding: 1.25rem;
  }
  .sidebar-toggle {
    display: block;
  }
  .sidebar-overlay.visible {
    display: block;
  }
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .totals-strip {
    flex-direction: column;
  }
  .total-item {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .total-item:last-child {
    border-bottom: none;
  }
  .summary-strip {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }
  .features-grid {
    grid-template-columns: 1fr;
  }
  .main-topbar {
    padding: 0.75rem 1rem;
  }
  .main-content {
    padding: 1rem;
  }
}

/* =============================================
   MISC UTILITIES
   ============================================= */
h2 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}

/* Toast-like save indicator */
@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.toast-saved {
  animation: fadeSlideIn 0.2s ease;
}

/* Scrollbar global */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* =============================================
   CENTRO DE NOTIFICACIONES
   ============================================= */
.noti-wrapper {
  position: relative;
}

.noti-campana {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.18s;
  position: relative;
}

.noti-campana:hover {
  background: var(--bg-hover);
  color: var(--brand-celeste);
  border-color: var(--border-strong);
}

.noti-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--accent-red);
  color: #fff;
  border-radius: 99px;
  font-size: 0.68rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-surface);
  font-family: var(--font-ui);
}

.noti-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 360px;
  max-width: calc(100vw - 32px);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition:
    opacity 0.2s,
    transform 0.2s,
    visibility 0.2s;
  z-index: 200;
  overflow: hidden;
}

.noti-panel.abierto {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.noti-panel-header {
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.noti-panel-header span {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.noti-panel-header small {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.noti-panel-body {
  max-height: 380px;
  overflow-y: auto;
}

.noti-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  width: 100%;
  padding: 0.85rem 1.1rem;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  border-left: 3px solid transparent;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}

.noti-item:last-child {
  border-bottom: none;
}
.noti-item:hover {
  background: var(--bg-hover);
}

.noti-item.noti-vencido {
  border-left-color: var(--accent-red);
}
.noti-item.noti-hoy {
  border-left-color: var(--accent-amber);
}
.noti-item.noti-proximo {
  border-left-color: var(--brand-celeste);
}

.noti-icono {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.noti-vencido .noti-icono {
  background: rgba(240, 68, 90, 0.12);
  color: var(--accent-red);
}
.noti-hoy .noti-icono {
  background: rgba(245, 200, 66, 0.12);
  color: var(--accent-amber);
}
.noti-proximo .noti-icono {
  background: rgba(116, 197, 245, 0.12);
  color: var(--brand-celeste);
}

.noti-cuerpo {
  flex: 1;
  min-width: 0;
}

.noti-titulo {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.noti-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.noti-derecha {
  text-align: right;
  flex-shrink: 0;
}

.noti-monto {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.noti-fecha {
  font-size: 0.68rem;
  font-weight: 600;
  margin-top: 0.1rem;
}

.noti-vencido .noti-fecha {
  color: var(--accent-red);
}
.noti-hoy .noti-fecha {
  color: var(--accent-amber);
}
.noti-proximo .noti-fecha {
  color: var(--brand-celeste);
}

.noti-vacio {
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
}

.noti-vacio i {
  font-size: 2rem;
  color: var(--accent-green);
  display: block;
  margin-bottom: 0.5rem;
}

.noti-vacio p {
  font-size: 0.85rem;
  margin: 0;
}

@media (max-width: 480px) {
  .noti-panel {
    position: fixed;
    top: 60px;
    right: 12px;
    left: 12px;
    width: auto;
    max-width: none;
  }
}
