:root {
    --primary-color: #1e3a8a;
    --secondary-color: #3b82f6;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #8b5cf6;
}

/* CONFIGURACIÓN CRITICAL PARA FOOTER STICKY */
* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8fafc;
    overflow-x: hidden;
}

/* ESTRUCTURA FLEXBOX PARA FOOTER STICKY */
.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Esta clase es CRÍTICA - debe expandirse para empujar el footer */
.content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* El main también debe poder expandirse si es necesario */
main {
    flex: 1;
}

/* Navbar estilos */
.navbar-dark.bg-dark {
    background-color: var(--primary-color) !important;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

    .btn-primary:hover {
        background-color: #1e40af;
        border-color: #1e40af;
    }

.text-primary {
    color: var(--primary-color) !important;
}

/* Cards y elementos de la página */
.card {
    border-radius: 0.5rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.card-header {
    background-color: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.alert-primary {
    background-color: #dbeafe;
    border-color: #bfdbfe;
    color: #1e40af;
}

.alert-success {
    background-color: #d1fae5;
    border-color: #a7f3d0;
    color: #065f46;
}

.form-control:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.25);
}

#respuesta-container,
#error-container {
    transition: all 0.3s ease;
}

#query-input {
    padding: 0.75rem;
    border-radius: 0.5rem;
}

#consultar-btn {
    padding: 0.5rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
}

/* Estilos para la respuesta del asistente */
.respuesta-asistente {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.4;
}

    .respuesta-asistente h2 {
        color: #1e3a8a;
        font-size: 1.3em;
        font-weight: bold;
        margin-bottom: 0.5em;
        border-bottom: 2px solid #3b82f6;
        padding-bottom: 0.3em;
    }

    .respuesta-asistente h3 {
        color: #1e3a8a;
        font-size: 1.1em;
        font-weight: bold;
        margin-top: 1em;
        margin-bottom: 0.5em;
    }

/* Estilos para los pasos del procedimiento */
.pasos-lista {
    margin: 0.5em 0;
    padding: 0;
    list-style: none;
}

.paso-item {
    display: flex;
    align-items: center;
    padding: 0.6em;
    margin-bottom: 0.4em;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.4rem;
    transition: background-color 0.2s ease;
}

    .paso-item:hover {
        background-color: #f1f5f9;
    }

.paso-numero {
    background-color: #e5e7eb;
    color: #374151;
    padding: 0.4em 0.7em;
    border-radius: 0.3rem;
    font-weight: bold;
    margin-right: 0.8em;
    min-width: 3em;
    text-align: center;
    font-size: 0.9em;
}

.paso-descripcion {
    flex: 1;
    font-size: 0.95em;
}

.paso-checkbox {
    margin-left: 0.8em;
    width: 1.3rem;
    height: 1.3rem;
    border: 2px solid #d1d5db;
    border-radius: 0.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .paso-checkbox:hover {
        border-color: #3b82f6;
    }

/* Estilos para información de contacto */
.contacto-info {
    background-color: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 0.4rem;
    padding: 0.8em;
    margin: 0.8em 0;
}

.contacto-item {
    display: flex;
    margin-bottom: 0.3em;
}

.contacto-label {
    font-weight: bold;
    min-width: 120px;
    color: #1e40af;
    font-size: 0.95em;
}

.contacto-value {
    color: #374151;
    font-size: 0.95em;
    flex: 1;
    word-wrap: break-word;
}

/* Estilos para referencias legales */
.referencias-legales {
    background-color: #fefce8;
    border: 1px solid #fde047;
    border-radius: 0.4rem;
    padding: 0.8em;
    margin: 0.8em 0;
    font-style: italic;
    color: #713f12;
    font-size: 0.9em;
}

    .referencias-legales h3 {
        margin-top: 0;
        margin-bottom: 0.3em;
        font-size: 1em;
    }

/* FOOTER MINIMALISTA - ESTILOS FINALES */
.footer {
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
    padding: 6px 0;
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: auto;
    flex-shrink: 0; /* IMPORTANTE: Evita que el footer se encoja */
    width: 100%;
}

    .footer .text-muted {
        color: #6c757d !important;
    }

    .footer .container {
        margin-bottom: 0;
        padding-bottom: 0;
    }

    .footer .row {
        margin-bottom: 0;
    }

/* Responsive: aún más pequeño en móviles */
@media (max-width: 768px) {
    .footer {
        padding: 4px 0;
        font-size: 0.7rem;
    }

        .footer .text-end {
            text-align: start !important;
            margin-top: 3px;
        }
}

/* Estilos adicionales para asegurar layout correcto */
.container {
    max-width: 1140px;
}

/* IMPORTANTE: Asegurar que no hay estilos conflictivos */
.body-wrapper {
    display: contents;
}

/* Debug: temporal para verificar la estructura */
/*
.page-wrapper {
    border: 2px solid red;
}
.content-wrapper {
    border: 2px solid blue;
}
.footer {
    border: 2px solid green;
}
*/
/* Responsive footer para móviles */
@media (max-width: 768px) {
    .footer-fixed {
        padding: 4px 0 !important;
        font-size: 0.7rem !important;
    }

        .footer-fixed .text-end {
            text-align: start !important;
            margin-top: 3px;
        }
}
/* Estilos para el historial Taser */
.table-hover tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.075);
}

.table-warning {
    background-color: rgba(255, 193, 7, 0.2) !important;
}

.badge-supervisor {
    background: linear-gradient(45deg, #28a745, #20c997);
    color: white;
}

.stats-card {
    transition: transform 0.2s;
}

    .stats-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    }

/* Mejorar tooltips */
.tooltip-inner {
    max-width: 300px;
    text-align: left;
}

/* Indicador de servicio activo */
.table-warning td {
    border-left: 4px solid #ffc107;
}

/* Estilos para selector de turnos */
.turno-selector {
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

    .turno-selector:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    }

    .turno-selector.selected {
        border-color: #0d6efd;
        background-color: #f8f9ff;
    }

        .turno-selector.selected .card-body {
            background-color: transparent;
        }