/* Monifix - Sistema de Diseño Minimalista */
/* Todas las medidas en vw con referencia a 1920px (px / 19.2 = vw) */

:root {
    /* Colores Neutrales - Base */
    --bg-primary: #ffffff;
    --bg-secondary: #f7f8fa;
    --bg-tertiary: #f1f3f5;
    
    /* Texto */
    --text-primary: #1a1d1e;
    --text-secondary: #6c7175;
    --text-tertiary: #9a9ea3;
    
    /* Bordes */
    --border-light: #e8eaed;
    --border-medium: #d3d6da;
    
    /* Colores de Acento - Minimalista */
    --accent-primary: #5b6ef4;
    --accent-primary-hover: #4c5de3;
    --accent-primary-light: #eef0ff;
    
    --accent-success: #0fa968;
    --accent-success-light: #e6f7f0;
    
    --accent-danger: #ef4444;
    --accent-danger-light: #fee2e2;
    
    --accent-warning: #f59e0b;
    --accent-warning-light: #fef3c7;
    
    --accent-info: #3b82f6;
    --accent-info-light: #dbeafe;
    
    /* Sombras Sutiles - EN VW */
    --shadow-xs: 0 0.052vw 0.104vw rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 0.104vw 0.208vw rgba(0, 0, 0, 0.06);
    --shadow-md: 0 0.208vw 0.625vw rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 0.417vw 1.25vw rgba(0, 0, 0, 0.12);
    
    /* Bordes Redondeados - EN VW */
    --radius-sm: 0.3125vw;   /* 6px */
    --radius-md: 0.521vw;    /* 10px */
    --radius-lg: 0.729vw;    /* 14px */
    --radius-xl: 1.042vw;    /* 20px */
    
    /* Espaciados - EN VW */
    --space-xs: 0.26vw;      /* 5px */
    --space-sm: 0.521vw;     /* 10px */
    --space-md: 0.833vw;     /* 16px */
    --space-lg: 1.25vw;      /* 24px */
    --space-xl: 1.667vw;     /* 32px */
    --space-2xl: 2.5vw;      /* 48px */
    --space-3xl: 3.125vw;    /* 60px */
    
    /* Tamaños de fuente - EN VW */
    --font-xs: 0.625vw;      /* 12px */
    --font-sm: 0.729vw;      /* 14px */
    --font-base: 0.781vw;    /* 15px */
    --font-md: 0.833vw;      /* 16px */
    --font-lg: 0.938vw;      /* 18px */
    --font-xl: 1.25vw;       /* 24px */
    --font-2xl: 1.667vw;     /* 32px */
    --font-3xl: 2.083vw;     /* 40px */
    
    /* Transiciones */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Layout - EN VW */
    --sidebar-width: 13.542vw;        /* 260px */
    --sidebar-collapsed: 3.75vw;      /* 72px */
    --navbar-height: 3.125vw;         /* 60px */
    --container-padding: 1.563vw;     /* 30px */
    
    /* Compatibilidad con código antiguo */
    --primary-color: var(--accent-primary);
    --primary-hover: var(--accent-primary-hover);
    --success-color: var(--accent-success);
    --danger-color: var(--accent-danger);
    --warning-color: var(--accent-warning);
    --info-color: var(--accent-info);
    --bg-color: var(--bg-secondary);
    --card-bg: var(--bg-primary);
    --text-color: var(--text-primary);
    --text-muted: var(--text-secondary);
    --border-color: var(--border-light);
    --shadow: var(--shadow-xs);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-size: var(--font-base);
    line-height: 1.6;
    min-height: 100vh;
}

/* Escala tipográfica - TODAS EN VW */
h1 { 
    font-size: var(--font-2xl);
    font-weight: 600; 
    letter-spacing: -0.02em;
    margin: 0;
}

h2 { 
    font-size: var(--font-xl);
    font-weight: 600; 
    letter-spacing: -0.01em;
    margin: 0;
}

h3 { 
    font-size: var(--font-lg);
    font-weight: 600;
    margin: 0;
}

h4 { 
    font-size: var(--font-md);
    font-weight: 600;
    margin: 0;
}

p, span, label, input, button, select, textarea {
    font-size: var(--font-sm);
}

/* Flash Messages */
.flash-messages {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    max-width: 400px;
}

.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-lg);
    animation: slideInRight 0.3s ease-out;
}

.alert-success {
    background-color: #d1fae5;
    border: 1px solid var(--success-color);
    color: #065f46;
}

.alert-danger {
    background-color: #fee2e2;
    border: 1px solid var(--danger-color);
    color: #991b1b;
}

.alert-info {
    background-color: #dbeafe;
    border: 1px solid var(--info-color);
    color: #1e40af;
}

.alert-warning {
    background-color: #fef3c7;
    border: 1px solid var(--warning-color);
    color: #92400e;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ========================================
   LAYOUT PRINCIPAL - MONIFIX
   ======================================== */

/* Layout Grid con Sidebar */
.monifix-app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg-secondary);
}

/* Layout principal del contenido */
.app-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    margin-top: var(--navbar-height);
}

/* Cuando sidebar está colapsado */
body.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed);
    background: var(--accent-info-light); /* Color temporal para debug */
}

body.sidebar-collapsed .main-content {
    margin-left: var(--sidebar-collapsed);
}

body.sidebar-collapsed .footer {
    margin-left: var(--sidebar-collapsed);
    background: var(--accent-warning-light); /* Color temporal para debug */
}

/* ========================================
   NAVBAR SUPERIOR
   ======================================== */

.top-navbar {
    background: var(--bg-primary);
    border-bottom: 0.052vw solid var(--border-light); /* 1px */
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0;
    height: var(--navbar-height);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    box-shadow: var(--shadow-xs);
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    padding: 0 var(--space-lg);
}

.sidebar-toggle {
    display: none; /* Oculto en desktop */
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-sm);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.sidebar-toggle:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.sidebar-toggle svg {
    width: 1.25vw; /* 24px */
    height: 1.25vw;
}

.brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.brand-logo {
    font-size: var(--font-xl);
}

.brand-name {
    font-size: var(--font-lg);
    font-weight: 600;
    color: var(--text-primary);
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    padding: 0 var(--space-lg);
}

/* User Menu */
.user-menu {
    position: relative;
}

.user-avatar {
    width: 2.083vw; /* 40px */
    height: 2.083vw;
    border-radius: 50%;
    background: var(--accent-primary);
    color: white;
    border: none;
    font-size: var(--font-md);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.user-avatar:hover {
    background: var(--accent-primary-hover);
    transform: scale(1.05);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + var(--space-sm));
    right: 0;
    min-width: 13.542vw; /* 260px */
    background: var(--bg-primary);
    border: 0.052vw solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-0.521vw); /* -10px */
    transition: all var(--transition-fast);
    z-index: 1000;
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-header {
    padding: var(--space-md);
    border-bottom: 0.052vw solid var(--border-light);
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.user-name {
    font-size: var(--font-sm);
    font-weight: 600;
    color: var(--text-primary);
}

.user-email {
    font-size: var(--font-xs);
    color: var(--text-secondary);
}

.user-dropdown-divider {
    height: 0.052vw; /* 1px */
    background: var(--border-light);
    margin: var(--space-xs) 0;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
    font-size: var(--font-sm);
}

.user-dropdown-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.user-dropdown-item .item-icon {
    font-size: var(--font-md);
}

/* ========================================
   SIDEBAR
   ======================================== */

.sidebar {
    background: var(--bg-primary);
    border-right: 0.052vw solid var(--border-light); /* 1px */
    display: flex;
    flex-direction: column;
    padding: var(--space-md);
    width: var(--sidebar-width);
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    height: calc(100vh - var(--navbar-height));
    overflow-y: auto;
    transition: width var(--transition-base);
    z-index: 90;
    flex-shrink: 0;
}

.sidebar-nav {
    flex: 1;
}

.nav-section {
    margin-bottom: var(--space-xl);
}

.nav-section-title {
    font-size: var(--font-xs);
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: var(--space-sm) var(--space-md);
    margin-bottom: var(--space-xs);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: 0.625vw var(--space-md); /* 12px 16px */
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
    font-size: var(--font-sm);
    font-weight: 500;
    margin-bottom: var(--space-xs);
}

.nav-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-primary-light);
    color: var(--accent-primary);
}

.nav-icon {
    font-size: var(--font-lg);
    flex-shrink: 0;
    width: 1.25vw; /* 24px */
    text-align: center;
}

.nav-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Sidebar Colapsado */
.sidebar.collapsed {
    width: var(--sidebar-collapsed);
    background: var(--accent-info-light); /* Color temporal para debug */
}

.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-section-title {
    display: none;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 0.625vw;
}

/* Botón de Colapso */
.sidebar-collapse-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: var(--space-sm);
    background: var(--bg-tertiary);
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-top: auto;
}

.sidebar-collapse-btn:hover {
    background: var(--border-light);
    color: var(--text-primary);
}

.collapse-icon {
    font-size: var(--font-md);
    transition: transform var(--transition-base);
}

/* ========================================
   MAIN CONTENT
   ======================================== */

.main-content {
    background: var(--bg-secondary);
    padding: var(--space-xl);
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: margin-left var(--transition-base);
    min-height: 0; /* Permite que el contenido haga scroll si es necesario */
}

.content-wrapper {
    max-width: 75vw; /* 1440px */
    margin: 0 auto;
    animation: fadeInContent 0.3s ease-out;
}

@keyframes fadeInContent {
    from {
        opacity: 0;
        transform: translateY(0.521vw); /* 10px */
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   FOOTER
   ======================================== */

.footer {
    background: var(--bg-primary);
    border-top: 0.052vw solid var(--border-light); /* 1px */
    padding: var(--space-lg) 0;
    text-align: center;
    margin-left: var(--sidebar-width);
    transition: margin-left var(--transition-base);
    flex-shrink: 0; /* No se encoge, mantiene su tamaño */
}

.footer-content {
    max-width: 75vw;
    margin: 0 auto;
}

.footer p {
    color: var(--text-secondary);
    margin: var(--space-xs) 0;
}

.text-small {
    font-size: var(--font-xs);
}

/* ========================================
   DEMO BANNER
   ======================================== */

.demo-banner {
    position: fixed;
    top: var(--navbar-height);
    left: var(--sidebar-width);
    right: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: var(--space-sm) var(--space-lg);
    z-index: 80;
    box-shadow: var(--shadow-sm);
    transition: left var(--transition-base);
}

.sidebar.collapsed + .demo-banner {
    left: var(--sidebar-collapsed);
}

.demo-banner-content {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    justify-content: center;
}

.demo-icon {
    font-size: var(--font-lg);
}

.demo-text {
    font-size: var(--font-sm);
}

.demo-link {
    color: white;
    text-decoration: underline;
    margin-left: var(--space-sm);
    font-weight: 600;
}

.demo-link:hover {
    opacity: 0.9;
}

/* ========================================
   RESPONSIVE
   ======================================== */

/* Tablet */
@media (max-width: 1200px) {
    :root {
        --sidebar-width: 11.458vw; /* 220px */
    }
}

/* Mobile */
@media (max-width: 968px) {
    .monifix-app {
        grid-template-columns: 1fr;
        grid-template-areas: 
            "navbar"
            "main"
            "footer";
        grid-template-rows: var(--navbar-height) 1fr auto;
    }
    
    .sidebar-toggle {
        display: flex !important;
    }
    
    .sidebar {
        position: fixed;
        left: -100%;
        top: var(--navbar-height);
        width: var(--sidebar-width);
        height: calc(100vh - var(--navbar-height));
        z-index: 1000;
        transition: left var(--transition-base);
        box-shadow: var(--shadow-lg);
    }
    
    .sidebar.mobile-open {
        left: 0;
    }
    
    .main-content {
        padding: var(--space-lg);
    }
    
    .content-wrapper {
        max-width: 100%;
    }
    
    .demo-banner {
        left: 0;
    }
    
    /* Overlay cuando sidebar está abierto */
    .sidebar.mobile-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: -1;
    }
}

/* Muy pequeño */
@media (max-width: 640px) {
    .brand-name {
        display: none;
    }
    
    .main-content {
        padding: var(--space-md);
    }
}

/* Navbar */
.navbar {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1e40af 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: 1000;  /* Aumentado para estar por encima del banner demo */
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 100%;
    width: 100%;
    padding: 0 3vw;
}

.nav-brand h1 {
    font-size: clamp(1.2rem, 2.5vw, 1.5rem);
    font-weight: 700;
    white-space: nowrap;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: clamp(1rem, 1.5vw, 1.5rem);
    flex: 1;
    justify-content: center;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: clamp(0.75rem, 1.2vw, 1.2rem);
    margin: 0;
    padding: 0;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    white-space: nowrap;
    padding: 0.5rem clamp(0.5rem, 0.8vw, 0.75rem);
    border-radius: 4px;
    display: block;
    font-size: clamp(0.85rem, 1vw, 0.95rem);
}

.nav-menu a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: clamp(0.75rem, 1vw, 1rem);
    white-space: nowrap;
}

.user-greeting {
    color: white;
    font-weight: 500;
}

.btn-logout {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Botón Hamburguesa */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 2rem;
    height: 2rem;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    z-index: 1001;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    transition: all 0.3s ease;
}

.hamburger:hover {
    transform: translateY(-50%) scale(1.1);
}

/* Forzar visibilidad en pantallas medianas */
@media (max-width: 1200px) {
    .hamburger {
        display: flex !important;
    }
}


.hamburger span {
    width: 1.5rem;
    height: 2px;
    background: white;
    border-radius: 1px;
    transition: all 0.3s ease;
    position: relative;
    transform-origin: center;
    display: block;
    margin: 2px 0;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Prevenir scroll cuando el menú está abierto en móvil */
body.menu-open {
    overflow: hidden;
}

/* Overlay sutil cuando el menú está abierto - REMOVIDO
   El overlay ahora se maneja desde el menú mismo para evitar conflictos de z-index */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2vw;
    width: 100%;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem 0;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-header h2 {
    font-size: 2rem;
    color: var(--text-color);
}

/* Cards */
.card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    margin-bottom: var(--space-lg);
    overflow: hidden;
    border: 0.052vw solid var(--border-light); /* 1px */
    transition: all var(--transition-fast);
}

.card:hover {
    box-shadow: var(--shadow-sm);
    border-color: var(--border-medium);
}

.card-header {
    padding: var(--space-lg);
    border-bottom: 0.052vw solid var(--border-light); /* 1px */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2,
.card-header h3 {
    margin: 0;
    font-size: var(--font-lg);
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: var(--space-lg);
}

.card-footer {
    padding: var(--space-md) var(--space-lg);
    border-top: 0.052vw solid var(--border-light); /* 1px */
    background-color: #f8fafc;
}

/* Presupuestos Grid */
.presupuestos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.presupuesto-card {
    transition: transform 0.3s, box-shadow 0.3s;
}

.presupuesto-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* Info Rows */
.info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.info-row:last-child {
    border-bottom: none;
}

.info-row .label {
    font-weight: 500;
    color: var(--text-muted);
}

.info-row .value {
    font-weight: 600;
    color: var(--text-color);
}

.info-row.total-row {
    background-color: #f8fafc;
    padding: 1rem;
    margin-top: 0.5rem;
    border-radius: 8px;
    border: none;
}

.info-row.highlight-row {
    background-color: #fef3c7;
    padding: 1rem;
    margin: 0.5rem 0;
    border-radius: 8px;
    border: 1px solid #fbbf24;
}

.highlight-amount {
    color: var(--primary-color);
    font-size: 1.25rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 0.625vw var(--space-lg); /* 12px 24px */
    border: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: var(--font-sm);
    font-family: inherit;
}

.btn-primary {
    background-color: var(--accent-primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--accent-primary-hover);
    transform: translateY(-0.104vw); /* -2px */
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 0.052vw solid var(--border-medium); /* 1px */
}

.btn-secondary:hover {
    background-color: var(--border-light);
    border-color: var(--text-secondary);
}

.btn-success {
    background-color: var(--accent-success);
    color: white;
}

.btn-success:hover {
    background-color: #0c8755;
    transform: translateY(-0.104vw);
    box-shadow: var(--shadow-md);
}

.btn-danger {
    background-color: var(--accent-danger);
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
    transform: translateY(-0.104vw);
    box-shadow: var(--shadow-md);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 0.052vw solid var(--border-medium); /* 1px */
}

.btn-ghost:hover {
    background: var(--bg-tertiary);
    border-color: var(--text-secondary);
}

.btn-sm {
    padding: 0.365vw 0.729vw; /* 7px 14px */
    font-size: var(--font-xs);
}

.btn-lg {
    padding: 0.833vw var(--space-xl); /* 16px 32px */
    font-size: var(--font-md);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    background-color: #e2e8f0;
    color: var(--text-color);
}

.badge-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-info {
    background-color: #dbeafe;
    color: #1e40af;
}

/* Forms */
.form-card {
    max-width: 700px;
    margin: 0 auto;
}

.form-section {
    margin-bottom: 2rem;
}

.form-section h3 {
    margin-bottom: 1rem;
    color: var(--text-color);
    font-size: 1.25rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-help {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.form-container {
    padding: 1.5rem;
    background-color: #f8fafc;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.form-inline {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.form-inline input,
.form-inline select {
    flex: 1;
    min-width: 150px;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    text-align: left;
    padding: 0.75rem;
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    color: var(--text-color);
    background-color: #f8fafc;
}

.table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.table tbody tr:hover {
    background-color: #f8fafc;
}

.table tfoot td {
    font-weight: 600;
    background-color: #f8fafc;
    border-top: 2px solid var(--border-color);
}

/* Text utilities */
.text-success {
    color: var(--success-color);
}

.text-danger {
    color: var(--danger-color);
}

.text-warning {
    color: #f59e0b; /* Color naranja para deducciones del patrón */
}

.text-muted {
    color: var(--text-muted);
}

.text-center {
    text-align: center;
}

.text-small {
    font-size: 0.875rem;
}

/* Divider */
.divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 1rem 0;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-state h3 {
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

/* Summary */
.summary-card {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 2px solid var(--primary-color);
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.summary-item {
    text-align: center;
}

.summary-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.summary-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    font-style: italic;
    opacity: 0.8;
}

.summary-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.summary-status {
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    display: inline-block;
    margin-top: 0.5rem;
}

.saldo-positivo .summary-value {
    color: var(--success-color);
}

.saldo-positivo .summary-status {
    background-color: #d1fae5;
    color: #065f46;
}

.saldo-negativo .summary-value {
    color: var(--danger-color);
}

.saldo-negativo .summary-status {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Embargo Details */
.embargo-details {
    background-color: #fef3c7;
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 1rem;
    border: 1px solid #fbbf24;
}

.embargo-details h4 {
    margin-bottom: 1rem;
    color: #92400e;
}

.section-title {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-color);
}

/* Alert */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.alert-info {
    background-color: #dbeafe;
    border: 1px solid #3b82f6;
    color: #1e40af;
}

.info-card {
    background-color: #f8fafc;
}

.info-card h4 {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.info-card ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.info-card li {
    margin-bottom: 0.5rem;
}

/* Footer */
.footer {
    background-color: var(--text-color);
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: auto;
}

.footer p {
    margin: 0.25rem 0;
}

/* Calculadora Inline */
.input-with-calc {
    position: relative;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.calc-trigger-btn {
    padding: 0.5rem 0.75rem;
    border: 2px solid var(--primary-color);
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s;
    flex-shrink: 0;
}

.calc-trigger-btn:hover {
    background: var(--primary-color);
    transform: scale(1.1);
}

.calc-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.calc-modal-content {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
}

.calc-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, var(--primary-color) 0%, #1e40af 100%);
    color: white;
}

.calc-modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
}

.calc-close {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s;
}

.calc-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.calc-modal-body {
    padding: 1.5rem;
}

.calc-display {
    background: #f8fafc;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border: 2px solid var(--border-color);
}

.calc-operaciones {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    min-height: 1.5rem;
    word-break: break-all;
}

.calc-total {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.calc-input-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.calc-input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
}

.calc-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.calc-btn {
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    font-size: 0.9375rem;
}

.calc-btn-add {
    background: var(--success-color);
    color: white;
}

.calc-btn-add:hover {
    background: #059669;
    transform: translateY(-1px);
}

.calc-btn-primary {
    background: var(--primary-color);
    color: white;
    flex: 1;
}

.calc-btn-primary:hover {
    background: var(--primary-hover);
}

.calc-btn-secondary {
    background: var(--secondary-color);
    color: white;
    flex: 1;
}

.calc-btn-secondary:hover {
    background: #475569;
}

.calc-valores-lista {
    max-height: 250px;
    overflow-y: auto;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem;
}

.calc-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
    font-style: italic;
}

.calc-valor-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: all 0.3s;
}

.calc-valor-item:hover {
    box-shadow: var(--shadow);
    transform: translateX(4px);
}

.calc-valor-numero {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.calc-valor-monto {
    flex: 1;
    font-weight: 600;
    color: var(--text-color);
}

.calc-valor-eliminar {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.3s;
}

.calc-valor-eliminar:hover {
    background: #fee2e2;
}

.calc-actions {
    display: flex;
    gap: 1rem;
}

.calc-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.calc-tab {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.calc-tab.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.calc-operaciones-btns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.calc-op-btn {
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.calc-op-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.calc-op-btn-igual {
    background: var(--success-color);
    color: white;
    border-color: var(--success-color);
    grid-column: span 3;
    font-weight: 700;
    font-size: 1.1rem;
}

.calc-op-btn-igual:hover {
    background: #059669;
    border-color: #059669;
}

.calc-op-btn-percent {
    background: #fef3c7;
    border-color: #fbbf24;
    color: #92400e;
    font-size: 0.85rem;
}

.calc-op-btn-percent:hover {
    background: #fbbf24;
    color: white;
}

.calc-help {
    padding: 0.75rem;
    background: #fef3c7;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid #fbbf24;
}

.calc-help small {
    color: #92400e;
}

.calc-valor-operacion {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 1rem;
}

/* Botones de acción en tablas */
.action-btns {
    display: flex;
    gap: 0.25rem;
}

.btn-icon {
    padding: 0.375rem 0.625rem;
    border: none;
    background: var(--secondary-color);
    color: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.875rem;
}

.btn-icon:hover {
    transform: scale(1.1);
}

.btn-icon.btn-edit {
    background: var(--info-color);
}

.btn-icon.btn-edit:hover {
    background: #2563eb;
}

.btn-icon.btn-delete {
    background: var(--danger-color);
}

.btn-icon.btn-delete:hover {
    background: #dc2626;
}

/* Modal de edición */
.edit-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.edit-modal-content {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
}

.edit-modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--info-color);
    color: white;
    border-radius: 12px 12px 0 0;
}

.edit-modal-header h3 {
    margin: 0;
}

.edit-modal-body {
    padding: 1.5rem;
}

.edit-modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Scroll suave para modales con contenido largo */
.edit-modal-content {
    scrollbar-width: thin;
    scrollbar-color: #007bff #f1f1f1;
}

.edit-modal-content::-webkit-scrollbar {
    width: 6px;
}

.edit-modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.edit-modal-content::-webkit-scrollbar-thumb {
    background: #007bff;
    border-radius: 3px;
}

.edit-modal-content::-webkit-scrollbar-thumb:hover {
    background: #0056b3;
}

/* Estadísticas */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary-color);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-card.stat-primary {
    border-left-color: var(--primary-color);
}

.stat-card.stat-success {
    border-left-color: var(--success-color);
}

.stat-card.stat-danger {
    border-left-color: var(--danger-color);
}

.stat-card.stat-warning {
    border-left-color: var(--warning-color);
}

.stat-icon {
    font-size: 3rem;
    opacity: 0.8;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-color);
}

.stats-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.chart-container {
    position: relative;
    height: 400px;
}

.progress-bar-container {
    position: relative;
    background: #e2e8f0;
    border-radius: 9999px;
    height: 24px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color) 0%, #1e40af 100%);
    transition: width 0.3s;
    border-radius: 9999px;
}

.progress-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-color);
}

.month-card {
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
}

.month-best {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border: 2px solid var(--success-color);
}

.month-worst {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border: 2px solid var(--danger-color);
}

.month-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.month-saldo {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.month-best .month-saldo {
    color: var(--success-color);
}

.month-worst .month-saldo {
    color: var(--danger-color);
}

.month-details {
    color: var(--text-muted);
}

.health-indicator {
    display: flex;
    align-items: center;
    gap: 3rem;
    flex-wrap: wrap;
    justify-content: center;
    padding: 2rem;
}

.health-circle {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.health-good {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.health-moderate {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.health-bad {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.health-percentage {
    font-size: 3rem;
    font-weight: 700;
}

.health-label {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
}

.health-info {
    flex: 1;
    min-width: 250px;
}

.badge-success {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Calculadoras */
.calculator-selector {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.calc-selector-tab {
    flex: 1;
    min-width: 150px;
    padding: 1rem;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
    text-align: center;
}

.calc-selector-tab:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.calc-selector-tab.active {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

.calculator-section {
    margin-top: 1.5rem;
}

.form-control {
    width: 100%;
    padding: 0.729vw var(--space-md); /* 14px 16px */
    border: 0.052vw solid var(--border-medium); /* 1px */
    border-radius: var(--radius-md);
    font-size: var(--font-sm);
    transition: all var(--transition-fast);
    background: var(--bg-primary);
    color: var(--text-primary);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 0.156vw var(--accent-primary-light); /* 3px */
}

.form-control:disabled {
    background: var(--bg-tertiary);
    cursor: not-allowed;
    opacity: 0.6;
}

.form-label {
    display: block;
    font-size: var(--font-sm);
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.form-group {
    margin-bottom: var(--space-lg);
}

.form-help {
    display: block;
    font-size: var(--font-xs);
    color: var(--text-tertiary);
    margin-top: var(--space-xs);
}

.row-2-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.gastos-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.gasto-input {
    margin-bottom: 0;
}

/* Landing Page */
.landing-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.landing-hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1e40af 100%);
    color: white;
    padding: 6rem 0;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.hero-description {
    font-size: 1.125rem;
    margin-bottom: 2.5rem;
    opacity: 0.8;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.landing-features {
    padding: 5rem 0;
    flex: 1;
}

.features-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--text-color);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.3s;
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.feature-card p {
    color: var(--text-muted);
    line-height: 1.6;
}

/* Badges para features del landing */
.feature-card {
    position: relative;
}

.badge-soon {
    position: absolute;
    top: var(--space-lg);
    right: var(--space-lg);
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    padding: 0.26vw 0.625vw; /* 5px 12px */
    border-radius: var(--radius-xl);
    font-size: var(--font-xs);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.badge-premium {
    position: absolute;
    top: var(--space-lg);
    right: var(--space-lg);
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
    padding: 0.26vw 0.625vw; /* 5px 12px */
    border-radius: var(--radius-xl);
    font-size: var(--font-xs);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

/* Hover especial para feature-coming-soon */
.feature-coming-soon:hover {
    border-color: #f59e0b;
    box-shadow: 0 0.521vw 1.25vw rgba(245, 158, 11, 0.2);
}

/* Hover especial para feature-premium */
.feature-premium:hover {
    border-color: #8b5cf6;
    box-shadow: 0 0.521vw 1.25vw rgba(139, 92, 246, 0.2);
}

/* ========================================
   SECCIÓN DE PRECIOS - LANDING
   ======================================== */

.landing-pricing {
    padding: 3.125vw 0 5.208vw 0; /* 60px 0 100px 0 */
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
}

.pricing-title {
    text-align: center;
    font-size: var(--font-3xl); /* 40px */
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
}

.pricing-subtitle {
    text-align: center;
    font-size: var(--font-lg);
    color: var(--text-secondary);
    margin-bottom: var(--space-2xl);
}

/* Toggle Mensual/Anual */
.pricing-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-lg);
    margin-bottom: var(--space-2xl);
}

.toggle-label {
    font-size: var(--font-md);
    font-weight: 500;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 3.125vw; /* 60px */
    height: 1.667vw; /* 32px */
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-medium);
    transition: var(--transition-base);
    border-radius: 1.667vw; /* 32px */
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 1.25vw; /* 24px */
    width: 1.25vw;
    left: 0.208vw; /* 4px */
    bottom: 0.208vw;
    background-color: white;
    transition: var(--transition-base);
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--accent-primary);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(1.667vw); /* 32px */
}

.discount-badge {
    display: inline-block;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 0.156vw 0.417vw; /* 3px 8px */
    border-radius: var(--radius-xl);
    font-size: var(--font-xs);
    font-weight: 600;
    margin-left: var(--space-xs);
}

/* Grid de Precios */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16.667vw, 1fr)); /* 320px */
    gap: var(--space-xl);
    margin-bottom: var(--space-xl);
}

/* Card de Precio */
.pricing-card {
    background: var(--bg-primary);
    border: 0.104vw solid var(--border-light); /* 2px */
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    text-align: center;
    transition: all var(--transition-base);
    position: relative;
    box-shadow: var(--shadow-sm);
}

.pricing-card:hover {
    transform: translateY(-0.521vw); /* -10px */
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-primary);
}

/* Card Destacada */
.pricing-featured {
    border-color: var(--accent-primary);
    border-width: 0.156vw; /* 3px */
    transform: scale(1.05);
}

.pricing-featured:hover {
    transform: scale(1.08) translateY(-0.521vw);
}

.featured-badge {
    position: absolute;
    top: -0.625vw; /* -12px */
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-primary-hover) 100%);
    color: white;
    padding: 0.26vw 1.042vw; /* 5px 20px */
    border-radius: var(--radius-xl);
    font-size: var(--font-xs);
    font-weight: 600;
    box-shadow: var(--shadow-md);
}

/* Header del precio */
.pricing-header {
    margin-bottom: var(--space-lg);
}

.pricing-header h3 {
    font-size: var(--font-xl);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
}

.pricing-icon {
    font-size: 2.604vw; /* 50px */
}

/* Precio */
.pricing-price {
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: 0.052vw solid var(--border-light); /* 1px */
}

.price-amount {
    font-size: 2.604vw; /* 50px */
    font-weight: 700;
    color: var(--text-primary);
}

.price-period {
    font-size: var(--font-md);
    color: var(--text-secondary);
    margin-left: var(--space-xs);
}

/* Features del plan */
.pricing-features {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--space-xl) 0;
    text-align: left;
}

.pricing-features li {
    padding: 0.625vw 0; /* 12px */
    font-size: var(--font-sm);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.feature-check {
    color: var(--accent-success);
    font-weight: 700;
    font-size: var(--font-lg);
}

/* Botón del plan */
.btn-block {
    width: 100%;
    display: flex;
    justify-content: center;
}

/* Nota de precios */
.pricing-note {
    text-align: center;
    font-size: var(--font-sm);
    color: var(--text-tertiary);
    margin-top: var(--space-lg);
}

/* Responsive Pricing */
@media (max-width: 1200px) {
    .pricing-grid {
        grid-template-columns: repeat(auto-fit, minmax(14.583vw, 1fr)); /* 280px */
    }
}

@media (max-width: 968px) {
    .pricing-grid {
        grid-template-columns: 1fr;
        max-width: 26.042vw; /* 500px */
        margin-left: auto;
        margin-right: auto;
    }
    
    .pricing-featured {
        transform: scale(1);
    }
    
    .pricing-featured:hover {
        transform: translateY(-0.521vw);
    }
    
    .toggle-switch {
        width: 3.5rem;
        height: 2rem;
    }
    
    .toggle-switch input:checked + .toggle-slider:before {
        transform: translateX(1.5rem);
    }
}

@media (max-width: 640px) {
    .pricing-title {
        font-size: 2rem;
    }
    
    .pricing-toggle {
        flex-wrap: wrap;
        gap: var(--space-md);
    }
    
    .price-amount {
        font-size: 2.5rem;
    }
}

.landing-footer {
    background-color: var(--text-color);
    color: white;
    text-align: center;
    padding: 2rem 0;
}

/* Auth Pages */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 2rem;
}

.auth-container {
    width: 100%;
    max-width: 450px;
}

.auth-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.auth-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1e40af 100%);
    color: white;
    padding: 2.5rem 2rem;
    text-align: center;
}

.auth-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.auth-header p {
    opacity: 0.9;
    font-size: 1.125rem;
}

.auth-form {
    padding: 2rem;
}

.btn-block {
    width: 100%;
}

.auth-footer {
    padding: 1.5rem 2rem;
    background-color: #f8fafc;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.auth-footer p {
    margin: 0.5rem 0;
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Responsive */

/* ===========================
   MENÚ HAMBURGUESA RESPONSIVO
   =========================== */

/* Desktop - Menú horizontal normal (>= 1200px) */
@media (min-width: 1200px) {
    .hamburger {
        display: none !important;
    }
    
    .nav-right {
        display: flex !important;
        position: static;
        flex-direction: row;
        align-items: center;
        gap: 2vw;
        height: auto;
        width: auto;
        padding: 0;
        background: transparent;
        box-shadow: none;
        overflow: visible;
        visibility: visible;
    }
    
    .nav-menu {
        display: flex !important;
        flex-direction: row;
        gap: 1.5vw;
    }
    
    .nav-user {
        display: flex !important;
        flex-direction: row;
        gap: 1.5vw;
        padding: 0;
        border: none;
    }
}

/* Tablet y Móvil - Menú hamburguesa (< 1200px) */
@media (max-width: 1199px) {
    /* Mostrar botón hamburguesa */
    .hamburger {
        display: flex !important;
        position: absolute;
        right: 3vw;
        top: 50%;
        transform: translateY(-50%);
        z-index: 1002;
    }
    
    /* Ocultar dropdown "Ver más" completamente en móvil */
    .nav-dropdown-container,
    #navDropdownContainer,
    .nav-item.nav-dropdown-container {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }
    
    /* Menú deslizable desde la derecha */
    .nav-right {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: clamp(280px, 80vw, 400px);
        background: linear-gradient(135deg, var(--primary-color) 0%, #1e40af 100%);
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding: clamp(4rem, 15vw, 6rem) 4vw 4vw;
        gap: 0;
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.3);
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1001;
        overflow-y: auto;
        overflow-x: hidden;
    }
    
    /* Menú activo - visible */
    .nav-right.active {
        right: 0;
    }
    
    /* Overlay oscuro detrás del menú */
    .nav-right.active::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background-color: rgba(0, 0, 0, 0.6);
        z-index: -1;
        animation: fadeIn 0.3s ease;
    }
    
    /* Menú en columna */
    .nav-menu {
        display: flex !important;
        flex-direction: column;
        gap: 0;
        width: 100%;
        list-style: none;
        padding: 0;
        margin: 0 0 2vh 0;
    }
    
    .nav-menu li {
        width: 100%;
        margin: 0;
        display: block !important;
    }
    
    .nav-menu a {
        padding: clamp(0.75rem, 3vw, 1.2rem);
        width: 100%;
        text-align: left;
        border-bottom: 1px solid rgba(255, 255, 255, 0.15);
        border-radius: 0;
        font-size: clamp(0.95rem, 3.5vw, 1.1rem);
        display: block !important;
        color: white !important;
        text-decoration: none;
        transition: all 0.3s ease;
        cursor: pointer;
        background: transparent;
    }
    
    .nav-menu a:hover {
        background-color: rgba(255, 255, 255, 0.15) !important;
        transform: translateX(8px);
        color: white !important;
    }
    
    /* Usuario en columna */
    .nav-user {
        display: flex !important;
        flex-direction: column;
        gap: clamp(0.75rem, 2vw, 1rem);
        width: 100%;
        padding-top: 2vh;
        margin-top: 2vh;
        border-top: 2px solid rgba(255, 255, 255, 0.2);
    }
    
    .user-greeting {
        font-size: clamp(0.95rem, 3.5vw, 1.1rem);
        color: white;
        text-align: center;
    }
    
    .btn-logout {
        width: 100%;
        text-align: center;
        padding: clamp(0.75rem, 3vw, 1rem);
        background-color: rgba(239, 68, 68, 0.9);
        border: 2px solid rgba(255, 255, 255, 0.3);
        border-radius: 8px;
        cursor: pointer;
        transition: all 0.3s ease;
        color: white !important;
        text-decoration: none;
        display: block;
        font-weight: 600;
        font-size: clamp(0.9rem, 3.2vw, 1rem);
    }
    
    .btn-logout:hover {
        background-color: rgba(220, 38, 38, 1);
        border-color: rgba(255, 255, 255, 0.5);
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        color: white !important;
        text-decoration: none;
    }
    
    /* Prevenir scroll cuando el menú está abierto */
    body.menu-open {
        overflow: hidden;
    }
}

/* Ajustes responsive para otros elementos */
@media (max-width: 768px) {
    .hero-title {
        font-size: clamp(2rem, 8vw, 2.5rem);
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .hero-actions {
        flex-direction: column;
    }
    
    .btn-lg {
        width: 100%;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .presupuestos-grid {
        grid-template-columns: 1fr;
    }
    
    .form-inline {
        flex-direction: column;
    }
    
    .form-inline input,
    .form-inline select {
        width: 100%;
    }
    
    .summary-grid {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
    .calculator-selector {
        flex-direction: column;
    }
    
    .calc-tab {
        min-width: 100%;
    }
    
    .gastos-form {
        grid-template-columns: 1fr;
    }
    
    .row-2-cols {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .health-indicator {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .chart-container {
        height: 300px;
    }
    
    .calc-selector-tab {
        min-width: 100%;
    }
    
    /* Tablas responsive */
    .desglose-section {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .desglose-section .table {
        font-size: 0.875rem;
    }
    
    .desglose-section .table thead th,
    .desglose-section .table tbody td {
        padding: 0.5rem;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .input-group .btn {
        width: 100%;
    }
}

/* Móviles muy pequeños */
@media (max-width: 480px) {
    .navbar .container {
        padding: 0 4vw;
    }
    
    .nav-right {
        width: 85vw;
        padding: 20vw 6vw 6vw;
    }
    
    .nav-brand h1 {
        font-size: clamp(1rem, 4.5vw, 1.2rem);
    }
}

/* ===========================
   SWEETALERT2 PERSONALIZACIÓN
   =========================== */
.swal2-popup {
    border-radius: 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.swal2-title {
    color: var(--text-color);
    font-size: 1.5rem;
    font-weight: 600;
}

.swal2-html-container {
    color: var(--text-color);
    font-size: 1rem;
    line-height: 1.6;
}

.swal2-confirm {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
}

.swal2-cancel {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
}

.swal-wide {
    width: 600px !important;
    max-width: 90%;
}

/* Toast personalizado */
.swal2-toast {
    border-radius: 10px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.swal2-toast .swal2-title {
    font-size: 1rem;
}

/* Animación de entrada suave */
.swal2-show {
    animation: swal2-show 0.3s;
}

@keyframes swal2-show {
    0% {
        transform: scale(0.7);
        opacity: 0;
    }
    45% {
        transform: scale(1.05);
        opacity: 1;
    }
    80% {
        transform: scale(0.95);
    }
    100% {
        transform: scale(1);
    }
}

/* ===========================
   DESGLOSE CCSS ESTILOS
   =========================== */
.desglose-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.desglose-section h5 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.desglose-section .table {
    margin-bottom: 0;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.desglose-section .table thead th {
    background-color: var(--primary-color);
    color: white;
    border: none;
    font-weight: 600;
    padding: 0.75rem;
}

.desglose-section .table tbody td {
    padding: 0.75rem;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
}

.desglose-section .table tbody tr:last-child td {
    border-bottom: none;
}

.desglose-section .table tbody tr:hover {
    background-color: #f8fafc;
}

.desglose-section .total-row {
    background-color: #f1f5f9;
    font-weight: 600;
}

.desglose-section .total-row td {
    border-top: 2px solid var(--primary-color);
    color: var(--text-color);
}

.desglose-section .highlight-row {
    background-color: var(--primary-color);
    color: white;
}

.desglose-section .highlight-row td {
    border-top: 2px solid var(--primary-color);
    color: white;
    font-weight: bold;
}

.input-group {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.input-group .form-control {
    flex: 1;
}

.input-group .btn {
    white-space: nowrap;
}

.divider-text {
    text-align: center;
    margin: 1.5rem 0;
    position: relative;
    color: #64748b;
    font-weight: 500;
}

.divider-text::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background-color: #e2e8f0;
    z-index: 1;
}

.divider-text::after {
    content: 'O';
    background-color: white;
    padding: 0 1rem;
    position: relative;
    z-index: 2;
}


/* Prevenir scroll horizontal en toda la página */
body {
    overflow-x: hidden;
}

/* Asegurar que el contenedor principal no cause overflow */
.container {
    max-width: 100%;
    overflow-x: hidden;
}

/* CSS específico para el formulario de perfil */
.perfil .form-card {
    max-width: 100%;
    margin: 0 auto;
    padding: 5vw;
}

/* ===========================
   DROPDOWN "VER MÁS" EN DESKTOP
   =========================== */
.nav-dropdown-container {
    position: relative;
    display: inline-block;
    z-index: 9999999;  /* Z-index alto para el contenedor */
}

.dropdown-toggle {
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
}

.dropdown-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.nav-dropdown-container .dropdown-menu {
    display: none;
    position: fixed;
    top: 55px;
    background: #1e3a8a;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999999 !important;  /* Z-index extremadamente alto */
    min-width: 200px;
    list-style: none;
    padding: 0.5rem 0;
    margin: 0;
}

.nav-dropdown-container:hover .dropdown-menu,
.nav-dropdown-container .dropdown-menu.show {
    display: block !important;
    visibility: visible !important;
}

/* Mejorar el comportamiento del dropdown para evitar que se cierre */
.nav-dropdown-container .dropdown-menu {
    margin-top: 2px; /* Pequeño gap invisible */
}

/* Mantener el dropdown abierto cuando el mouse está sobre él */
.nav-dropdown-container .dropdown-menu:hover {
    display: block !important;
    visibility: visible !important;
}

/* Crear un área de captura invisible para evitar que se cierre */
.nav-dropdown-container .dropdown-menu::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 0;
    right: 0;
    height: 5px;
    background: transparent;
    z-index: 1;
}

.nav-dropdown-container .dropdown-menu li {
    margin: 0;
}

.nav-dropdown-container .dropdown-menu a {
    display: block !important;
    padding: 0.75rem 1.5rem;
    color: white !important;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background-color 0.2s;
    white-space: nowrap;
}

.nav-dropdown-container .dropdown-menu a:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: white !important;
}

.nav-dropdown-container .dropdown-menu li:last-child a {
    border-bottom: none;
}

/* ===========================
   MEDIA QUERIES DE PRIORIDADES
   =========================== */
@media (max-width: 1743px) {
    .nav-item.priority-5 {
        display: none;
    }
}

@media (max-width: 1599px) {
    .nav-item.priority-4 {
        display: none;
    }
}

@media (max-width: 1449px) {
    .nav-item.priority-3 {
        display: none;
    }
}

@media (max-width: 1299px) {
    .nav-item.priority-2 {
        display: none;
    }
}



/* ===========================
   ANÁLISIS DE SALUD FINANCIERA
   =========================== */
.financial-rule-selector {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    max-width: 500px;
}

.financial-rule-selector label {
    display: block;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.financial-rule-selector select {
    width: 100%;
    margin-bottom: 0.75rem;
}

.rule-description {
    background-color: #e0f2fe;
    border: 1px solid #0ea5e9;
    border-radius: 8px;
    padding: 0.75rem;
    color: #0c4a6e;
    font-size: 0.9rem;
}

.financial-health-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.health-card {
    background-color: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.health-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.health-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.health-header h4 {
    margin: 0;
    color: var(--text-color);
    font-size: 1.1rem;
    font-weight: 600;
}

.health-percentage {
    background-color: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.health-bar {
    width: 100%;
    height: 12px;
    background-color: #f1f5f9;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.health-progress {
    height: 100%;
    background-color: #10b981;
    border-radius: 6px;
    transition: width 0.5s ease, background-color 0.3s ease;
    width: 0%;
}

.health-status {
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
}

.financial-recommendations {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.financial-recommendations h4 {
    color: var(--text-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.financial-recommendations .alert {
    margin-bottom: 1rem;
    border-radius: 8px;
    border-left: 4px solid;
}

.financial-recommendations .alert:last-child {
    margin-bottom: 0;
}

/* Responsive para salud financiera */
@media (max-width: 768px) {
    .financial-health-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .health-card {
        padding: 1rem;
    }
    
    .health-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .financial-rule-selector {
        padding: 1rem;
        margin-top: 1rem;
    }
    
    .financial-recommendations {
        padding: 1rem;
        margin-top: 1rem;
    }
}

/* ===========================
   ASESOR AI ESTILOS
   =========================== */
.ai-advisor-section {
    background-color: #f0f9ff;
    border: 1px solid #0ea5e9;
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.ai-advisor-section h4 {
    color: var(--text-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ai-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.ai-loading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #0ea5e9;
    font-weight: 500;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e0f2fe;
    border-top: 2px solid #0ea5e9;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.ai-response {
    background-color: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 1rem;
    box-shadow: var(--shadow);
}

.ai-response-formatted {
    line-height: 1.6;
    color: var(--text-color);
}

.ai-response-formatted h1,
.ai-response-formatted h2,
.ai-response-formatted h3,
.ai-response-formatted h4,
.ai-response-formatted h5,
.ai-response-formatted h6 {
    color: var(--primary-color);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.ai-response-formatted h1:first-child,
.ai-response-formatted h2:first-child,
.ai-response-formatted h3:first-child,
.ai-response-formatted h4:first-child,
.ai-response-formatted h5:first-child,
.ai-response-formatted h6:first-child {
    margin-top: 0;
}

.ai-response-formatted ul,
.ai-response-formatted ol {
    margin: 0.75rem 0;
    padding-left: 1.5rem;
}

.ai-response-formatted li {
    margin: 0.25rem 0;
}

.ai-response-formatted strong {
    color: var(--primary-color);
    font-weight: 600;
}

.ai-response-formatted em {
    color: #64748b;
    font-style: italic;
}

.ai-disclaimer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.ai-disclaimer small {
    font-size: 0.8rem;
    line-height: 1.4;
}

/* ===========================
   CHAT CON AI ESTILOS
   =========================== */
.ai-chat-section {
    background-color: #f0f9ff;
    border: 1px solid #0ea5e9;
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.ai-chat-loading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #0ea5e9;
    font-weight: 500;
    margin-top: 1rem;
}

.ai-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.ai-chat-container {
    background-color: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    max-height: 500px;
    overflow-y: auto;
}

.ai-chat-messages {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ai-message {
    display: flex;
    gap: 0.75rem;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-message-avatar {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.2rem;
}

.ai-message-usuario .ai-message-avatar {
    background-color: #e0f2fe;
}

.ai-message-ai .ai-message-avatar {
    background-color: #f0f9ff;
}

.ai-message-system .ai-message-avatar {
    background-color: #f3f4f6;
}

.ai-message-content {
    flex: 1;
    background-color: #f8fafc;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    line-height: 1.6;
}

.ai-message-usuario .ai-message-content {
    background-color: #0ea5e9;
    color: white;
}

.ai-message-ai .ai-message-content {
    background-color: #f0f9ff;
    border: 1px solid #e0f2fe;
}

.ai-message-system .ai-message-content {
    background-color: #f3f4f6;
    border: 1px solid #e5e7eb;
    font-size: 0.9rem;
}

.ai-message-content h2,
.ai-message-content h3,
.ai-message-content h4 {
    margin-top: 0.75rem;
    margin-bottom: 0.5rem;
    color: #0ea5e9;
}

.ai-message-content h2:first-child,
.ai-message-content h3:first-child,
.ai-message-content h4:first-child {
    margin-top: 0;
}

.ai-message-content ul,
.ai-message-content ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.ai-message-content li {
    margin: 0.25rem 0;
}

.ai-message-content strong {
    font-weight: 600;
    color: #0369a1;
}

.ai-message-usuario .ai-message-content strong {
    color: white;
}

.ai-chat-input-container {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
}

.ai-chat-input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    min-height: 60px;
    transition: border-color 0.3s;
}

.ai-chat-input:focus {
    outline: none;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.ai-chat-input-container .btn {
    white-space: nowrap;
}

/* Responsive para chat AI */
@media (max-width: 768px) {
    .ai-advisor-section {
        padding: 1rem;
        margin-top: 1rem;
    }
    
    .ai-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .ai-chat-container {
        max-height: 400px;
    }
    
    .ai-chat-input-container {
        flex-direction: column;
    }
    
    .ai-chat-input-container .btn {
        width: 100%;
    }
    
    .ai-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .ai-response {
        padding: 1rem;
        margin-top: 0.75rem;
    }
    
    .ai-loading {
        justify-content: center;
        text-align: center;
    }
}

/* ===========================
   PRÉSTAMOS - BADGES Y ALERTAS
   =========================== */

/* Agregar clases específicas para préstamos sin afectar las categorías existentes */
.badge-prestamo-warning {
    background-color: #f39c12;
    color: #fff;
    display: inline-block;
    padding: 0.25em 0.6em;
    font-size: 0.8em;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
}

.badge-prestamo-info {
    background-color: #3498db;
    color: #fff;
    display: inline-block;
    padding: 0.25em 0.6em;
    font-size: 0.8em;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
}

.badge-prestamo-success {
    background-color: #27ae60;
    color: #fff;
    display: inline-block;
    padding: 0.25em 0.6em;
    font-size: 0.8em;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
}

.badge-prestamo-danger {
    background-color: #e74c3c;
    color: #fff;
    display: inline-block;
    padding: 0.25em 0.6em;
    font-size: 0.8em;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
}

/* Alertas preventivas */
.alert-warning {
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    padding: 1rem;
    color: #856404;
}

/* Indicador de divisa en tarjetas de presupuestos */
.divisa-badge {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
    letter-spacing: 0.5px;
}

.nombre-presupuesto {
    color: #6c757d;
    font-size: 0.9rem;
    font-weight: 500;
    font-style: italic;
    margin-left: 0.5rem;
}

/* Toggle Switch Personalizado */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
    pointer-events: none;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: all .3s ease;
    border-radius: 34px;
    border: 2px solid transparent;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: all .3s ease;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.toggle-switch:hover .toggle-slider {
    box-shadow: 0 0 8px rgba(0,123,255,0.3);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #007bff;
    border-color: #0056b3;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(26px);
    background-color: #ffffff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.toggle-switch input:focus + .toggle-slider {
    box-shadow: 0 0 0 3px rgba(0,123,255,0.2);
}

.toggle-switch:hover input:checked + .toggle-slider {
    background-color: #0056b3;
    box-shadow: 0 0 12px rgba(0,123,255,0.5);
}

/* Estilos para el contenedor del toggle */
.toggle-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.toggle-container label {
    margin: 0;
    cursor: pointer;
    font-weight: 500;
}

.toggle-container .form-help {
    margin-left: 0;
    margin-top: 4px;
}

/* ===========================
   PASSKEYS - ESTILOS
   =========================== */

/* Separador de autenticación */
.auth-separator {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    text-align: center;
}

.auth-separator::before,
.auth-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #ddd;
}

.auth-separator span {
    padding: 0 1rem;
    color: #6c757d;
    font-size: 0.9rem;
    background: white;
}

/* Botón de passkey */
.btn-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
    border-color: #545b62;
    color: white;
}

/* Información de passkey */
.passkey-info {
    border-left: 4px solid #007bff !important;
}

/* Items de passkey */
.passkey-item {
    transition: all 0.2s ease;
}

.passkey-item:hover {
    background-color: #f8f9fa;
    border-color: #007bff;
}

.alert-danger {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    padding: 1rem;
    color: #721c24;
}

.alert-info {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    border-radius: 6px;
    padding: 1rem;
    color: #0c5460;
}

/* ===========================
   MODO DEMO - ESTILOS
   =========================== */

/* Botón Demo en login */
.btn-demo {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(102, 126, 234, 0.3);
}

.btn-demo:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b42a0 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.4);
    color: white;
}

.btn-demo:active {
    transform: translateY(0);
}

/* Banner Demo - Superior */
.demo-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.75rem 0;
    text-align: center;
    font-size: 0.95rem;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    position: relative;
    z-index: 10;  /* Muy bajo para no interferir con menús */
}

/* Requisitos de Contraseña */
.password-requirements {
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #dee2e6;
}

.password-requirements .requirement {
    display: flex;
    align-items: center;
    margin: 0.4rem 0;
    color: #6c757d;
    transition: all 0.2s ease;
}

.password-requirements .requirement .icon {
    margin-right: 0.5rem;
    font-size: 1rem;
}

.password-requirements .requirement.valid {
    color: #28a745;
}

.password-requirements .requirement.valid .icon::before {
    content: '✅';
}

.password-requirements .requirement.invalid {
    color: #dc3545;
}

.password-requirements .requirement.invalid .icon::before {
    content: '❌';
}

.demo-banner .container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.demo-banner .demo-icon {
    font-size: 1.2rem;
}

.demo-banner .demo-text {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.demo-banner strong {
    font-weight: 700;
}

.demo-banner a {
    color: white;
    text-decoration: underline;
    transition: opacity 0.2s;
}

.demo-banner a:hover {
    opacity: 0.8;
}

/* Demo info box en login */
.demo-info {
    animation: fadeIn 0.5s ease-in;
}

/* Responsive para banner demo */
@media (max-width: 768px) {
    .demo-banner {
        font-size: 0.85rem;
        padding: 0.6rem 0;
    }
    
    .demo-banner .demo-text {
        flex-direction: column;
        text-align: center;
        gap: 0.25rem;
    }
    
    .demo-banner a {
        margin-left: 0 !important;
    }
}

