/* ========================================
   APPFINANCE - MEJORAR CONSULTING
   Design CEO Dashboard - Version complète
======================================== */

/* === RESET & BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Figtree', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: #f9fafb;
    color: #1f2937;
    line-height: 1.6;
}

/* === LAYOUT === */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* === SIDEBAR === */
.sidebar {
    width: 260px;
    background: white;
    border-right: 2px solid #e5e7eb;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 3px solid #10b981;
    background: white;
}

.sidebar-logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: #10b981;
    text-decoration: none;
    display: block;
}

.sidebar-subtitle {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

/* === NAVIGATION === */
.nav-menu {
    padding: 1rem 0;
}

.nav-section {
    margin-bottom: 1rem;
}

.nav-section-title {
    padding: 0.5rem 1.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #9ca3af;
    letter-spacing: 0.05em;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: #4b5563;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background-color: #f0fdf4;
    color: #10b981;
    border-left-color: #10b981;
}

.nav-item.active {
    background-color: #d1fae5;
    color: #059669;
    border-left-color: #059669;
    font-weight: 600;
}

.nav-icon {
    font-size: 1.25rem;
    margin-right: 0.75rem;
    min-width: 24px;
}

.nav-badge {
    margin-left: auto;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    background-color: #10b981;
    color: white;
}

/* === MAIN CONTENT === */
.main-content {
    margin-left: 260px;
    flex: 1;
    min-height: 100vh;
    background-color: #f9fafb;
}

/* === TOP BAR === */
.top-bar {
    background: white;
    border-bottom: 2px solid #e5e7eb;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-bar-left h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1f2937;
}

.breadcrumb {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    background-color: #f9fafb;
}

.user-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.125rem;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1f2937;
}

.user-role {
    font-size: 0.75rem;
    color: #10b981;
    font-weight: 600;
}

/* === CONTENT === */
.content-wrapper {
    padding: 2rem;
    max-width: 1400px;
}

/* === STATS GRID === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.75rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    border-left: 5px solid #10b981;
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.12);
}

.stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.stat-icon {
    font-size: 2.5rem;
    opacity: 0.7;
}

.stat-label {
    font-size: 0.8125rem;
    color: #6b7280;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0.5rem 0;
    line-height: 1;
}

.stat-trend {
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

.trend-up { color: #10b981; font-weight: 600; }
.trend-down { color: #ef4444; font-weight: 600; }

/* COLOR VARIANTS */
.stat-card.green { border-left-color: #10b981; }
.stat-card.blue { border-left-color: #3b82f6; }
.stat-card.orange { border-left-color: #f59e0b; }
.stat-card.red { border-left-color: #ef4444; }
.stat-card.purple { border-left-color: #8b5cf6; }

/* === TABLES === */
.table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    overflow: hidden;
    margin-bottom: 2rem;
}

.table-header {
    padding: 1.5rem;
    border-bottom: 2px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1f2937;
}

.table-actions {
    display: flex;
    gap: 0.75rem;
}

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

thead {
    background-color: #f9fafb;
}

th {
    padding: 1rem 1.5rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td {
    padding: 1rem 1.5rem;
    border-top: 1px solid #f3f4f6;
    font-size: 0.875rem;
    color: #4b5563;
}

tbody tr:hover {
    background-color: #f9fafb;
}

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

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

.btn-primary:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(16, 185, 129, 0.3);
}

.btn-secondary {
    background-color: #f3f4f6;
    color: #4b5563;
}

.btn-secondary:hover {
    background-color: #e5e7eb;
}

.btn-danger {
    background-color: #ef4444;
    color: white;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

/* === BADGES === */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.badge-success { background-color: #d1fae5; color: #065f46; }
.badge-warning { background-color: #fef3c7; color: #92400e; }
.badge-danger { background-color: #fee2e2; color: #991b1b; }
.badge-info { background-color: #dbeafe; color: #1e40af; }
.badge-gray { background-color: #f3f4f6; color: #4b5563; }

/* === ALERTS === */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid;
}

.alert-danger {
    background-color: #fef2f2;
    border-color: #ef4444;
    color: #991b1b;
}

.alert-warning {
    background-color: #fffbeb;
    border-color: #f59e0b;
    color: #92400e;
}

.alert-success {
    background-color: #f0fdf4;
    border-color: #10b981;
    color: #065f46;
}

/* === MOBILE === */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #4b5563;
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .content-wrapper {
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .top-bar {
        padding: 1rem;
    }
    
    .user-details {
        display: none;
    }
    
    table {
        font-size: 0.75rem;
    }
    
    th, td {
        padding: 0.5rem;
    }
}

/* === UTILITIES === */
.text-green { color: #10b981; }
.text-blue { color: #3b82f6; }
.text-orange { color: #f59e0b; }
.text-red { color: #ef4444; }
.text-gray { color: #6b7280; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }
.mr-2 { margin-right: 0.5rem; }
