/* Importar tipografía premium Inter */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg-primary: #f8fafc; /* Slate claro premium */
    --bg-secondary: #ffffff; /* Blanco puro */
    --bg-glass: rgba(255, 255, 255, 0.75); /* Cristal templado claro */
    --border-glass: rgba(0, 0, 0, 0.08); /* Borde sutil */
    --text-primary: #0f172a; /* Slate oscuro para legibilidad ultra-nítida */
    --text-secondary: #64748b; /* Gris slate suave */
    --accent-blue: #3b82f6; /* Azul eléctrico premium */
    --accent-green: #10b981;
    --accent-yellow: #f59e0b;
    --accent-red: #ef4444;
    --accent-purple: #8b5cf6;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    background-color: var(--bg-primary);
    background-image: radial-gradient(circle at top right, rgba(59, 130, 246, 0.04) 0%, rgba(255, 255, 255, 0) 50%),
                      radial-gradient(circle at bottom left, rgba(139, 92, 246, 0.04) 0%, rgba(255, 255, 255, 0) 40%);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary) !important;
}

/* Navbar Premium Light */
.navbar-custom {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-glass);
    padding: 0.8rem 1.5rem;
}
.navbar-brand {
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.nav-link {
    color: var(--text-secondary) !important;
    font-weight: 500;
    transition: var(--transition-smooth);
}
.nav-link:hover, .nav-link.active {
    color: var(--accent-blue) !important;
    transform: translateY(-1px);
}

/* Tarjetas Estilo Glassmorphic Light */
.card-glass {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.08);
    color: var(--text-primary);
    transition: var(--transition-smooth);
}
.card-glass:hover {
    border-color: rgba(59, 130, 246, 0.2);
    box-shadow: 0 15px 35px -5px rgba(59, 130, 246, 0.12);
    transform: translateY(-4px);
}

.card-title {
    font-weight: 600;
    color: var(--text-primary);
}

/* Botones Premium */
.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border: none;
    border-radius: 8px;
    font-weight: 500;
    padding: 0.6rem 1.5rem;
    color: #ffffff !important;
    transition: var(--transition-smooth);
}
.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.25);
}

.btn-outline-custom {
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.12);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 0.6rem 1.5rem;
    transition: var(--transition-smooth);
}
.btn-outline-custom:hover {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

/* Tablas Premium */
.table-custom {
    color: var(--text-primary);
}
.table-custom th {
    background-color: rgba(0, 0, 0, 0.02) !important;
    border-bottom: 2px solid var(--border-glass) !important;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    padding: 1rem;
}
.table-custom td {
    background-color: transparent !important;
    border-bottom: 1px solid var(--border-glass) !important;
    padding: 1rem;
    vertical-align: middle;
}
.table-custom tr {
    transition: var(--transition-smooth);
}
.table-custom tr:hover td {
    background-color: rgba(59, 130, 246, 0.03) !important;
}

/* Formularios Premium */
.form-control, .form-select {
    background-color: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.12) !important;
    color: var(--text-primary) !important;
    border-radius: 8px;
    padding: 0.6rem 1rem;
    transition: var(--transition-smooth);
}
.form-control:focus, .form-select:focus {
    background-color: #ffffff !important;
    border-color: var(--accent-blue) !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2) !important;
}
.form-label {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

/* Indicadores de Semáforo */
.badge-semaforo {
    padding: 0.5rem 0.8rem;
    border-radius: 50rem;
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.badge-vence-verde {
    background-color: rgba(16, 185, 129, 0.1);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.25);
}
.badge-vence-amarillo {
    background-color: rgba(217, 119, 6, 0.1);
    color: #d97706;
    border: 1px solid rgba(217, 119, 6, 0.25);
}
.badge-vence-rojo {
    background-color: rgba(220, 38, 38, 0.1);
    color: #dc2626;
    border: 1px solid rgba(220, 38, 38, 0.25);
}

.semaforo-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.dot-verde { background-color: var(--accent-green); box-shadow: 0 0 6px var(--accent-green); }
.dot-amarillo { background-color: var(--accent-yellow); box-shadow: 0 0 6px var(--accent-yellow); }
.dot-rojo { background-color: var(--accent-red); box-shadow: 0 0 6px var(--accent-red); }

/* Mantenimiento Items y Reparaciones */
.maint-task-card {
    border-left: 4px solid rgba(0, 0, 0, 0.08);
}
.maint-task-card.task-vencido {
    border-left-color: var(--accent-red);
}
.maint-task-card.task-vigente {
    border-left-color: var(--accent-green);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Login Page Styling */
.login-container {
    max-width: 420px;
    margin-top: 10vh;
}
.login-header-logo {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
}

/* Fallas y novedades */
.falla-item {
    border-left: 4px solid;
    padding-left: 1rem;
}
.falla-pendiente { border-left-color: var(--accent-yellow); }
.falla-proceso { border-left-color: var(--accent-blue); }
.falla-completado { border-left-color: var(--accent-green); }

/* Estilos de botones de descarga y consultas rápidas */
.doc-icon {
    font-size: 1.5rem;
    color: var(--accent-blue);
}

/* Custom Tabs for Glassmorphism Light */
.nav-tabs-custom {
    border-bottom: 1px solid var(--border-glass) !important;
}
.nav-tabs-custom .nav-link {
    background: transparent;
    border: none;
    color: var(--text-secondary) !important;
    font-weight: 600;
    padding: 0.8rem 1.5rem;
    transition: var(--transition-smooth);
    border-bottom: 2px solid transparent;
}
.nav-tabs-custom .nav-link:hover {
    color: var(--text-primary) !important;
    background: rgba(0, 0, 0, 0.02);
}
.nav-tabs-custom .nav-link.active {
    color: var(--accent-blue) !important;
    background: rgba(59, 130, 246, 0.05) !important;
    border-bottom: 2px solid var(--accent-blue) !important;
    border-radius: 8px 8px 0 0;
}

/* ==========================================================================
   MEJORAS DE LEGIBILIDAD (MODO CLARO Y CONTRASTE)
   ========================================================================== */

/* Asegurar que las opciones de dropdowns tengan fondo claro y letra oscura */
select option {
    background-color: #ffffff !important;
    color: var(--text-primary) !important;
}

/* Autocompletado del Navegador (Chrome Autofill) con fondo claro */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
    -webkit-text-fill-color: var(--text-primary) !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* Form Controls deshabilitados o de solo lectura */
.form-control:disabled, 
.form-control[readonly], 
.form-select:disabled {
    background-color: #f1f5f9 !important;
    color: #64748b !important;
    opacity: 0.85 !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
}

/* Redefinir badges sutiles de Bootstrap para fondos claros con alto contraste */
.bg-danger-subtle {
    background-color: rgba(220, 38, 38, 0.08) !important;
    color: #dc2626 !important;
    border: 1px solid rgba(220, 38, 38, 0.2) !important;
}
.bg-primary-subtle {
    background-color: rgba(59, 130, 246, 0.08) !important;
    color: #2563eb !important;
    border: 1px solid rgba(59, 130, 246, 0.2) !important;
}
.bg-success-subtle {
    background-color: rgba(16, 185, 129, 0.08) !important;
    color: #059669 !important;
    border: 1px solid rgba(16, 185, 129, 0.2) !important;
}
.bg-warning-subtle {
    background-color: rgba(217, 119, 6, 0.08) !important;
    color: #d97706 !important;
    border: 1px solid rgba(217, 119, 6, 0.2) !important;
}

/* Estilos de Alertas en Light Mode */
.alert {
    background-color: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    color: var(--text-primary) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}
.alert-danger {
    border-color: rgba(220, 38, 38, 0.25) !important;
    color: #dc2626 !important;
    background-color: rgba(220, 38, 38, 0.05) !important;
}
.alert-success {
    border-color: rgba(16, 185, 129, 0.25) !important;
    color: #059669 !important;
    background-color: rgba(16, 185, 129, 0.05) !important;
}
.alert-warning {
    border-color: rgba(217, 119, 6, 0.25) !important;
    color: #d97706 !important;
    background-color: rgba(217, 119, 6, 0.05) !important;
}
.alert-info {
    border-color: rgba(59, 130, 246, 0.25) !important;
    color: #2563eb !important;
    background-color: rgba(59, 130, 246, 0.05) !important;
}

/* Modales con contraste en modo claro */
.modal-content {
    background-color: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    color: var(--text-primary) !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15) !important;
}
.modal-header, .modal-footer {
    border-color: rgba(0, 0, 0, 0.06) !important;
}
.modal-title {
    color: var(--text-primary) !important;
    font-weight: 700 !important;
}
.modal-body label {
    color: var(--text-primary) !important;
}
.modal-body textarea:disabled, .modal-body input:disabled {
    background-color: #f1f5f9 !important;
    color: #64748b !important;
}

/* ==========================================================================
   SOBREESCRITURAS DE SEGURIDAD PARA CLASES OSCURAS HARDCODEADAS EN PHP
   ========================================================================== */

/* Forzar que textos con clase utilitaria .text-white en cualquier parte se vean oscuros (ej: modales, listas), EXCEPTUANDO los que tienen fondos oscuros propios (como badges, botones, etc.) */
.text-white:not(.bg-dark):not(.bg-danger):not(.bg-success):not(.bg-primary):not(.bg-secondary):not(.btn):not(.badge):not(.nav-link) {
    color: var(--text-primary) !important;
}

.text-white-50:not(.bg-dark):not(.bg-danger):not(.bg-success):not(.bg-primary):not(.bg-secondary):not(.btn):not(.badge):not(.nav-link) {
    color: var(--text-secondary) !important;
}

/* Forzar mayor contraste para los textos de estado de Bootstrap en fondo claro */
.text-info {
    color: #0284c7 !important; /* Azul cielo más oscuro */
}
.text-success {
    color: #15803d !important; /* Verde más rico */
}
.text-warning {
    color: #b45309 !important; /* Amarillo/Ámbar más oscuro */
}
.text-danger {
    color: #b91c1c !important; /* Rojo más oscuro */
}

/* Forzar que los botones de cerrar modales sean oscuros para modo claro */
.btn-close-white {
    filter: var(--bs-btn-close-white-filter, none) !important;
}

/* Forzar que modales que tienen la clase bg-dark en PHP se visualicen con fondo claro */
.modal-content.bg-dark {
    background-color: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    color: var(--text-primary) !important;
}

/* Forzar que inputs con clase bg-dark hardcodeada se visualicen con fondo claro y letra oscura */
.form-control.bg-dark,
.form-select.bg-dark {
    background-color: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.12) !important;
    color: var(--text-primary) !important;
}
.form-control.bg-dark::placeholder {
    color: var(--text-secondary) !important;
    opacity: 0.8;
}

/* Forzar que los input group labels hardcodeados con bg-dark se visualicen claros */
.input-group-text.bg-dark {
    background-color: #f1f5f9 !important;
    color: var(--text-secondary) !important;
    border-color: rgba(0, 0, 0, 0.12) !important;
}

/* Cambiar sombreado de cajas internas oscuras a claras */
.bg-dark {
    background-color: rgba(0, 0, 0, 0.03) !important;
}
.bg-dark.bg-opacity-20 {
    background-color: rgba(0, 0, 0, 0.04) !important;
}
.bg-dark.bg-opacity-25 {
    background-color: rgba(0, 0, 0, 0.05) !important;
}

/* Forzar que cualquier elemento con la clase bg-black se vea claro en el tema claro */
.bg-black {
    background-color: rgba(0, 0, 0, 0.03) !important;
}
.bg-black.bg-opacity-20 {
    background-color: rgba(0, 0, 0, 0.04) !important;
}
.bg-black.bg-opacity-10 {
    background-color: rgba(0, 0, 0, 0.02) !important;
}

/* Mantener el diseño oscuro premium para los badges de patente (dominio) */
.badge.bg-dark {
    background-color: #0f172a !important;
    color: #ffffff !important;
    border: 1px solid #334155 !important;
}

