/* ==========================================
   1. FONDO TAILWIND ZINC (Ultra Dark)
   ========================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

body {
    background-color: #09090b !important; /* Tailwind Zinc 950 */
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.04) 0%, transparent 40%),
        radial-gradient(circle at 85% 30%, rgba(6, 182, 212, 0.04) 0%, transparent 40%) !important;
    background-attachment: fixed;
    color: #e4e4e7 !important; /* Zinc 200 */
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ==========================================
   2. PANELES PREMIUM (Bordes finos y Glass sutil)
   ========================================== */
.card, .bg-white, .bg-light, .glass-panel {
    background: #18181b !important; /* Zinc 900 */
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.5) !important;
    border-radius: 12px !important;
    color: #f4f4f5 !important;
}

.card-header {
    background: transparent !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.3px;
    padding: 12px 16px !important;
}

/* ==========================================
   3. SIDEBAR MODERNO (Limpieza absoluta)
   ========================================== */
.sidebar {
    width: 260px;
    height: calc(100vh - 2rem);
    position: fixed;
    top: 1rem;
    left: 1rem;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    border-radius: 16px !important;
    background: rgba(9, 9, 11, 0.6) !important;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
}

.sidebar-link {
    color: #a1a1aa; /* Zinc 400 */
    text-decoration: none;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 4px;
    transition: all 0.2s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
}

.sidebar-link i {
    font-size: 1.15rem; /* Iconos un poco más grandes */
}

.sidebar-link:hover, .sidebar-link.active {
    background: #27272a; /* Zinc 800 */
    color: #ffffff;
}

.sidebar-link.active {
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

.main-content {
    margin-left: 290px;
    padding: 1rem 1rem 1rem 0;
    min-height: 100vh;
}

/* ==========================================
   4. INPUTS ESTILO STRIPE / TAILWIND
   ========================================== */
.form-control, .form-select, .input-group-text {
    background-color: #09090b !important; 
    border: 1px solid #3f3f46 !important; /* Zinc 700 */
    color: #f4f4f5 !important;
    border-radius: 8px !important;
    transition: all 0.2s ease;
    font-size: 0.85rem !important;
    padding: 8px 12px !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.3) !important;
}

.input-group-text {
    background-color: #18181b !important;
    color: #a1a1aa !important;
    font-weight: 500;
}

.form-control:hover, .form-select:hover {
    border-color: #52525b !important; 
}

/* El famoso "Focus Ring" de Tailwind */
.form-control:focus, .form-select:focus {
    box-shadow: 0 0 0 2px #09090b, 0 0 0 4px rgba(99, 102, 241, 0.4) !important; 
    border-color: #6366f1 !important; /* Indigo 500 */
    background-color: #09090b !important;
}

select option {
    background-color: #18181b !important; 
    color: #e4e4e7 !important; 
    padding: 10px;
}

/* Switches (Botones de check) estilo iOS/Tailwind */
.form-check-input {
    background-color: #3f3f46 !important;
    border-color: #3f3f46 !important;
}
.form-check-input:checked {
    background-color: #6366f1 !important;
    border-color: #6366f1 !important;
}

/* ==========================================
   5. BOTONES MODERNOS
   ========================================== */
.btn {
    border-radius: 8px !important;
    font-weight: 500 !important;
    letter-spacing: 0.2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(180deg, #6366f1 0%, #4f46e5 100%) !important;
    border: 1px solid #4338ca !important;
    color: white !important;
}
.btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

/* ==========================================
   6. SCROLLBAR INVISIBLE
   ========================================== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #3f3f46; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #52525b; }
/* ==========================================
   7. BOTONES DE ACCIÓN (Tablas y Formularios)
   ========================================== */
.btn-outline-info, .btn-outline-primary, .btn-outline-warning, .btn-outline-danger, .btn-outline-success {
    background: rgba(24, 24, 27, 0.5) !important; /* Fondo zinc semitransparente */
    backdrop-filter: blur(4px);
    border-width: 1px !important;
    transition: all 0.2s ease;
}

.btn-outline-info { border-color: rgba(6, 182, 212, 0.4) !important; color: #22d3ee !important; }
.btn-outline-info:hover { background: rgba(6, 182, 212, 0.15) !important; border-color: #06b6d4 !important; }

.btn-outline-danger { border-color: rgba(239, 68, 68, 0.4) !important; color: #f87171 !important; }
.btn-outline-danger:hover { background: rgba(239, 68, 68, 0.15) !important; border-color: #ef4444 !important; }

.btn-outline-warning { border-color: rgba(245, 158, 11, 0.4) !important; color: #fbbf24 !important; }
.btn-outline-warning:hover { background: rgba(245, 158, 11, 0.15) !important; border-color: #f59e0b !important; }

.btn-outline-primary { border-color: rgba(99, 102, 241, 0.4) !important; color: #818cf8 !important; }
.btn-outline-primary:hover { background: rgba(99, 102, 241, 0.15) !important; border-color: #6366f1 !important; }
/* ==========================================
   8. CORRECCIÓN DEFINITIVA: RADIOS NOTORIOS
   ========================================== */

/* Estilo base: ambos botones opacos y sin fondo */
.btn-check + .btn-outline-success, 
.btn-check + .btn-outline-warning {
    background-color: transparent !important;
    opacity: 0.4; /* Muy opaco para que se note que NO está seleccionado */
    border-width: 2px !important;
    transition: all 0.3s ease;
    color: #a1a1aa !important; /* Texto gris por defecto */
}

/* --- CUANDO SE SELECCIONA "LO ENTREGUÉ" --- */
#dest_entregado:checked + .btn-outline-success {
    background-color: #22c55e !important; /* Verde sólido vibrante */
    color: #052e16 !important; /* Texto negro/verde oscuro para contraste */
    opacity: 1 !important; /* Brillo total */
    border-color: #22c55e !important;
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.5) !important; /* Resplandor neón */
    transform: scale(1.02); /* Crece un poquito */
}

/* --- CUANDO SE SELECCIONA "EN TIENDA" --- */
#dest_caja:checked + .btn-outline-warning {
    background-color: #fbbf24 !important; /* Amarillo/Ámbar sólido */
    color: #451a03 !important; /* Texto negro/marrón oscuro */
    opacity: 1 !important; /* Brillo total */
    border-color: #fbbf24 !important;
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.5) !important; /* Resplandor neón */
    transform: scale(1.02); /* Crece un poquito */
}

/* Iconos dentro de los botones seleccionados */
.btn-check:checked + label i {
    color: inherit !important;
}
.popover {
    background: #18181b !important;
    border: 1px solid rgba(6, 182, 212, 0.4) !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.8);
    border-radius: 8px;
}
.popover-body {
    color: #e4e4e7 !important;
    font-size: 0.85rem;
    line-height: 1.6;
    padding: 12px;
    background: #18181b !important;
}
.popover .popover-arrow::after {
    border-bottom-color: #18181b !important;
}