:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* Navbar */
.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.3rem;
}

/* Cards */
.card {
    border: none;
    box-shadow: 0 0 10px rgba(0,0,0,.1);
    border-radius: 10px;
    margin-bottom: 20px;
}

.card-header {
    background-color: var(--primary-color);
    color: white;
    font-weight: bold;
    border-radius: 10px 10px 0 0 !important;
}

.card-stats {
    transition: transform 0.3s;
}

.card-stats:hover {
    transform: translateY(-5px);
}

/* Buttons */
.btn {
    border-radius: 5px;
    padding: 8px 20px;
    font-weight: 500;
}

.btn-sm {
    padding: 5px 15px;
}

/* Tables */
.table {
    background-color: white;
}

.table thead {
    background-color: var(--light-color);
}

.table-responsive {
    border-radius: 10px;
    overflow: hidden;
}

/* DataTables custom */
.dataTables_wrapper .dataTables_filter input {
    border-radius: 5px;
    padding: 5px 10px;
    border: 1px solid #dee2e6;
}

.dataTables_wrapper .dataTables_length select {
    border-radius: 5px;
    padding: 5px 10px;
    border: 1px solid #dee2e6;
}

/* Forms */
.form-control, .form-select {
    border-radius: 5px;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.form-label {
    font-weight: 500;
    margin-bottom: 5px;
}

/* Badges */
.badge {
    padding: 5px 10px;
    border-radius: 5px;
    font-weight: 500;
}

/* Status badges */
.status-solicitado { background-color: #0dcaf0; }
.status-en-revision { background-color: #ffc107; }
.status-aprobado { background-color: #198754; }
.status-rechazado { background-color: #dc3545; }
.status-desembolsado { background-color: #0d6efd; }
.status-activo { background-color: #198754; }
.status-vencido { background-color: #dc3545; }
.status-pagado { background-color: #6c757d; }
.status-cancelado { background-color: #212529; }
.status-refinanciado { background-color: #0dcaf0; }

/* Alerts */
.alert {
    border-radius: 10px;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
}

/* Footer */
.footer {
    margin-top: auto;
    border-top: 1px solid #dee2e6;
}

/* Login page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
    width: 100%;
    max-width: 400px;
    border-radius: 15px;
    overflow: hidden;
}

.login-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.login-header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.login-body {
    padding: 30px;
    background-color: white;
}

/* Dashboard Stats Cards */
.stats-card {
    border-left: 4px solid;
    transition: all 0.3s;
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,.15);
}

.stats-card.primary { border-left-color: var(--primary-color); }
.stats-card.success { border-left-color: var(--success-color); }
.stats-card.warning { border-left-color: var(--warning-color); }
.stats-card.danger { border-left-color: var(--danger-color); }
.stats-card.info { border-left-color: var(--info-color); }

.stats-icon {
    font-size: 3rem;
    opacity: 0.3;
}

/* Loading spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Print styles */
@media print {
    .navbar, .footer, .no-print {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
    
    body {
        background-color: white;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .card-body {
        padding: 15px;
    }
    
    .table {
        font-size: 0.875rem;
    }
    
    .btn {
        padding: 6px 15px;
        font-size: 0.875rem;
    }
}

/* Select2 custom */
.select2-container--bootstrap-5 .select2-selection {
    border-radius: 5px !important;
}

/* Flatpickr custom */
.flatpickr-calendar {
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,.2);
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

/* Utility classes */
.cursor-pointer {
    cursor: pointer;
}

.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shadow-sm {
    box-shadow: 0 .125rem .25rem rgba(0,0,0,.075);
}

.shadow {
    box-shadow: 0 .5rem 1rem rgba(0,0,0,.15);
}

/* Info box */
.info-box {
    display: flex;
    align-items: center;
    padding: 15px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0,0,0,.1);
    margin-bottom: 15px;
}

.info-box-icon {
    flex-shrink: 0;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    border-radius: 10px;
    margin-right: 15px;
}

.info-box-content {
    flex-grow: 1;
}

.info-box-text {
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 5px;
}

.info-box-number {
    font-size: 1.5rem;
    font-weight: bold;
    color: #212529;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #dee2e6;
}

.timeline-item {
    position: relative;
    padding-bottom: 20px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--primary-color);
    border: 2px solid white;
    box-shadow: 0 0 0 2px var(--primary-color);
}

.timeline-content {
    padding: 10px 15px;
    background-color: white;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
}

/* File upload area */
.file-upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.file-upload-area:hover {
    border-color: var(--primary-color);
    background-color: #f8f9fa;
}

.file-upload-area.dragover {
    border-color: var(--success-color);
    background-color: #d1e7dd;
}

/* Progress bar */
.progress {
    height: 1.5rem;
    border-radius: 5px;
}

.progress-bar {
    font-size: 0.875rem;
    font-weight: bold;
}
