@use '~@/style/globals';

.InventoryItemMaterial {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0;
    border-radius: globals.$input-border-radius;
    background: rgba(#fff, 0.05);
    color: globals.$text-base-color;

    &__reference,
    &__name,
    &__awaited-quantity {
        padding: 0 globals.$content-padding-large-horizontal;
    }

    &__reference {
        flex: 0 0 200px;
    }

    &__name {
        flex: 1;
        color: globals.$text-nav-color;
    }

    &__error {
        flex: 1;
        color: globals.$text-danger-color;
    }

    &__awaited-quantity {
        flex: 0 0 auto;
        display: inline-flex;
        justify-content: center;
        color: globals.$text-nav-color;
        text-align: right;

        &__count {
            margin-left: 0.3rem;
            color: globals.$text-base-color;
            font-size: 1.1rem;
        }
    }

    &__actual-quantity,
    &__quantity-broken {
        flex: 0 0 auto;
        text-align: center;
    }

    &__quantity-broken {
        margin-left: globals.$content-padding-large-vertical;
    }

    &--read-only {
        .InventoryItemMaterial__actual-quantity,
        .InventoryItemMaterial__quantity-broken {
            flex: 0 0 95px;
            padding: globals.$content-padding-small-horizontal 0;
            color: globals.$text-light-color;
            font-size: 1.1rem;
        }
    }

    &--complete {
        background: rgba(globals.$text-success-color, 0.25);

        .InventoryItemMaterial__actual-quantity {
            color: globals.$text-base-color;
            font-weight: 600;
        }
    }

    &--warning {
        background: rgba(globals.$text-warning-color, 0.25);

        .InventoryItemMaterial__actual-quantity {
            color: globals.$text-warning-color;
            font-weight: 600;
        }

        .InventoryItemMaterial__quantity-broken {
            color: globals.$text-danger-color;
            font-weight: 600;
        }
    }

    &--error {
        background: rgba(globals.$text-danger-color, 0.25);

        .InventoryItemMaterial__actual-quantity {
            color: globals.$text-danger-color;
            font-weight: 600;
        }
    }
}
