/**
 * Estilos del Dashboard - PLASTIMIQ
 */

/* Variables - Colores corporativos Inversiones Angel Jacky */
:root {
    --primary: #1f3c88;
    /* Azul corporativo */
    --primary-dark: #162b65;
    --primary-light: #2d54b3;
    --secondary: #d62828;
    /* Rojo intenso */
    --secondary-dark: #b02121;
    --danger: #d62828;
    --warning: #f39c12;
    --info: #3498db;
    --dark: #444444;
    --light: #f5f5f5;
    --white: #ffffff;
    --gray: #999999;
    --gray-dark: #666666;
    --gray-lighter: #e0e0e0;
    --sidebar-width: 260px;
    --topbar-height: 60px;
}

/* Reset y Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', 'Montserrat', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--light);
    color: var(--dark);
    line-height: 1.6;
}

/* ========================================
   PÁGINA DE LOGIN
   ======================================== */
.login-page {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

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

.login-box {
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 3rem;
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-icon {
    margin-bottom: 1.5rem;
}

.login-icon i {
    font-size: 3.5rem;
    color: var(--primary);
    display: block;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

.login-header h1 {
    color: var(--primary);
    font-size: 2rem;
    margin-bottom: 0.5rem;
    font-family: 'Poppins', 'Montserrat', sans-serif;
    font-weight: 700;
}

.login-header p {
    color: var(--gray);
    font-size: 0.95rem;
    margin-top: 0.5rem;
}

.login-form .form-group {
    margin-bottom: 1.75rem;
}

.login-form label {
    display: block;
    margin-bottom: 0.75rem;
    color: var(--dark);
    font-weight: 600;
    font-size: 0.95rem;
}

.login-form label i {
    margin-right: 0.5rem;
    color: var(--primary);
    font-size: 0.9rem;
}

.login-form input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--light);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.login-form input:hover {
    border-color: var(--primary-light);
}

.login-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(31, 60, 136, 0.1);
    transform: translateY(-1px);
}

.login-footer {
    margin-top: 2rem;
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--light);
}

.login-footer a {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    font-weight: 500;
}

.login-footer a:hover {
    color: var(--primary-dark);
    transform: translateX(-3px);
}

.login-footer a i {
    transition: transform 0.3s ease;
}

.login-footer a:hover i {
    transform: translateX(-3px);
}

/* ========================================
   SIDEBAR
   ======================================== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--primary-dark);
    color: var(--white);
    z-index: 1000;
    transition: transform 0.3s;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
    font-family: 'Poppins', 'Montserrat', sans-serif;
}

.sidebar-header p {
    font-size: 0.85rem;
    color: var(--gray);
}

.sidebar-nav {
    padding: 1rem 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s;
}

.nav-item i {
    width: 20px;
    margin-right: 0.75rem;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

.nav-item.active {
    background: var(--primary);
    color: var(--white);
    border-left: 3px solid var(--secondary);
}

.nav-item.logout {
    color: var(--secondary);
    margin-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
}

.nav-item.logout:hover {
    background: rgba(214, 40, 40, 0.15);
    color: var(--secondary);
}

/* ========================================
   MAIN CONTENT
   ======================================== */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left 0.3s;
}

.topbar {
    height: var(--topbar-height);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--white);
    cursor: pointer;
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    color: rgba(255, 255, 255, 0.8);
    transform: scale(1.1);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
}

.user-info {
    background: var(--white);
    color: var(--primary);
    padding: 0.5rem 1.25rem;
    border-radius: 25px;
    font-size: 0.95rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.user-info:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.user-info strong {
    color: var(--primary);
    font-weight: 600;
}

.user-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.user-avatar:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.page-content {
    padding: 2rem;
}

/* ========================================
   ALERTS
   ======================================== */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #fee;
    color: #c33;
    border: 1px solid #fcc;
    border-left: 4px solid #d62828;
    border-radius: 8px;
}

.alert-error i {
    margin-right: 0.5rem;
    color: #d62828;
}

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

.alert-dismissible {
    position: relative;
}

.alert-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.3s;
}

.alert-close:hover {
    opacity: 1;
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.btn i {
    margin-right: 0.5rem;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(31, 60, 136, 0.4);
}

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

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

.btn-secondary:hover {
    background: var(--secondary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(214, 40, 40, 0.3);
}

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

.btn-danger:hover {
    background: #c0392b;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

.btn-block {
    display: block;
    width: 100%;
}

/* ========================================
   CARDS
   ======================================== */
.card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    border: 1px solid var(--gray-lighter);
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    font-size: 1.25rem;
    color: var(--dark);
}

.card-body {
    padding: 1.5rem;
}

/* ========================================
   FORMS
   ======================================== */
.form-group {
    margin-bottom: 1.5rem;
}

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

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

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: var(--gray);
    font-size: 0.85rem;
}

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

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--light);
}

/* ========================================
   TABLES
   ======================================== */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: var(--primary);
    color: var(--white);
}

.data-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--white);
    border-bottom: 2px solid var(--primary-dark);
}

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

.data-table tbody tr:hover {
    background: #f8f9fa;
}

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

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

.page-header h1 {
    font-size: 2rem;
    color: var(--dark);
    font-family: 'Poppins', 'Montserrat', sans-serif;
}

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

.stat-card {
    background: var(--white);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: transform 0.3s;
}

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

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.stat-info {
    flex: 1;
}

.stat-info h3 {
    font-size: 2rem;
    color: var(--dark);
    margin-bottom: 0.25rem;
}

.stat-info p {
    color: var(--gray);
    font-size: 0.9rem;
}

.stat-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9rem;
}

.stat-link:hover {
    text-decoration: underline;
}

/* ========================================
   DASHBOARD CONTENT
   ======================================== */
.dashboard-content {
    /* Full width layout like categories */
}

.dashboard-section h2 {
    margin-bottom: 1.5rem;
    color: var(--dark);
}

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

.action-card {
    background: var(--white);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    text-decoration: none;
    color: var(--dark);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
}

.action-card i {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
    display: block;
}

.action-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    color: var(--primary);
}

.category-stats {
    display: grid;
    gap: 1rem;
}

.category-stat-item {
    background: var(--white);
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid var(--primary);
}

.category-stat-item h4 {
    color: var(--dark);
    margin-bottom: 0.25rem;
}

.category-stat-item p {
    color: var(--gray);
    font-size: 0.9rem;
}

/* ========================================
   EMPTY STATE
   ======================================== */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--gray);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

/* ========================================
   BADGES
   ======================================== */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background-color: #d4edda;
    color: #155724;
}

.badge-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.badge-secondary {
    background-color: #e2e3e5;
    color: #383d41;
}

.badge-warning {
    background-color: #fff3cd;
    color: #856404;
}

.badge-info {
    background-color: #d1ecf1;
    color: #0c5460;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: block;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .dashboard-stats {
        grid-template-columns: 1fr;
    }

    .data-table {
        font-size: 0.9rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.5rem;
    }
}