/* Xequea v2 - Sistema de Diseño Unificado */
/* Extiende el diseño base de index.php a todas las interfaces */

/* ========================================
   VARIABLES GLOBALES Y PALETA DE COLORES
   ======================================== */
:root {
    --xequea-primary: #F5B11B;
    --xequea-secondary: #E6A015;
    --xequea-accent: #FFC857;
    --xequea-dark: #2C3E50;
    --xequea-light: #ECF0F1;
    --xequea-white: #FFFFFF;
    --xequea-text: #2C3E50;
    --xequea-border: #BDC3C7;
    --xequea-success: #28a745;
    --xequea-danger: #dc3545;
    --xequea-warning: #ffc107;
    --xequea-info: #17a2b8;
    
    /* Sombras y efectos */
    --xequea-shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --xequea-shadow-md: 0 4px 8px rgba(0,0,0,0.1);
    --xequea-shadow-lg: 0 6px 12px rgba(0,0,0,0.15);
    
    /* Bordes redondeados característicos */
    --xequea-border-radius: 5px 44px 5px 44px;
    --xequea-border-radius-sm: 3px 22px 3px 22px;
    --xequea-border-radius-lg: 8px 55px 8px 55px;
}

/* ========================================
   TIPOGRAFÍA UNIFICADA
   ======================================== */
body {
    font-family: 'Source Sans Pro', 'Myriad Set Pro', 'Verdana', 'Monaco', sans-serif;
    background-color: var(--xequea-light);
    color: var(--xequea-text);
    line-height: 1.6;
}

.xequea-title {
    color: var(--xequea-dark);
    font-weight: 600;
    font-family: 'Source Sans Pro', sans-serif;
}

.xequea-subtitle {
    color: var(--xequea-primary);
    font-weight: 500;
}

.xequea-text-primary {
    color: var(--xequea-primary) !important;
}

.xequea-text-secondary {
    color: var(--xequea-secondary) !important;
}

/* ========================================
   CONTENEDORES MODERNOS (REEMPLAZO DE BURBUJAS)
   ======================================== */
.xequea-bubble {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 12px;
    border: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    padding: 2rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.xequea-bubble::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, var(--xequea-primary) 0%, var(--xequea-accent) 100%);
}

.xequea-bubble:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(245, 177, 27, 0.15);
}

.xequea-bubble-sm {
    border-radius: 8px;
    padding: 1.5rem;
}

.xequea-bubble-lg {
    border-radius: 16px;
    padding: 2.5rem;
}

/* ========================================
   BOTONES UNIFICADOS
   ======================================== */
.xequea-btn {
    background: linear-gradient(135deg, var(--xequea-primary) 0%, var(--xequea-accent) 100%);
    color: var(--xequea-white);
    border: none;
    border-radius: 8px;
    font-family: 'Source Sans Pro', sans-serif;
    font-size: 16px;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
    display: inline-block;
    min-height: 40px;
    line-height: 1.5;
    box-shadow: 0 4px 15px rgba(245, 177, 27, 0.3);
    position: relative;
    overflow: hidden;
}

.xequea-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.xequea-btn:hover::before {
    left: 100%;
}

.xequea-btn:hover {
    background: linear-gradient(135deg, var(--xequea-accent) 0%, var(--xequea-primary) 100%);
    color: var(--xequea-white);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 177, 27, 0.4);
}

.xequea-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(245, 177, 27, 0.3);
}

.xequea-btn-outline {
    background: transparent;
    color: var(--xequea-primary);
    border: 2px solid var(--xequea-primary);
    box-shadow: 0 2px 10px rgba(245, 177, 27, 0.2);
}

.xequea-btn-outline::before {
    background: linear-gradient(90deg, transparent, rgba(245, 177, 27, 0.1), transparent);
}

.xequea-btn-outline:hover {
    background: linear-gradient(135deg, var(--xequea-primary) 0%, var(--xequea-accent) 100%);
    color: var(--xequea-white);
    border-color: transparent;
    box-shadow: 0 6px 20px rgba(245, 177, 27, 0.4);
}

.xequea-btn-sm {
    font-size: 14px;
    padding: 0.375rem 0.75rem;
    min-height: 30px;
}

.xequea-btn-lg {
    font-size: 18px;
    padding: 0.75rem 1.5rem;
    min-height: 45px;
}

/* ========================================
   FORMULARIOS UNIFICADOS
   ======================================== */
.xequea-form-group {
    margin-bottom: 1rem;
}

.xequea-form-label {
    color: var(--xequea-dark);
    font-weight: 600;
    margin-bottom: 0.75rem;
    display: block;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.xequea-form-control {
    box-sizing: border-box !important;
    max-width: 100% !important;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-family: 'Source Sans Pro', sans-serif;
    transition: all 0.3s ease;
    width: 100%;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.xequea-form-control:focus {
    border-color: var(--xequea-primary);
    box-shadow: 0 0 0 0.2rem rgba(245, 177, 27, 0.25), 0 4px 15px rgba(0, 0, 0, 0.1);
    outline: none;
    background: #ffffff;
    transform: translateY(-1px);
}

/* ========================================
   TABLAS UNIFICADAS
   ======================================== */
.xequea-table-container {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 12px;
    border: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin-bottom: 1.5rem;
    position: relative;
}

/* ========================================
   ALERTAS FLOTANTES (Overlay)
   ======================================== */
.xequea-alert-container {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999; /* por encima de cabecera, modales y cualquier overlay */
    width: min(92vw, 640px);
    pointer-events: none; /* no bloquea interacción con el fondo */
    display: flex;
    justify-content: center;
}
.xequea-alert-container .alert {
    pointer-events: auto; /* permitir cerrar con la X */
    margin: 0;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

/* Asegurar legibilidad y estética: X alineada y sin solapes */
.xequea-alert.alert {
    display: flex;
    align-items: center; /* centra verticalmente icono, texto y X */
    gap: 0.5rem;
    padding: 0.75rem 1rem; /* padding simétrico */
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.xequea-alert .btn-close {
    margin-left: auto; /* empuja la X al extremo derecho */
    position: static; /* evita posicionamiento absoluto que desalineaba */
    flex: 0 0 auto;
}
.xequea-alert i {
    margin-right: 0.25rem;
    flex: 0 0 auto;
}
.xequea-alert .xequea-alert-text { /* por si se usa contenedor de texto */
    flex: 1 1 auto;
}
.xequea-alert.alert-dismissible .btn-close {
    outline: none;
}

.xequea-table-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, var(--xequea-primary) 0%, var(--xequea-accent) 100%);
}

.xequea-table {
    width: 100%;
    margin-bottom: 0;
    border-collapse: collapse;
}

.xequea-table th {
    background: linear-gradient(135deg, var(--xequea-light) 0%, #e9ecef 100%);
    color: var(--xequea-dark);
    font-weight: 600;
    padding: 1.25rem 1rem;
    border-bottom: 3px solid var(--xequea-primary);
    text-align: left;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.xequea-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    vertical-align: middle;
    transition: all 0.2s ease;
}

.xequea-table tbody tr {
    transition: all 0.3s ease;
}

.xequea-table tbody tr:hover {
    background: linear-gradient(135deg, rgba(245, 177, 27, 0.08) 0%, rgba(245, 177, 27, 0.04) 100%);
    transform: translateX(2px);
}

.xequea-table tbody tr:last-child td {
    border-bottom: none;
}

/* ========================================
   FILTROS Y BÚSQUEDA
   ======================================== */
.xequea-filters {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 12px;
    border: none;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.xequea-filters::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, var(--xequea-primary) 0%, var(--xequea-accent) 100%);
}

.xequea-search-input {
    position: relative;
}

.xequea-search-input .input-group-text {
    background-color: var(--xequea-light);
    border-color: var(--xequea-border);
    color: var(--xequea-primary);
}

/* ========================================
   FILTROS COMPACTOS (variación más densa)
   ======================================== */
.xequea-filters--compact {
    padding: 0.5rem 0.75rem;
    margin-bottom: 0;
    box-shadow: var(--xequea-shadow-sm);
}

.xequea-filters--compact::before {
    height: 2px;
}

.xequea-filters--compact .xequea-form-label {
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
    letter-spacing: 0.25px;
}

.xequea-filters--compact .xequea-form-control {
    padding: 0.375rem 0.625rem !important;
    min-height: 34px !important;
    border-radius: 6px !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05) !important;
    background: #ffffff !important;
    border-width: 1px !important;
}

.xequea-filters--compact .input-group-text {
    padding: 0.375rem 0.625rem !important;
}

.xequea-filters--compact .btn {
    min-height: 34px !important;
    padding: 0.375rem 0.75rem !important;
}

@media (max-width: 768px) {
    .xequea-filters--compact {
        padding: 0.5rem 0.5rem;
    }
}

/* ========================================
   Encabezados de tarjeta blancos (reduce bloque amarillo)
   ======================================== */
.card-header.bg-white {
    background: #ffffff !important;
    padding: 0.75rem 1rem !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
}

/* ========================================
   Tarjeta compacta para filtros (menos sombra y margen)
   ======================================== */
.xequea-card--compact {
    margin-top: 0 !important;
    margin-bottom: 0.25rem !important;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06) !important;
}
.xequea-card--compact .card-header {
    padding: 0.5rem 0.75rem !important;
}
.xequea-card--compact .card-body:not(.p-0) {
    padding: 0.5rem 0.75rem 0.25rem !important;
}
.xequea-filters--compact {
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}

/* Evitar borde verde por defecto en filtros sin validación */
.xequea-filters .form-control:valid,
.xequea-filters .form-select:valid {
    border-color: rgba(0, 0, 0, 0.15) !important;
    box-shadow: none !important;
}

/* ========================================
   PAGINACIÓN UNIFICADA
   ======================================== */
.xequea-pagination {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 12px;
    border: none;
    padding: 1.5rem;
    margin-top: 1.5rem;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.xequea-pagination::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, var(--xequea-primary) 0%, var(--xequea-accent) 100%);
}

.xequea-pagination .pagination {
    margin-bottom: 0;
    justify-content: center;
}

.xequea-pagination .page-link {
    color: var(--xequea-primary);
    border-color: var(--xequea-border);
    font-weight: 500;
    transition: all 0.3s ease;
}

.xequea-pagination .page-link:hover {
    background-color: rgba(245, 177, 27, 0.1);
    border-color: var(--xequea-primary);
    color: var(--xequea-secondary);
    transform: translateY(-1px);
}

.xequea-pagination .page-item.active .page-link {
    background-color: var(--xequea-primary);
    border-color: var(--xequea-primary);
    color: var(--xequea-white);
    font-weight: 600;
}

.xequea-pagination .page-item.disabled .page-link {
    color: var(--xequea-border);
    background-color: transparent;
}

/* ========================================
   NAVEGACIÓN Y MENÚS - DISEÑO MINIMALISTA
   ======================================== */
.xequea-navbar {
    background: #000000;
    border-bottom: 1px solid rgba(245, 177, 27, 0.3);
    padding: 0.25rem 0;
    min-height: 48px;
}

.xequea-navbar .navbar-brand {
    color: var(--xequea-primary) !important;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s ease;
    padding: 0.4rem 0.75rem;
}

.xequea-navbar .navbar-brand:hover {
    color: var(--xequea-accent) !important;
}

.xequea-navbar .nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
    font-weight: 400;
    font-size: 0.9rem;
    transition: color 0.2s ease;
    border-radius: 3px;
    margin: 0 0.1rem;
    padding: 0.4rem 0.75rem !important;
}

.xequea-navbar .nav-link:hover {
    color: var(--xequea-accent) !important;
    background-color: rgba(255, 255, 255, 0.05);
}

.xequea-navbar .nav-link.active {
    color: var(--xequea-primary) !important;
    background-color: rgba(245, 177, 27, 0.1);
    font-weight: 500;
}

/* ========================================
   ALERTAS Y MENSAJES
   ======================================== */
.xequea-alert {
    border-radius: 12px;
    border: none;
    padding: 1.25rem 1.75rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.xequea-alert::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.xequea-alert-success {
    background: #d1e7dd; /* fondo opaco para mejor legibilidad */
    color: var(--xequea-success);
}

.xequea-alert-success::before {
    background: var(--xequea-success);
}

.xequea-alert-danger {
    background: #f8d7da; /* fondo opaco para mejor legibilidad */
    color: var(--xequea-danger);
}

.xequea-alert-danger::before {
    background: var(--xequea-danger);
}

.xequea-alert-warning {
    background: #fff3cd; /* fondo opaco para mejor legibilidad */
    color: #856404;
}

.xequea-alert-warning::before {
    background: var(--xequea-warning);
}

.xequea-alert-info {
    background: #cff4fc; /* fondo opaco para mejor legibilidad */
    color: var(--xequea-info);
}

.xequea-alert-info::before {
    background: var(--xequea-info);
}

/* ========================================
   BADGES Y ESTADOS
   ======================================== */
.xequea-badge {
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.xequea-badge-success {
    background: linear-gradient(135deg, var(--xequea-success) 0%, #1e7e34 100%);
    color: var(--xequea-white);
}

.xequea-badge-danger {
    background: linear-gradient(135deg, var(--xequea-danger) 0%, #c82333 100%);
    color: var(--xequea-white);
}

.xequea-badge-warning {
    background: linear-gradient(135deg, var(--xequea-warning) 0%, #e0a800 100%);
    color: var(--xequea-dark);
}

.xequea-badge-primary {
    background: linear-gradient(135deg, var(--xequea-primary) 0%, var(--xequea-accent) 100%);
    color: var(--xequea-dark);
}

/* ========================================
   UTILIDADES RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .xequea-bubble {
        border-radius: var(--xequea-border-radius-sm);
        padding: 1rem;
    }
    
    .xequea-table-container {
        border-radius: var(--xequea-border-radius-sm);
        overflow-x: auto;
    }
    
    .xequea-btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .xequea-filters {
        padding: 1rem;
    }
    
    /* Mejoras para botones de acción en móviles */
    .btn-sm {
        min-width: 40px;
        min-height: 40px;
        padding: 0.5rem;
        margin: 0.125rem;
        border-radius: var(--xequea-border-radius);
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    .btn-sm i {
        font-size: 1rem;
    }
    
    /* Contenedor de botones de acción responsive */
    .btn-group-sm {
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem;
        justify-content: center;
    }
    
    /* Tabla responsive mejorada */
    .xequea-table {
        font-size: 0.875rem;
    }
    
    .xequea-table td {
        padding: 0.5rem 0.25rem;
        vertical-align: middle;
    }
    
    .xequea-table th {
        padding: 0.75rem 0.25rem;
        font-size: 0.8rem;
    }
}

/* Estilos adicionales para tablets */
@media (max-width: 992px) and (min-width: 769px) {
    .btn-sm {
        min-width: 36px;
        min-height: 36px;
        padding: 0.375rem;
    }
    
    .xequea-table td {
        padding: 0.75rem 0.5rem;
    }
}

/* ========================================
   ANIMACIONES Y TRANSICIONES
   ======================================== */
@keyframes xequea-fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.xequea-fade-in {
    animation: xequea-fadeIn 0.5s ease-out;
}

.xequea-hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.xequea-hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: var(--xequea-shadow-lg);
}

/* ========================================
   COMPATIBILIDAD CON BOOTSTRAP
   ======================================== */
.btn-primary {
    background-color: var(--xequea-primary) !important;
    border-color: var(--xequea-primary) !important;
    color: var(--xequea-white) !important;
}

.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
    background-color: var(--xequea-secondary) !important;
    border-color: var(--xequea-secondary) !important;
    color: var(--xequea-white) !important;
}

.text-primary {
    color: var(--xequea-primary) !important;
}

.bg-primary {
    background-color: var(--xequea-primary) !important;
}

.border-primary {
    border-color: var(--xequea-primary) !important;
}