/* Modale Ingrédients : fiche compacte et explicite */
.tuco-ingredient-editor-modal .modal-dialog {
    max-width: 920px !important;
}

.tuco-ingredient-editor-modal .modal-content {
    min-height: 0 !important;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.tuco-ingredient-editor-modal .modal-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
}

.tuco-ingredient-editor-modal .modal-body {
    min-height: 0 !important;
    padding: 20px 22px 14px;
}

.tuco-ingredient-editor-modal .modal-footer {
    padding: 14px 22px;
    border-top: 1px solid var(--border);
}

.tuco-ingredient-editor-modal #ing-purchase-card {
    min-height: 0 !important;
}

.tuco-ingredient-editor-modal .ing-official-intro {
    margin-top: 0 !important;
    font-size: var(--fs-base);
}

.tuco-ingredient-editor-modal .ing-purchase-heading {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.tuco-ingredient-editor-modal .ing-purchase-heading h6 {
    color: var(--text);
    font-size: var(--fs-base);
    font-weight: var(--fw-semibold);
}

.tuco-ingredient-editor-modal .ing-purchase-help {
    margin-top: 6px;
    max-width: 720px;
    font-size: var(--fs-sm);
}

.tuco-ingredient-editor-modal .form-control,
.tuco-ingredient-editor-modal .input-group-text,
.tuco-ingredient-editor-modal .Select-control {
    min-height: 42px;
}

.tuco-ingredient-editor-modal #ing-purchase-products {
    margin-bottom: 0 !important;
}

@media (max-width: 991px) {
    .tuco-ingredient-editor-modal .modal-dialog {
        max-width: calc(100vw - 24px) !important;
        margin: 12px auto;
    }
}

/* === SAFE INGREDIENT ALIGNMENT === */

/* Les trois champs commencent exactement à la même hauteur */
.tuco-ingredient-editor-modal
#ing-purchase-card > .row {
    align-items: flex-start !important;
}

/* L’explication de la perte ne doit pas déformer toute la ligne */
.tuco-ingredient-editor-modal
#ing-purchase-card > .row > div:last-child .form-text,
.tuco-ingredient-editor-modal
#ing-purchase-card > .row > div:last-child .text-muted {
    display: none !important;
}

/* Hauteur identique : nom, unité et perte */
.tuco-ingredient-editor-modal #ing-f-name,
.tuco-ingredient-editor-modal #ing-f-loss,
.tuco-ingredient-editor-modal
.input-group:has(#ing-f-loss),
.tuco-ingredient-editor-modal
.input-group:has(#ing-f-loss) .input-group-text,
.tuco-ingredient-editor-modal
#ing-f-unit .Select-control {
    height: 44px !important;
    min-height: 44px !important;
}

.tuco-ingredient-editor-modal #ing-f-name,
.tuco-ingredient-editor-modal #ing-f-loss {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.tuco-ingredient-editor-modal
#ing-f-unit .Select-value,
.tuco-ingredient-editor-modal
#ing-f-unit .Select-placeholder,
.tuco-ingredient-editor-modal
#ing-f-unit .Select-value-label {
    line-height: 42px !important;
}

/* === END SAFE INGREDIENT ALIGNMENT === */

/* Champ Perte simple, sans flèches natives */
.tuco-ingredient-editor-modal #ing-f-loss {
    width: 100% !important;
    height: 44px !important;
    min-height: 44px !important;
    padding: 0 12px !important;
    text-align: left;
    background: var(--input-surface);
    appearance: textfield;
    -moz-appearance: textfield;
}

.tuco-ingredient-editor-modal
#ing-f-loss::-webkit-inner-spin-button,
.tuco-ingredient-editor-modal
#ing-f-loss::-webkit-outer-spin-button {
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
}

/* Retirer le cadre inutile autour du formulaire */
.tuco-ingredient-editor-modal #ing-editor-tabs,
.tuco-ingredient-editor-modal #ing-editor-tabs .tab-content,
.tuco-ingredient-editor-modal #ing-editor-tabs .tab-pane,
.tuco-ingredient-editor-modal #ing-purchase-card {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    background: transparent !important;
}

/* Conversions : champ numérique simple sans flèches */
#ing-purchase-conversions input[type="number"] {
    appearance: textfield !important;
    -moz-appearance: textfield !important;
}

#ing-purchase-conversions
input[type="number"]::-webkit-inner-spin-button,
#ing-purchase-conversions
input[type="number"]::-webkit-outer-spin-button {
    margin: 0 !important;
    appearance: none !important;
    -webkit-appearance: none !important;
}

