/* Estilos centralizados del sistema */

/* Variables CSS por defecto (se sobrescriben dinámicamente) */
:root {
    --color-primario: #0d6efd;
    --color-secundario: #6c757d;
    --color-acento: #198754;
    --color-fondo: #ffffff;
    --color-texto: #212529;
}

/* Scroll invisible pero funcional */
* {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE y Edge */
}

*::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

/* Fondo gradiente fijo e infinito */
body {
    background-image: linear-gradient(to bottom, #94c1ff, #a4baea, #adb4d4, #afafc0, #acacac);
    background-attachment: fixed;
    background-size: cover;
    background-repeat: no-repeat;
    min-height: 100vh;
}

/* Header fijo */
.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Logo en header */
.logo-container {
    background: white;
    border-radius: 8px;
    padding: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.logo-header {
    max-height: 32px;
    max-width: 80px;
    object-fit: contain;
}

/* Botones de navegación */
.nav-button {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 2px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 8px;
    margin: 0 5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.5rem;
    color: white !important;
}

.nav-button i.bi {
    font-size: 1rem !important;
    display: inline-block !important;
    color: white !important;
    opacity: 1 !important;
    visibility: visible !important;
    line-height: 1 !important;
}

.nav-button:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
}

.nav-button.active {
    background: rgba(255, 255, 255, 0.25) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    color: white !important;
}

/* Footer fijo - Ancho completo con fondo negro y texto blanco */
footer {
    box-shadow: 0 -2px 4px rgba(0,0,0,0.1);
    background-color: #000000 !important;
    color: white !important;
    width: 100% !important;
}

footer * {
    color: white !important;
}

/* Ancho centralizado */
main {
    max-width: 90%;
    margin: 0 auto;
    padding: 20px 0 120px 0;
}

main .container-fluid {
    padding-bottom: 40px;
}

/* Espaciado entre tablas */
.table + .table {
    margin-top: 2rem;
}

/* Precios alineados a la derecha */
.text-precio {
    text-align: right;
    font-weight: 600;
}

/* Estilos para login */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-primario) 0%, var(--color-secundario) 100%);
}

.login-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    padding: 2rem;
    max-width: 400px;
    width: 100%;
}

.login-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-texto);
    text-align: center;
    margin-bottom: 0.5rem;
}

.login-subtitle {
    font-size: 0.875rem;
    color: var(--color-secundario);
    text-align: center;
    margin-bottom: 2rem;
}

/* Cards de estadísticas */
.stats-card {
    transition: transform 0.2s ease;
    display: flex;
    flex-direction: column;
}

.stats-card .card-body {
    flex: 1;
}

.stats-card:hover {
    transform: translateY(-4px);
}

/* Títulos de cards más destacados */
.card-header h5 {
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    color: #0d6efd !important;
    letter-spacing: -0.02em;
    text-transform: none;
}

.card-header {
    background: linear-gradient(to right, #f8f9fa 0%, #ffffff 100%) !important;
    border-bottom: 2px solid #0d6efd !important;
    padding: 1rem 1.25rem !important;
}

/* Formularios */
.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

/* Validación RUT en tiempo real */
.form-control.is-invalid {
    border-color: #dc3545;
    padding-right: calc(1.5em + 0.75rem);
}
.form-control.is-invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
}
.form-control.is-valid {
    border-color: #198754;
}
.form-control.is-valid:focus {
    border-color: #198754;
    box-shadow: 0 0 0 0.25rem rgba(25, 135, 84, 0.25);
}
.form-control.is-invalid ~ .invalid-feedback {
    display: block;
}
.invalid-feedback {
    color: #dc3545;
}

/* Botones */
.btn {
    border-radius: 6px;
    font-weight: 500;
}

/* Badges - Texto blanco en todos los badges (excepto los que tienen color definido) */
.badge {
    color: white !important;
}

/* Badge del subtítulo del sistema - texto negro */
.badge-subtitulo {
    color: #000000 !important;
}

/* Tablas */
.table {
    border-radius: 8px;
    overflow: hidden;
}

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

/* Responsive */
@media (max-width: 768px) {
    main {
        max-width: 95%;
        padding: 10px;
    }
    
    .navbar {
        max-width: 100% !important;
    }
    
    footer {
        width: 100% !important;
    }
}

/* Utilidades */
.text-center {
    text-align: center;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

