/* ═══════════════════════════════════════════════════════════════
   Styles partagés pour les 3 points d'entrée de transfert :
   - Quick-transfert (modal depuis fiche lieu)
   - /transfert/new (form brouillon EN_ATTENTE)
   - /transfert/massif (lot multi-articles)

   Préfixe unique `tr-` (transfert) pour tous les composants partagés.
   ═══════════════════════════════════════════════════════════════ */

/* ─── Flow bandeau DEPUIS → VERS ─── */
.tr-flow {
    display: flex;
    align-items: stretch;
    gap: 10px;
    padding: 14px;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: 10px;
}
.tr-flow-side {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 12px;
    background: var(--color-bg-primary);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    min-width: 0;
}
.tr-flow-side small {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-secondary);
}
.tr-flow-side strong {
    font-size: 13.5px;
    color: var(--color-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tr-flow-side span {
    font-size: 11px;
    color: var(--color-text-secondary);
}
.tr-flow-arrow {
    display: flex;
    align-items: center;
    color: var(--color-text-secondary);
    opacity: 0.5;
    font-size: 16px;
}
.tr-placeholder { color: var(--color-text-secondary); font-weight: 500; }

/* ─── Bandeaux d'alerte (couple dérogation/interdit, erreurs) ─── */
.tr-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 13.5px;
    border-left-width: 4px;
    border-left-style: solid;
}
.tr-alert i { font-size: 17px; flex-shrink: 0; }
.tr-alert--error {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-left-color: #ef4444;
    color: #b91c1c;
}
body.has-dark-sidebar .tr-alert--error,
[data-theme="dark"] .tr-alert--error { color: #fca5a5; }
.tr-alert--error i { color: #ef4444; }
.tr-alert--success {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-left-color: #10b981;
    color: #047857;
}
body.has-dark-sidebar .tr-alert--success,
[data-theme="dark"] .tr-alert--success { color: #6ee7b7; }
.tr-alert--success i { color: #10b981; }
.tr-alert--warning {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-left-color: #f59e0b;
    color: #92400e;
}
body.has-dark-sidebar .tr-alert--warning,
[data-theme="dark"] .tr-alert--warning { color: #fcd34d; }
.tr-alert--warning i { color: #f59e0b; }

/* ─── Preview d'impact (source/destination avant/après) ─── */
.tr-impact {
    padding: 16px 18px;
    background: rgba(var(--brand-primary-rgb, 59, 130, 246), 0.04);
    border: 1px solid rgba(var(--brand-primary-rgb, 59, 130, 246), 0.18);
    border-radius: 10px;
}
.tr-impact-head {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--color-text-secondary);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(var(--brand-primary-rgb, 59, 130, 246), 0.15);
}
.tr-impact-head i { color: var(--brand-primary); font-size: 13px; }
.tr-impact-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px 8px;
    color: var(--color-text-secondary);
}
.tr-impact-placeholder i {
    font-size: 2rem;
    opacity: 0.4;
    margin-bottom: 10px;
}
.tr-impact-placeholder p {
    font-size: 12.5px;
    margin: 0;
    line-height: 1.5;
}
.tr-impact-placeholder strong {
    color: var(--color-text-primary);
    font-weight: 600;
}
.tr-impact-body { display: flex; flex-direction: column; gap: 12px; }
.tr-impact-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.tr-impact-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--color-text-primary);
    font-weight: 600;
    min-width: 0;
    flex: 1;
}
.tr-impact-label i { font-size: 14px; color: var(--color-text-secondary); }
.tr-impact-values {
    display: flex;
    align-items: center;
    gap: 8px;
    font-variant-numeric: tabular-nums;
}
.tr-impact-before {
    color: var(--color-text-secondary);
    font-weight: 600;
    font-size: 13.5px;
}
.tr-impact-arrow { color: var(--color-text-secondary); opacity: 0.5; font-size: 12px; }
.tr-impact-after { font-weight: 700; font-size: 14.5px; }
.tr-impact-after.tr-down { color: #f59e0b; }
.tr-impact-after.tr-up { color: #10b981; }
.tr-impact-after.tr-error { color: var(--color-danger, #ef4444); }
.tr-impact-warning {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 8px 12px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 8px;
    color: var(--color-danger, #ef4444);
    font-size: 12.5px;
    font-weight: 600;
}
.tr-impact-warning i { font-size: 14px; flex-shrink: 0; }

/* ─── Indicateur dérogation (motif + commentaire) ─── */
.tr-required-label.is-required {
    color: var(--color-danger, #ef4444);
}
.tr-required-label.is-required::after {
    content: ' *';
    color: var(--color-danger, #ef4444);
    font-weight: 700;
}
.tr-motif-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    padding: 6px 10px;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: 6px;
    font-size: 11.5px;
    color: #92400e;
}
body.has-dark-sidebar .tr-motif-hint,
[data-theme="dark"] .tr-motif-hint { color: #fcd34d; }
.tr-motif-hint i { color: #f59e0b; font-size: 13px; }

/* ─── Autocomplete article custom (massif + new) ─── */
.tr-autoc { position: relative; }
.tr-autoc-input { width: 100%; }
.tr-autoc-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1050;
    background: var(--color-bg-primary);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    margin-top: 4px;
    max-height: 280px;
    overflow-y: auto;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}
.tr-autoc-status {
    padding: 12px;
    font-size: 13px;
    text-align: center;
}
.tr-autoc-item {
    display: block;
    width: 100%;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--color-border-light, var(--color-border));
    text-align: left;
    cursor: pointer;
    transition: background 0.12s ease;
    color: var(--color-text-primary);
}
.tr-autoc-item:last-child { border-bottom: none; }
.tr-autoc-item:hover,
.tr-autoc-item.is-active {
    background: rgba(var(--brand-primary-rgb, 59, 130, 246), 0.08);
}
.tr-autoc-item-name {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 2px;
}
.tr-autoc-item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11.5px;
    color: var(--color-text-secondary);
}
.tr-autoc-item-stock {
    font-weight: 600;
    color: var(--brand-primary);
    background: rgba(var(--brand-primary-rgb, 59, 130, 246), 0.1);
    padding: 1px 7px;
    border-radius: 99px;
}

/* Article sélectionné en "chip" */
.tr-article-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: rgba(var(--brand-primary-rgb, 59, 130, 246), 0.06);
    border: 1px solid rgba(var(--brand-primary-rgb, 59, 130, 246), 0.2);
    border-radius: 8px;
}
.tr-article-chip-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}
.tr-article-chip-text strong {
    color: var(--color-text-primary);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tr-article-chip-text small { font-size: 11px; }
.tr-article-chip button { flex-shrink: 0; }
