/* Sistema MAM/PAMM - Estilos Modernos */

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #3b82f6;
    --dark-color: #1e293b;
    --light-color: #f8fafc;
    --border-color: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --shadow-sm: 0 1px 2px 0 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);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Login Page - Modernizado */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 450px;
}

.login-box {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 10px;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 15px;
}

/* Wrapper Layout - Modernizado */
.wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.sidebar-header {
    padding: 30px 20px;
    background: rgba(99, 102, 241, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h3 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-header p {
    font-size: 15px;
    opacity: 0.9;
    margin-bottom: 4px;
}

.sidebar-header small {
    font-size: 12px;
    opacity: 0.7;
    background: rgba(99, 102, 241, 0.2);
    padding: 4px 12px;
    border-radius: 12px;
    display: inline-block;
}

.sidebar-menu {
    list-style: none;
    padding: 20px 0;
}

.sidebar-menu li {
    margin: 4px 12px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.sidebar-menu a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: var(--primary-color);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.sidebar-menu a:hover {
    background: rgba(99, 102, 241, 0.15);
    color: white;
    transform: translateX(5px);
}

.sidebar-menu a:hover::before {
    transform: scaleY(1);
}

.main-content {
    flex: 1;
    margin-left: 280px;
    background: var(--light-color);
    min-height: 100vh;
}

.top-header {
    background: white;
    padding: 24px 32px;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
}

.top-header h2 {
    color: var(--text-primary);
    font-size: 28px;
    font-weight: 700;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

.content-area {
    padding: 32px;
}

/* Cards Modernos */
.card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border-color);
}

.card-header h3 {
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 700;
}

.card-body {
    color: var(--text-secondary);
}

/* Dashboard Stats - Modernizado */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    padding: 28px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary-color), var(--secondary-color));
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.stat-card:hover::before {
    transform: scaleY(1);
}

.stat-icon {
    font-size: 48px;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    border-radius: var(--radius-lg);
}

.stat-info h3 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.stat-info p {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.stat-card.positive {
    border-left: 4px solid var(--success-color);
}

.stat-card.negative {
    border-left: 4px solid var(--danger-color);
}

.stat-card.alert {
    border-left: 4px solid var(--warning-color);
}

/* Forms Modernos */
.form-horizontal {
    background: white;
    padding: 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.form-row {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
}

.form-group {
    flex: 1;
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 15px;
    transition: all 0.3s ease;
    background: white;
    color: var(--text-primary);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-control:disabled {
    background: var(--light-color);
    cursor: not-allowed;
}

.form-group small {
    display: block;
    margin-top: 6px;
    color: var(--text-secondary);
    font-size: 13px;
}

.form-actions {
    margin-top: 32px;
    display: flex;
    gap: 12px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

/* Buttons Modernos */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: var(--text-secondary);
    color: white;
}

.btn-secondary:hover {
    background: var(--text-primary);
}

.btn-success {
    background: var(--success-color);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-warning {
    background: var(--warning-color);
    color: white;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-info {
    background: var(--info-color);
    color: white;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-block {
    width: 100%;
    display: flex;
}

/* Alerts Modernos */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    border-left: 4px solid;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert::before {
    font-size: 24px;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #065f46;
    border-color: var(--success-color);
}

.alert-success::before {
    content: '✓';
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: #991b1b;
    border-color: var(--danger-color);
}

.alert-error::before {
    content: '✕';
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #92400e;
    border-color: var(--warning-color);
}

.alert-warning::before {
    content: '⚠';
}

/* Tables Modernos */
.data-table {
    width: 100%;
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.data-table thead {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.data-table th {
    padding: 16px 20px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table tbody tr {
    transition: all 0.2s ease;
}

.data-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.05);
    transform: scale(1.01);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table td.positive {
    color: var(--success-color);
    font-weight: 600;
}

.data-table td.negative {
    color: var(--danger-color);
    font-weight: 600;
}

/* Badges Modernos */
.badge {
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.badge-admin {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.badge-manager {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

.badge-investor {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.badge-mam {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.badge-pamm {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    color: white;
}

.status-badge {
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.status-pending, .status-incomplete, .status-not_started {
    background: rgba(245, 158, 11, 0.1);
    color: #92400e;
}

.status-pending::before, .status-incomplete::before, .status-not_started::before {
    background: var(--warning-color);
}

.status-approved, .status-active {
    background: rgba(16, 185, 129, 0.1);
    color: #065f46;
}

.status-approved::before, .status-active::before {
    background: var(--success-color);
}

.status-rejected, .status-suspended {
    background: rgba(239, 68, 68, 0.1);
    color: #991b1b;
}

.status-rejected::before, .status-suspended::before {
    background: var(--danger-color);
}

.status-completed {
    background: rgba(59, 130, 246, 0.1);
    color: #1e40af;
}

.status-completed::before {
    background: var(--info-color);
}

/* Modal Moderno */
.modal {
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background: white;
    border-radius: var(--radius-xl);
    padding: 32px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s ease-out;
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border-color);
}

.modal-header h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.close {
    color: var(--text-secondary);
    font-size: 32px;
    font-weight: 300;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close:hover {
    background: var(--light-color);
    color: var(--danger-color);
    transform: rotate(90deg);
}

/* Tabs Modernos */
.tabs-container {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    padding: 24px;
}

.tab-buttons {
    display: flex;
    gap: 8px;
    background: var(--light-color);
    padding: 8px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
}

.tab-btn {
    flex: 1;
    padding: 14px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    position: relative;
    font-size: 15px;
}

.tab-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
}

.tab-btn.active {
    background: white;
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.tab-content.active {
    display: block;
}

/* Info Box Moderno */
.info-box {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    border-left: 4px solid var(--primary-color);
    padding: 20px 24px;
    border-radius: var(--radius-md);
    margin: 24px 0;
}

.info-box h4 {
    color: var(--primary-color);
    margin-bottom: 12px;
    font-size: 18px;
}

.info-box ul {
    margin-left: 20px;
    color: var(--text-secondary);
}

.info-box li {
    margin: 8px 0;
}

/* Investment Cards */
.investments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 24px;
}

.investment-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary-color);
    transition: all 0.3s ease;
}

.investment-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.investment-card.inactive {
    opacity: 0.6;
    border-left-color: var(--text-secondary);
}

.investment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border-color);
}

.investment-header h4 {
    margin: 0;
    color: var(--text-primary);
    font-size: 20px;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .dashboard-stats {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .tab-buttons {
        flex-wrap: wrap;
    }
    
    .tab-btn {
        flex: 1 1 45%;
    }
}

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
    }
    
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
    
    .investments-grid {
        grid-template-columns: 1fr;
    }
    
    .content-area {
        padding: 16px;
    }
    
    .top-header {
        padding: 16px;
    }
    
    .tab-btn {
        flex: 1 1 100%;
        font-size: 14px;
        padding: 12px 16px;
    }
}

/* Scrollbar Personalizado */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--light-color);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary-color), var(--secondary-color));
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }