/**
 * Styles spécifiques au formulaire de création de facture.
 * Couleurs via variables CSS pour compatibilité dark mode.
 */

/* Scanner code-barres — limiter débordement */
#barcode-video {
    max-width: 100% !important;
    overflow: hidden !important;
}

#barcode-video video,
#barcode-video canvas {
    max-width: 100% !important;
    height: auto !important;
    display: block !important;
}

/* Switch AIB (Acompte sur Impôt sur les Bénéfices) */
.aib-switch {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.aib-switch input[type="checkbox"] {
    width: 50px;
    height: 26px;
    background-color: var(--color-text-muted, #475569);
    border: none !important;
    box-shadow: none !important;
    border-radius: 13px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
    outline: none;
    margin: 0;
    flex-shrink: 0;
}

.aib-switch input[type="checkbox"]:focus {
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
}

.aib-switch input[type="checkbox"]::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    background-color: white;
    transition: left 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.aib-switch input[type="checkbox"]:checked {
    background-color: var(--brand-primary, #3B82F6);
}

.aib-switch input[type="checkbox"]:checked::before {
    left: 26px;
}

.aib-switch label {
    margin: 0;
    cursor: pointer;
    font-weight: 500;
    font-size: 15px;
    color: inherit;
    user-select: none;
}

.aib-switch i {
    color: var(--color-text-muted, #9ca3af);
    font-size: 18px;
    cursor: help;
}

.aib-switch i:hover {
    color: var(--color-text-secondary, #6b7280);
}

/* Sortable — ghost pendant le drag */
.sortable-ghost {
    opacity: 0.4;
}

.drag-handle:hover {
    color: var(--color-text-primary) !important;
}
