:root {
    --primary-color: #002B5C;
    --secondary-color: #C4A747;
    --accent-color: #8B6F4C;
    --background-light: #f5f5f5;
    --text-dark: #333;
    --text-light: #fff;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-light);
}

/* Login Styles */
.login-body {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1a4b8c 100%);
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    padding: 40px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo {
    width: 120px;
    height: auto;
    margin-bottom: 20px;
}

.login-header h2 {
    color: var(--primary-color);
    font-size: 24px;
    margin-bottom: 5px;
}

.login-header p {
    color: var(--accent-color);
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-dark);
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
}

.btn-login {
    width: 100%;
    padding: 12px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-login:hover {
    background-color: var(--secondary-color);
}

/* Dashboard Styles */
.dashboard {
    display: flex;
    min-height: 100vh;
}

/* ===== SIDEBAR MEJORADO CON EFECTOS ELEGANTES ===== */
.sidebar {
    width: 250px;
    background: linear-gradient(180deg, var(--primary-color) 0%, #1a3f6e 100%);
    color: white;
    transition: all 0.3s;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

/* Header del sidebar con fondo blanco y logo grande */
.sidebar-header {
    padding: 30px 20px;
    text-align: center;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-bottom: 3px solid var(--primary-color);
    margin-bottom: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.sidebar-logo {
    width: 150px;
    height: auto;
    max-height: 120px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    filter: drop-shadow(0 4px 8px rgba(0,43,92,0.2));
    transition: all 0.3s ease;
}

/* Animación sutil para el logo */
@keyframes subtlePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.sidebar-logo {
    animation: subtlePulse 3s infinite ease-in-out;
}

.sidebar-logo:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 6px 12px rgba(196,167,71,0.3));
}

/* Menú del sidebar mejorado */
.sidebar-menu {
    list-style: none;
    padding: 10px 0;
}

.sidebar-menu li {
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

/* Efecto de brillo al hover */
.sidebar-menu li::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s ease;
}

.sidebar-menu li:hover::before {
    left: 100%;
}

.sidebar-menu li i {
    margin-right: 10px;
    width: 20px;
    color: var(--secondary-color);
    transition: transform 0.3s ease;
}

.sidebar-menu li:hover i {
    transform: translateX(5px);
}

.sidebar-menu li:hover {
    background-color: rgba(196, 167, 71, 0.15);
    padding-left: 25px;
}

.sidebar-menu li.active {
    background: linear-gradient(90deg, rgba(196,167,71,0.2) 0%, rgba(196,167,71,0.1) 100%);
    border-left: 4px solid var(--secondary-color);
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.1);
}

.sidebar-menu li.active i {
    color: var(--secondary-color);
    transform: scale(1.1);
}

/* Efecto de separador entre items del menú */
.sidebar-menu li:not(:last-child) {
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 20px;
    background-color: var(--background-light);
}

/* Top bar mejorado */
.top-bar {
    background: white;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0,43,92,0.08);
    border: 1px solid rgba(196,167,71,0.1);
}

.menu-toggle {
    display: none; /* Oculto por defecto en desktop */
    font-size: 24px;
    cursor: pointer;
    margin-right: 15px;
    color: var(--primary-color);
    transition: transform 0.3s;
}

.menu-toggle:hover {
    transform: scale(1.1);
    color: var(--secondary-color);
}

.page-title {
    color: var(--primary-color);
    font-size: 20px;
    font-weight: 600;
    position: relative;
    padding-left: 15px;
}

.page-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    background: var(--secondary-color);
    border-radius: 2px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info span {
    color: var(--text-dark);
    font-weight: 500;
    padding: 5px 10px;
    background: rgba(196,167,71,0.1);
    border-radius: 20px;
}

.user-info span i {
    color: var(--secondary-color);
    margin-right: 5px;
}

.btn-logout {
    background: linear-gradient(135deg, var(--danger) 0%, #c82333 100%);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(220,53,69,0.3);
}

.btn-logout:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(220,53,69,0.4);
}

/* Cards con efecto hover */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,43,92,0.15);
    border-color: var(--secondary-color);
}

.stat-card h3 {
    color: var(--accent-color);
    font-size: 14px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .number {
    color: var(--primary-color);
    font-size: 32px;
    font-weight: 600;
    transition: color 0.3s;
}

.stat-card:hover .number {
    color: var(--secondary-color);
}

/* Tables mejoradas */
.table-container {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    overflow-x: auto;
    transition: box-shadow 0.3s;
}

.table-container:hover {
    box-shadow: 0 6px 20px rgba(0,43,92,0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 15px 12px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #1a3f6e 100%);
    color: white;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.5px;
}

th:first-child {
    border-radius: 8px 0 0 8px;
}

th:last-child {
    border-radius: 0 8px 8px 0;
}

td {
    padding: 12px;
    border-bottom: 1px solid #eee;
    transition: background-color 0.3s;
}

tr:hover td {
    background-color: rgba(196,167,71,0.05);
}

/* Buttons mejorados */
.btn {
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.btn::after {
    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.3s, height 0.3s;
}

.btn:active::after {
    width: 100px;
    height: 100px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1a3f6e 100%);
    color: white;
    box-shadow: 0 2px 5px rgba(0,43,92,0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1a3f6e 0%, var(--primary-color) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,43,92,0.4);
}

.btn-edit {
    background: linear-gradient(135deg, var(--warning) 0%, #e0a800 100%);
    color: var(--text-dark);
    margin-right: 5px;
    box-shadow: 0 2px 5px rgba(255,193,7,0.3);
}

.btn-edit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(255,193,7,0.4);
}

.btn-delete {
    background: linear-gradient(135deg, var(--danger) 0%, #c82333 100%);
    color: white;
    box-shadow: 0 2px 5px rgba(220,53,69,0.3);
}

.btn-delete:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(220,53,69,0.4);
}

.btn-view {
    background: linear-gradient(135deg, var(--accent-color) 0%, #9f835c 100%);
    color: white;
    box-shadow: 0 2px 5px rgba(139,111,76,0.3);
}

.btn-view:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(139,111,76,0.4);
}

/* Modals mejorados */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,43,92,0.5);
    backdrop-filter: blur(3px);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    position: relative;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    margin: 50px auto;
    padding: 25px;
    border-radius: 15px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 15px 40px rgba(0,43,92,0.2);
    transform: translateY(0);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(196,167,71,0.2);
}

.modal-header h2 {
    color: var(--primary-color);
    font-size: 22px;
    position: relative;
    padding-left: 15px;
}

.modal-header h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    background: var(--secondary-color);
    border-radius: 2px;
}

.close-modal {
    font-size: 28px;
    cursor: pointer;
    color: #999;
    transition: all 0.3s;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-modal:hover {
    color: var(--danger);
    background: rgba(220,53,69,0.1);
    transform: rotate(90deg);
}

/* Status Badges mejorados */
.status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.status-inicio {
    background: linear-gradient(135deg, #ffc107 0%, #ffdb6d 100%);
    color: #000;
}

.status-proceso {
    background: linear-gradient(135deg, #17a2b8 0%, #54c8e0 100%);
    color: #fff;
}

.status-finalizado {
    background: linear-gradient(135deg, #28a745 0%, #5dd879 100%);
    color: #fff;
}

/* Upload Area mejorado */
.upload-area {
    border: 2px dashed var(--secondary-color);
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: rgba(196,167,71,0.02);
}

.upload-area:hover {
    border-color: var(--primary-color);
    background-color: rgba(196,167,71,0.05);
    transform: scale(1.02);
}

.upload-area i {
    font-size: 48px;
    color: var(--secondary-color);
    margin-bottom: 10px;
    transition: transform 0.3s;
}

.upload-area:hover i {
    transform: translateY(-5px);
}

/* Tabs mejorados */
.tabs {
    display: flex;
    border-bottom: 2px solid rgba(196,167,71,0.2);
    margin-bottom: 20px;
    gap: 5px;
    flex-wrap: wrap;
}

.tab {
    padding: 10px 20px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    font-weight: 500;
    color: var(--text-dark);
    position: relative;
    overflow: hidden;
}

.tab::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: var(--secondary-color);
    transition: width 0.3s;
}

.tab:hover::before {
    width: 80%;
}

.tab.active {
    color: var(--secondary-color);
    font-weight: 600;
}

.tab.active::before {
    width: 100%;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

/* ===== RESPONSIVE: Solo para móviles ===== */
@media screen and (max-width: 768px) {
    .sidebar {
        width: 0;
        overflow: hidden;
        position: absolute;
        z-index: 100;
        height: 100%;
        box-shadow: none;
    }
    
    .sidebar.active {
        width: 280px;
        box-shadow: 2px 0 20px rgba(0,0,0,0.2);
    }
    
    .main-content {
        width: 100%;
    }
    
    .stats-cards {
        grid-template-columns: 1fr;
    }
    
    .menu-toggle {
        display: block; /* Mostrar solo en móviles */
    }
    
    .sidebar-logo {
        width: 100px;
    }
    
    .sidebar-header {
        padding: 20px 15px;
    }
    
    .modal-content {
        margin: 20px;
        max-width: none;
    }
    
    .tabs {
        flex-direction: column;
        gap: 5px;
    }
    
    .tab {
        width: 100%;
        text-align: center;
    }
    
    .user-info span {
        display: none; /* Ocultar texto en móviles */
    }
    
    .btn-logout {
        padding: 8px 12px;
    }
    
    .btn-logout i {
        margin-right: 0;
    }
}

/* Para tablets en landscape */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    .sidebar {
        width: 220px;
    }
    
    .sidebar-logo {
        width: 120px;
    }
    
    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .menu-toggle {
        display: none; /* Aseguramos que no aparezca en tablets */
    }
}

/* Para desktop: aseguramos que NO aparezca el menú hamburguesa */
@media screen and (min-width: 1025px) {
    .menu-toggle {
        display: none !important; /* Forzar ocultar el menú hamburguesa en desktop */
    }
    
    .sidebar {
        width: 250px;
        position: relative;
        overflow: visible;
    }
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
    transition: background 0.3s;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* Utilidades adicionales */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

/* Badges para estados */
.badge {
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 600;
    display: inline-block;
}

.bg-success {
    background: linear-gradient(135deg, #28a745 0%, #5dd879 100%);
    color: white;
}

.bg-warning {
    background: linear-gradient(135deg, #ffc107 0%, #ffdb6d 100%);
    color: #000;
}

.bg-danger {
    background: linear-gradient(135deg, #dc3545 0%, #f06a78 100%);
    color: white;
}

.bg-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #939ea7 100%);
    color: white;
}

/* Botón secundario para modales */
.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(108,117,125,0.3);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(108,117,125,0.4);
}

/* Botones pequeños */
.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.btn-sm i {
    font-size: 12px;
}

/* Alineación de montos */
.text-end {
    text-align: right;
}

/* Estilo para montos en la tabla */
td.text-end {
    font-weight: 500;
    color: var(--primary-color);
}

/* Estilo para saldos pendientes */
td.text-end:contains('pendiente') {
    color: var(--danger);
    font-weight: 600;
}

/* Estilos para los badges de estado */
.status-badge {
    padding: 5px 10px;
    border-radius: 4px;
    font-weight: bold;
    color: white;
    display: inline-block;
    text-align: center;
    min-width: 80px;
}

.estado-inicio {
    background-color: #ffc107; /* Amarillo */
    color: #333;
}

.estado-proceso {
    background-color: #17a2b8; /* Azul claro */
    color: white;
}

.estado-finalizado {
    background-color: #28a745; /* Verde */
    color: white;
}

.estado-default {
    background-color: #6c757d; /* Gris */
    color: white;
}