/* Variables CSS - Paleta Corporativa */
:root {
    --primary-color: #DC3545;
    --primary-dark: #C82333;
    --primary-darker: #BD2130;
    --primary-light: #E85D75;
    --secondary-color: #ffffff;
    --success-color: #10b981;
    --danger-color: #DC3545;
    --warning-color: #f59e0b;
    --info-color: #06b6d4;
    --dark-color: #1f2937;
    --light-color: #f3f4f6;
    --sidebar-bg: #0f172a;
    --sidebar-bg-dark: #1e293b;
    --sidebar-width: 240px;
    --header-height: 70px;
}

/* Reset y estilos generales */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    min-height: 100vh;
    color: #333;
}

/* Login Page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 450px;
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    color: var(--primary-color);
    font-size: 28px;
    margin-bottom: 10px;
}

.login-header p {
    color: #666;
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(220, 53, 69, 0.4);
}

.alert {
    padding: 12px 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-danger {
    background-color: #fee2e2;
    color: #BD2130;
    border: 1px solid #fecaca;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

/* Dashboard Layout */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
    background: #f8f9fa;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: all 0.3s ease;
    z-index: 1000;
}

.sidebar-header {
    padding: 25px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-header h2 {
    font-size: 20px;
    margin-bottom: 5px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.sidebar-header p {
    font-size: 12px;
    color: #94a3b8;
    opacity: 1;
}

.sidebar-menu {
    list-style: none;
    padding: 20px 0;
}

.sidebar-menu li {
    margin-bottom: 5px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #94a3b8;
    text-decoration: none;
    transition: all 0.2s ease;
    opacity: 1;
    font-size: 14px;
    border-left: 4px solid transparent;
}

.sidebar-menu a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    padding-left: 24px;
    opacity: 1;
}

.sidebar-menu a.active {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border-left: 4px solid #ef4444;
    opacity: 1;
    font-weight: 600;
}

.sidebar-menu a.active i {
    color: #ef4444;
}

.sidebar-menu i {
    margin-right: 12px;
    font-size: 16px;
    width: 20px;
    text-align: center;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

/* Header */
.header {
    background: white;
    height: var(--header-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 999;
}

.header-left h1 {
    font-size: 24px;
    color: var(--dark-color);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-darker));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.user-details {
    text-align: right;
}

.user-name {
    font-weight: 600;
    color: var(--dark-color);
    font-size: 14px;
}

.user-role {
    font-size: 12px;
    color: #666;
}

.btn-logout {
    background: #E85D75;
    color: white;
    padding: 8px 16px;
    font-size: 14px;
}

.btn-logout:hover {
    background: #DC3545;
}

/* Content Area */
.content-area {
    padding: 30px;
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

/* Modern Card Redesign */
.modern-card {
    background: white;
    border-radius: 20px;
    padding: 40px 30px;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-top: 6px solid transparent;
    text-decoration: none;
    color: inherit;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.modern-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
}

.modern-card.red { border-top-color: var(--primary-color); }
.modern-card.blue { border-top-color: #3b82f6; }
.modern-card.purple { border-top-color: #7c3aed; }

.card-icon-wrapper {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    font-size: 36px;
    transition: transform 0.3s ease;
}

.modern-card:hover .card-icon-wrapper {
    transform: scale(1.05);
}

.modern-card.red .card-icon-wrapper { background-color: #fee2e2; color: var(--primary-color); }
.modern-card.blue .card-icon-wrapper { background-color: #dbeafe; color: #3b82f6; }
.modern-card.purple .card-icon-wrapper { background-color: #f3e8ff; color: #7c3aed; }

.modern-card h3 {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 15px;
}

.modern-card p {
    color: #64748b;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 30px;
    max-width: 280px;
}

.card-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 28px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 15px;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modern-card.red .card-btn { background-color: #fff1f2; color: var(--primary-color); }
.modern-card.blue .card-btn { background-color: #f0f9ff; color: #3b82f6; }
.modern-card.purple .card-btn { background-color: #faf5ff; color: #7c3aed; }

.modern-card:hover .card-btn {
    filter: brightness(0.97);
    padding-right: 32px;
}

.card-btn i {
    transition: transform 0.2s ease;
}

.modern-card:hover .card-btn i {
    transform: translateX(4px);
}


/* KPI Cards */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.kpi-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 15px;
}

.kpi-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
}

.kpi-icon.red { background: linear-gradient(135deg, var(--primary-color), var(--primary-darker)); }
.kpi-icon.white { background: linear-gradient(135deg, #ffffff, #f5f5f5); color: var(--primary-color); border: 2px solid var(--primary-color); }
.kpi-icon.green { background: linear-gradient(135deg, #10b981, #059669); }
.kpi-icon.orange { background: linear-gradient(135deg, #f59e0b, #d97706); }
.kpi-icon.blue { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.kpi-icon.purple { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }

.kpi-info h4 {
    font-size: 13px;
    color: #666;
    margin-bottom: 5px;
    font-weight: 500;
}

.kpi-value {
    font-size: 24px;
    font-weight: bold;
    color: var(--dark-color);
}

.kpi-change {
    font-size: 12px;
    margin-top: 5px;
}

.kpi-change.positive { color: #10b981; }
.kpi-change.negative { color: #E85D75; }

/* Chart Container */
.chart-container {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 25px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.chart-header h3 {
    font-size: 18px;
    color: var(--dark-color);
}

.chart-filters {
    display: flex;
    gap: 10px;
}

.chart-filters select {
    padding: 8px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
}

/* Table Styles */
.table-container {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table thead {
    background: #f8f9fa;
}

table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: var(--dark-color);
    border-bottom: 2px solid #e5e7eb;
}

table td {
    padding: 12px;
    border-bottom: 1px solid #f3f4f6;
}

table tbody tr:hover {
    background: #f8f9fa;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .cards-grid {
        grid-template-columns: 1fr;
    }
    
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Utilidades */
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }

.text-center { text-align: center; }
.text-right { text-align: right; }

.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-2 { gap: 20px; }
