/* Custom CSS para BS Capital */

:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --primary-dark: #0056b3;
    --success-dark: #1e7e34;
    --warning-dark: #d39e00;
    --info-dark: #117a8b;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    padding-top: 110px; /* Para compensar el navbar fixed */
}

.main-content {
    min-height: calc(100vh - 140px);
}

/* Navbar personalizado */
.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

/* Sidebar */
.sidebar {
    min-height: calc(100vh - 76px);
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
}

.sidebar .nav-link {
    font-weight: 500;
    color: #333;
    padding: 0.75rem 1rem;
    margin: 0.25rem 0;
    border-radius: 0.375rem;
    transition: all 0.3s ease;
}

.sidebar .nav-link:hover {
    color: var(--primary-color);
    background-color: rgba(0, 123, 255, 0.1);
}

.sidebar .nav-link.active {
    color: var(--primary-color);
    background-color: rgba(0, 123, 255, 0.1);
    font-weight: 600;
}

.sidebar .nav-link i {
    margin-right: 0.5rem;
    width: 16px;
    text-align: center;
}

/* Cards personalizadas */
.card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    transition: all 0.3s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.25rem 2rem 0 rgba(58, 59, 69, 0.2);
}

.border-left-primary {
    border-left: 0.25rem solid var(--primary-color) !important;
}

.border-left-success {
    border-left: 0.25rem solid var(--success-color) !important;
}

.border-left-info {
    border-left: 0.25rem solid var(--info-color) !important;
}

.border-left-warning {
    border-left: 0.25rem solid var(--warning-color) !important;
}

/* Botones personalizados */
.btn {
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color), var(--success-dark));
    border: none;
}

.btn-success:hover {
    background: linear-gradient(135deg, var(--success-dark), var(--success-color));
    transform: translateY(-1px);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color), var(--warning-dark));
    border: none;
    color: #212529;
}

.btn-warning:hover {
    background: linear-gradient(135deg, var(--warning-dark), var(--warning-color));
    transform: translateY(-1px);
    color: #212529;
}

.btn-info {
    background: linear-gradient(135deg, var(--info-color), var(--info-dark));
    border: none;
}

.btn-info:hover {
    background: linear-gradient(135deg, var(--info-dark), var(--info-color));
    transform: translateY(-1px);
}

/* Formularios */
.form-control {
    border-radius: 0.5rem;
    border: 1px solid #e3e6f0;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-select {
    border-radius: 0.5rem;
    border: 1px solid #e3e6f0;
}

.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Tablas */
.table {
    border-radius: 0.5rem;
    overflow: hidden;
}

.table thead th {
    background-color: var(--primary-color);
    color: white;
    border: none;
    font-weight: 600;
}

.table tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.05);
}

/* Badges */
.badge {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
}

/* Dashboard específico */
.dashboard-card {
    transition: all 0.3s ease;
}

.dashboard-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 0.5rem 2rem 0 rgba(58, 59, 69, 0.3);
}

.dashboard-card .card-body {
    padding: 1.5rem;
}

.dashboard-card .h4 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark-color);
}

.dashboard-card .text-xs {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Quick actions */
.quick-action-btn {
    min-height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: white;
    font-weight: 500;
    transition: all 0.3s ease;
    border-radius: 0.75rem;
}

.quick-action-btn:hover {
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 0.25rem 1rem 0 rgba(0, 0, 0, 0.2);
}

.quick-action-btn i {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

/* Login page */
.login-container {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color), var(--info-color));
}

.login-card {
    border-radius: 1rem;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175);
    border: none;
    overflow: hidden;
}

.login-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 2rem;
    text-align: center;
}

.login-header h3 {
    margin: 0;
    font-weight: 700;
}

.login-body {
    padding: 2rem;
}

/* Simulador de Cuotas */
.simulador-cuotas {
    background-color: #f8f9fa;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-top: 1rem;
}

.simulador-cuotas .table {
    margin-bottom: 0;
    font-size: 0.9rem;
}

.simulador-cuotas .table th {
    background-color: var(--primary-color);
    color: white;
    font-size: 0.8rem;
    padding: 0.5rem;
    text-align: center;
}

.simulador-cuotas .table td {
    padding: 0.5rem;
    text-align: center;
    font-size: 0.8rem;
}

.simulador-toggle {
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
}

.simulador-toggle:hover {
    color: var(--primary-color);
}

.simulador-toggle i {
    transition: transform 0.3s ease;
}

.simulador-toggle.collapsed i {
    transform: rotate(-90deg);
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding-top: 56px;
    }
    
    .sidebar {
        top: 56px;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .h5 {
        font-size: 1.1rem;
    }
    
    .text-xs {
        font-size: 0.7rem;
    }
    
    /* Ocultar sidebar en móviles */
    .sidebar {
        display: none;
    }
    
    /* Ajustar contenido principal en móviles */
    main {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    /* Cards más compactas en móvil */
    .col-xl-3.col-md-6 {
        margin-bottom: 1rem;
    }
    
    /* Tablas responsive */
    .table-responsive {
        border-radius: 0.5rem;
    }
    
    /* Botones más grandes en móvil */
    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }
    
    /* Formularios más amigables en móvil */
    .form-control {
        padding: 1rem;
        font-size: 1rem;
    }
    
    /* Login responsive */
    .login-card {
        margin: 1rem;
    }
    
    .login-header {
        padding: 1.5rem;
    }
    
    .login-body {
        padding: 1.5rem;
    }
    
    /* Dashboard móvil */
    .dashboard-card .card-body {
        padding: 1rem;
    }
    
    .dashboard-card .h4 {
        font-size: 1.5rem;
    }
    
    .quick-action-btn {
        min-height: 70px;
        font-size: 12px;
    }
    
    .quick-action-btn i {
        font-size: 1.2rem;
    }
    
    /* Ocultar elementos en móvil */
    .d-mobile-none {
        display: none !important;
    }
    
    /* Simulador responsive */
    .simulador-cuotas {
        padding: 0.5rem;
        margin-top: 0.5rem;
    }
    
    .simulador-cuotas .table {
        font-size: 0.75rem;
    }
    
    .simulador-cuotas .table th,
    .simulador-cuotas .table td {
        padding: 0.25rem;
        font-size: 0.7rem;
    }
    
    .simulador-cuotas .table th {
        font-size: 0.65rem;
    }
    
    /* Hacer que las columnas del simulador se ajusten mejor en móvil */
    .simulador-cuotas .table-responsive {
        font-size: 0.7rem;
    }
}

@media (max-width: 576px) {
    .container-fluid {
        padding: 0.5rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group .btn {
        margin-bottom: 0.5rem;
    }
    
    .dashboard-card .card-body {
        padding: 0.75rem;
    }
    
    .dashboard-card .h4 {
        font-size: 1.25rem;
    }
    
    .quick-action-btn {
        min-height: 60px;
        font-size: 11px;
        padding: 0.5rem;
    }
    
    .quick-action-btn i {
        font-size: 1rem;
    }
    
    .card-header h6 {
        font-size: 0.9rem;
    }
    
    /* Simulador extra pequeño */
    .simulador-cuotas .table th,
    .simulador-cuotas .table td {
        padding: 0.2rem;
        font-size: 0.65rem;
    }
    
    .simulador-cuotas .table th {
        font-size: 0.6rem;
    }
}

/* Utilidades */
.text-xs {
    font-size: 0.75rem;
}

.font-weight-bold {
    font-weight: 700;
}

.text-gray-800 {
    color: #5a5c69;
}

.text-gray-300 {
    color: #dddfeb;
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

/* Loading spinner */
.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Alertas personalizadas */
.alert {
    border: none;
    border-radius: 0.5rem;
    font-weight: 500;
}

.alert-dismissible .btn-close {
    padding: 1rem;
}