/* =====================================================
   PORTAFOLIO FINANCIERO - Estilos
   ===================================================== */

:root {
    --primary-400: #4DD0E1;
    --primary-500: #26C6DA;
    --primary-600: #00BCD4;
    --primary-700: #00ACC1;
    --primary-800: #0097A7;
    --primary-900: #00838F;
    
    --gradient-primary: linear-gradient(135deg, #00BCD4 0%, #0097A7 50%, #00838F 100%);
    --gradient-light: linear-gradient(135deg, #E0F7FA 0%, #B2EBF2 50%, #80DEEA 100%);
    
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    
    --white: #FFFFFF;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-colored: 0 10px 40px -10px rgba(0, 188, 212, 0.4);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    --font-primary: 'Plus Jakarta Sans', sans-serif;
    --font-display: 'Outfit', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

/* Controlar SVGs por defecto */
svg {
    width: 1em;
    height: 1em;
    flex-shrink: 0;
}

body {
    font-family: var(--font-primary);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--gray-800);
    background-color: var(--gray-50);
    min-height: 100vh;
}

/* =====================================================
   AUTENTICACIÓN
   ===================================================== */

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--gradient-light);
    position: relative;
    overflow: hidden;
}

.auth-wrapper::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 80%;
    height: 150%;
    background: radial-gradient(ellipse at center, rgba(0, 188, 212, 0.15) 0%, transparent 70%);
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

.auth-container {
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 10;
}

.auth-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl), var(--shadow-colored);
    padding: 3rem;
    position: relative;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-icon {
    width: 64px;
    height: 64px;
    background: var(--gradient-primary);
    border-radius: var(--radius-lg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-colored);
}

.logo-icon svg {
    width: 36px;
    height: 36px;
    stroke: var(--white);
}

.logo-icon.small {
    width: 40px;
    height: 40px;
}

.logo-icon.small svg {
    width: 24px;
    height: 24px;
}

.logo-text {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--gray-800);
}

.auth-header p {
    color: var(--gray-500);
    margin: 0;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
}

.form-label .required {
    color: var(--danger);
}

.form-input-wrapper {
    position: relative;
}

.form-input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 3rem;
    font-size: 1rem;
    font-family: var(--font-primary);
    color: var(--gray-800);
    background: var(--gray-50);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    outline: none;
    transition: all 0.25s ease;
}

.form-input::placeholder {
    color: var(--gray-400);
}

.form-input:hover {
    background: var(--white);
    border-color: var(--gray-200);
}

.form-input:focus {
    background: var(--white);
    border-color: var(--primary-500);
    box-shadow: 0 0 0 4px rgba(0, 188, 212, 0.15);
}

.form-input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    pointer-events: none;
}

.form-input:focus ~ .form-input-icon {
    color: var(--primary-600);
}

/* Botones */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-primary);
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--white);
    box-shadow: var(--shadow-md), 0 4px 14px -4px rgba(0, 188, 212, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), 0 8px 20px -4px rgba(0, 188, 212, 0.5);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-200);
}

.btn-block { width: 100%; }
.btn-lg { padding: 1rem 2rem; font-size: 1.125rem; }

/* Alertas */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    font-size: 0.9375rem;
}

.alert-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.alert-error {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-success {
    background: #D1FAE5;
    color: #065F46;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Footer auth */
.auth-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-100);
}

.auth-footer p {
    margin: 0;
    color: var(--gray-500);
}

.auth-footer a {
    color: var(--primary-600);
    font-weight: 600;
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Upload foto */
.photo-upload {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.photo-preview {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 3px solid var(--white);
    box-shadow: var(--shadow-md);
}

.photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-preview svg {
    width: 40px;
    height: 40px;
    color: var(--gray-400);
}

.photo-upload-btn {
    font-size: 0.875rem;
    color: var(--primary-600);
    font-weight: 500;
    cursor: pointer;
}

.photo-upload-btn:hover {
    text-decoration: underline;
}

.photo-upload input[type="file"] {
    display: none;
}

/* =====================================================
   DASHBOARD
   ===================================================== */

.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--gray-100);
}

.sidebar-header .logo-text {
    font-size: 1.25rem;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--gray-600);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    font-weight: 500;
}

.nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-item:hover {
    background: var(--gray-50);
    color: var(--gray-800);
}

.nav-item.active {
    background: var(--gradient-light);
    color: var(--primary-700);
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--gray-100);
}

.nav-item.logout {
    color: var(--danger);
}

.nav-item.logout:hover {
    background: #FEE2E2;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    background: var(--gray-50);
}

.main-header {
    background: var(--white);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left h1 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-800);
}

.header-left p {
    color: var(--gray-500);
    margin: 0;
    font-size: 0.875rem;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 600;
    overflow: hidden;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-name {
    font-weight: 500;
    color: var(--gray-700);
}

/* Dashboard Content */
.dashboard-content {
    padding: 2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.stat-icon.blue {
    background: #E0F7FA;
    color: var(--primary-600);
}

.stat-icon.green {
    background: #D1FAE5;
    color: var(--success);
}

.stat-icon.purple {
    background: #EDE9FE;
    color: #7C3AED;
}

.stat-icon.orange {
    background: #FEF3C7;
    color: var(--warning);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--gray-500);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-800);
}

.stat-value.positive {
    color: var(--success);
}

/* Welcome Card */
.welcome-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.welcome-content h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--gray-800);
}

.welcome-content p {
    color: var(--gray-500);
    margin-bottom: 1.5rem;
}

.welcome-actions {
    display: flex;
    gap: 1rem;
}

.welcome-illustration svg {
    width: 150px;
    height: 150px;
    max-width: 150px;
    max-height: 150px;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .auth-card {
        padding: 2rem 1.5rem;
    }
    
    .welcome-card {
        flex-direction: column;
        text-align: center;
    }
    
    .welcome-actions {
        flex-direction: column;
    }
    
    .welcome-illustration {
        margin-top: 1.5rem;
    }
}